Apache Logging

Apache Better Log Rotation mod_log_rotate

Important: The Apache provided tool rotatelogs.exe is to buggy to use "for real", see: Apache Rotatelogs.exe for Windows Server

Apache Rotatelogs.exe for Windows Server

When using the Apache tool, rotatelogs.exe, you can see (using the task manager) multiple instances of rotatelogs.exe. Even when using it on just 1 web site!
To make this issue even more disastrous when restarting the Apache (httpd.exe), not all instances of rotatelog.exe are released.
Doing some research on the web it looks like this issue has been going on since years (Apache 1.3, 2.0 and now 2.2....).
Note: I've verified this issue with both Apache 2.0.55 and 2.2.0

Apache Logs (Awstats)

The Apache httpd.conf directive "LogFormat" defines a log formatting that can then be referenced using its name. The following 2 examples define the log formats named: "combinedv" and "combined".

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %V" combinedv
CustomLog pathtoyourlog/yourlog.log combinedv

Or the standard NCSA combined/XLF/ELF format (this format should already be defined in the distribution httpd.conf file).
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
CustomLog /yourlogpath/yourlogfile combined

The CustomLog item is required, if you want to use a specified LogFormat and save the logs in a specific folder. Usually webmasters will want to save logs for each site in the appropriate "site" folder.

Apache Preferred Awstats Custom Log Formats

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %V" combinedv

"Remote host" "Remote logname" "Remote user" "Time the request was received" "First line of request" "Status" "Size of response in bytes" "Referer" "User-Agent" "The server name" in the Apache logs

If was getting in the Apache logs. To solve this on Windows 2000 I had to enable this directinve in the httpd.conf: