====== newsyslog ======
* [[OS X]]
* [[https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/newsyslog.8.html|newsyslog man page]]
* [[https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/newsyslog.conf.5.html|newsyslog.conf man page]]
Log rotation for OS X.
New system log rotation rules are put in ''/etc/newsyslog.d/''
=== Configuration ===
The configuration for the ''newsyslog.conf'' files are as follows: keep 5 logs, don't trim log file based on size, rotate daily, and to compress the log files using bzip2, and not signal any processes post-rotation.
** Rotate PHP logs **
Add this to ''/etc/newsyslog.d/php.conf'', or download it [[http://beandog.digitaltrike.com/osx/newsyslog/php.conf|here]]
The permissions here are set so that the developer and the httpd daemon can write to them.
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/usr/local/steve/logs/php53.log daemon:staff 664 5 * $D0 JN
/usr/local/steve/logs/php54.log daemon:staff 664 5 * $D0 JN
/usr/local/steve/logs/php55.log daemon:staff 664 5 * $D0 JN
/usr/local/steve/logs/php56.log daemon:staff 664 5 * $D0 JN
** Rotate Apache logs **
Add this to ''/etc/newsyslog.d/apache.conf'', or download it [[http://beandog.org/osx/newsyslog/apache.conf|here]]
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/usr/local/steve/apache2/logs/access_log root:wheel 644 5 * $D0 JN
/usr/local/steve/apache2/logs/error_log root:wheel 644 5 * $D0 JN
/usr/local/steve/apache2/logs/ssl_request_log root:wheel 644 5 * $D0 JN
/usr/local/steve/apache2/logs/suexec_log root:wheel 644 5 * $D0 JN