Apache Guide: Logging with Apache--Understanding Your access_log Page 3
The seventh and final piece of information is the total number of bytes that were transferred to the client. This can tell you if a transfer was interrupted (if the number is different from the size of the file). Adding them up will tell you how much data your server transferred in a day, or week, or whatever.
access_log is located is actually a configuration option.
If you look in your configuration file,
httpd.conf, you should see
a line that looks like the following:
CustomLog /usr/local/apache/logs/access_log common
Note: If you're running an older version of Apache, this line might look a little different. It might be the
TransferLogdirective instead of the
CustomLogdirective. If that is the case, I really recommend that you upgrade if at all possible.
CustomLogdirective specifies where a particular log file should be stored, and what format that log should be in. Next week we'll talk about custom log formats. The log format described above is the
commonlog format, which has been in use as the standard since the beginning of web servers. That's why it still contains the ident information field, even though almost no clients actually pass that information to the server.
The path specified there is the location of the log file. Note that this location should be secured against random users writing to it, since the log file is opened by the HTTP user (specified with the
Userdirective), and so this is potentially a security problem.
In my next few articles, I'll be talking about the following subjects: Custom log format. Logging to a process, rather than to a file. The error log. Getting useful statistics out of your log files. And whatever else you fine readers suggest to me.
Thanks for reading. Please send me a note at ApacheToday@rcbowen.com if you have any suggestions or comments.
Want to discuss log files with other Apache Today readers? Then check out the PHP discussion at Apache Today Discussions.