Apache Guide: Logging with Apache--Understanding Your access_log Page 3
Setting the location of your access_log
Where the 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 commonNote: If you're running an older version of Apache, this line might look a little different. It might be the
TransferLog
directive instead of theCustomLog
directive. If that is the case, I really recommend that you upgrade if at all possible.The
CustomLog
directive 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 thecommon
log 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
User
directive), and so this is potentially a security problem.
Upcoming articles
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.