From FreeBSDwiki
Jump to: navigation, search

(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.

Rotating Apache Logs

/path/to/some.log root:wheel 600 3 * $D0 JB /var/run/ 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.

Personal tools