XSSI Library

Mini Log
Developed by Ross Olson

Wading through log files can be a real pain in the neck. Try this simple code to establish a mini log file for a page.

There's a few things that need to be in place for this to work:

  1. An empty text file for the log, with permissions set for writing by the Web server. (I'd suggest making the file writable by all or at least by the permission of the web server.)

  2. The #exec command needs to be available, so that the shell command will be executed. This can be a security hole under some circumstances, so if you aren't the administrator for your server (and therefore have set this up for yourself, you may run into problems.

Once you have the empty text file in place with the correct permissions and the #exec command enabled and in your page, you can watch your hits come flooding in.

You may find that adding delimiters between the variables to something useful for you might be helpful. You can also add other environment variables to the command to put more information in your mini log.


<!--#exec cmd="echo $DATE_LOCAL  $REMOTE_HOST  $HTTP_REFERER >> log.txt"-->

A printer-friendly version of this article is available.
This site hand-coded for your protection.