Newsyslog.conf
From FreeBSDwiki
(Difference between revisions)
m |
m (Reverted edits by 195.218.140.201 (Talk); changed back to last version by Baraboom) |
Latest revision as of 14:31, 5 May 2007
(Usually located at /etc/newsyslog.conf)
Controls behavior of newsyslog, the utility which periodically (in most systems, once per hour) reviews all logs mentioned in this file and archives / rotates / trims those logs in accordance with specifications contained within. See man newsyslog for lots of detailed info on setting this up.
[edit] Rotating Apache Logs
/path/to/some.log root:wheel 600 3 * $D0 JB /var/run/httpd.pid 30
This line will rotate the log, maintain the privileges, keep 3 old rotations, rotate daily at midnight, treat the log as a binary file, compress it with bzip2 and restart apache with signal 30. There are obviously a lot of options you can change to suit your needs but the 'B' flag and the '30' signal are recommended for apache logs.