Rotatelogs is the pipe logger that came with Apache 2.2.
Grammar
Copy code code as follows:
Rotatelogs [-l] logfile [rotationtime [offset]] | [Filesizem]
Options
-L
Use local time instead of GMT time as a time benchmark. Note: using-l in an environment that changes the GMT offset (such as daylight saving time) can lead to unpredictable results.
LogFile
It plus the reference name is the log file name. If logfile contains "%", it is treated as a format string for strftime (), otherwise it is automatically appended with the ". nnnnnnnnnn" suffix in seconds. Both of these formats indicate when the new log is to be used.
Rotationtime
The time interval in seconds that the log file scrolls.
Offset
The number of minutes of time difference relative to UTC. If omitted, it is assumed to be "0″ and use UTC time." For example, to specify local time for a region that has a UTC difference of "-5 hours", this argument should be " -300″."
Filesizem
Specifies to scroll in filesizem file size, rather than by time or slack.
How to use in the master configuration file
Copy code code as follows:
ErrorLog "|bin/rotatelogs-l logs/error_%y%m%d.log 86400"
Customlog "|bin/rotatelogs-l logs/access_%y%m%d.log 86400" combined
[Code]
How to use in a virtual host configuration file
[Code]
ServerAdmin Webmaster@localhost
DocumentRoot "E:/htdocs"
ServerName localhost
ErrorLog "|bin/rotatelogs-l logs/localhost/error_%y%m%d.log 86400"
Customlog "|bin/rotatelogs-l logs/localhost/access_%y%m%d.log 86400" combined
Here is a day a log file, restart Apache buttoned! Above the rotatelogs for your Apache path