It's a question that everyone with a website should have in mind all the time, and often a question that is pretty hard to answer. I mean, how do you know how your website is doing? You can open it up, but that says nothing of what it looks like to your users.
Of course, you will have to write something on your server that takes a message and log it.
Now, if we want to play nicely with the browsers, your URL that logs should return something valid. Something valid, in this case, is an image. You have several options here:
- You can create a small GIF with the Gimp and serve that file. It is very inefficient as it implies going to the hard disk drive, reading a file, etc... Remember this image isn't going to be displayed anyways.
- You can dynamically generate a GIF with Java or whatever language you have on the server. This is even worse as these libraries (generating images) are very heavyweight.
- You can hardcode your small image as an array of bytes in your code and serve that. This is my preferred way of doing it.