-l use local time rather than GMT as the base for the interval or strftime formatting with size-based rotation.
in an environment which changes the GMT offset (such as for BST or DST ) this can lead to unpredictable results!
| -f force logfile to be opened immediately,
instead of waiting for the first entry to be read (for non-busy sites, there may be a substantial delay between when the server is started and when the first request is handled, meaning that the associated logfile does not "exist" until then, which causes problems from some automated logging tools).
| -D
Creates the parent directories of the path that the log file will be placed in if they do not already exist. This allows strftime(3) formatting to be used in the path and not just the filename.
| -v verbose on STDERR containing the result of the configuration parsing and file opens and closes.
| -e Echo logs through to stdout. Useful when logs need to be further processed by a further tool in the chain.
| -c Create log file for each interval, even if empty.
| -t
logfile is truncated instead of rotated. This is useful when a log is processed in real time by a command like tail, and there is no need for archived data. No suffix will be added to the filename, format strings containing '%' characters will be respected.
| -T
All but the initial logfile to be truncated when opened. Useful when the format string contains something that will loop , such as the day of the month.
| -L linkname
A hard link to be made from the current logfile to the linkname . This can be used to watch the log continuously across rotations using a command like tail -F linkname .
If the linkname is not an absolute path, it is relative to rotatelogs' working directory, which is the ServerRoot when rotatelogs is run by the server.
| -p program When a new log file is opened
program is spawned with the same stdin, stdout, and stderr and environment.
.
The filename is the first argument to the program.
If executing after a rotation, the old log file is passed as the second argument.
rotatelogs does not wait for the program to terminate .
| -n number-of-files
Use a circular list of filenames without timestamps. overwrites log files at startup and during rotation.
With -n 3, the series of log files opened would be "logfile", "logfile.1", "logfile.2", then overwriting "logfile".
when "logfile" is first opened , it will be truncated if -t is also provided, subsequent rotations begin with truncation of the target file.
For size based rotation without -t and existing log files in place, this option may result in unintuitive behavior such as initial log entries being sent to "logfile.1", and entries in "logfile.1" not being preserved even if later "logfile.n" have not yet been used.
| rotationtime seconds between log file rotations. The rotation occurs at the beginning of this interval.
examples
3600, at the beginning of every hour; (60*60)
86400, every night at midnight. 24*60*60
If no data is logged during an interval, no file will be created.
| filesizex size in megabytes
| offset minutes offset from UTC. Default: zero UTC is used.
For example, to use local time in the zone UTC -5 hours, specify -300 , -l is prefered.
| | | | | | | | | | | | | | |