Logs and rotation

John Korchok jkorchok at hotmail.com
Sat May 12 14:39:26 PDT 2012


Hi,

Private/etc/newsyslog.conf is the file for setting up log rotation on
Leopard, Snow Leopard and Lion. Just add lines on the bottom for each log
you want to rotate. The default Apple lines are good examples of backing up
when the log file reaches a certain size. The following line rotates the log
at 11pm Friday night, no matter what size it is and maintains 8 log backups:
/opt/local/apache2/logs/access_log 640 8 * $W6D23 J

The man page is your friend.

John Korchok

-----Original Message-----
From: macports-dev-bounces at lists.macosforge.org
[mailto:macports-dev-bounces at lists.macosforge.org] On Behalf Of Craig
Treleaven
Sent: Saturday, May 12, 2012 4:40 PM
To: macports-dev at lists.macosforge.org
Subject: Logs and rotation

Hi:

I've searched a few times in the past with but haven't found a good guide to
logging on OS X.  The port I'm working on, MythTV, consists of a number of
programs that all produce logs.  Some of the logs can grow to be very large
(10's of megs) so some mechanism of rotation would be a good thing. The
major options seem to be to log to a folder or use Syslog.

I see there are man pages for 'syslog' and 'newsyslog' on OS X.  Is there a
cookbook somewhere on using these things?  Or is there a better tool?
Obviously, OS X rotates the logs in /Private/var/log on a regular basis.
How/where is this controlled and can I set up a new directory under that
path and rotate those logs?

Even better would be an example of a port that sets up/deals with extensive
logs!

Background on Myth's logging can be found at
http://www.mythtv.org/wiki/Logging.

Thanks,

Craig

_______________________________________________
macports-dev mailing list
macports-dev at lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2171 / Virus Database: 2425/4993 - Release Date: 05/12/12



More information about the macports-dev mailing list