pavement

Newsyslog.conf

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
Line 2: Line 2:
  
 
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.
 
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/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.
  
 
[[Category:Important Config Files]]
 
[[Category:Important Config Files]]

Revision as of 18:45, 15 October 2005

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

Personal tools