no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| |
— | newsyslog [2015/06/01 23:03] (current) – created - external edit 127.0.0.1 |
---|
| ====== 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. |
| |
| <code> |
| # 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 |
| </code> |
| |
| ** Rotate Apache logs ** |
| |
| Add this to ''/etc/newsyslog.d/apache.conf'', or download it [[http://beandog.org/osx/newsyslog/apache.conf|here]] |
| |
| <code> |
| # 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 |
| </code> |