Specifications

298 Chapter 19 Configuring and Managing System Logging
The following example specifies that for any log messages in the category mail, with a
priority of emerg or higher, the message is written to the /var/log/mail.log file:
mail.emerg /var/log/mail.log
The facility and priority are separated by a single period, and these are separated from
the action by tabs. Wildcards (β€œ*”) can also be used. The following example line logs all
messages of any facility or priority to the file /var/log/all.log:
*.* /var/log/all.log
For information about the configuration of this file, see the syslog.conf man page.
Local Logging
The default configuration in /etc/syslog.conf is appropriate for a Mac OS X Server
system if a remote log server is not available. The computer is set to rotate log files
using a cron job at the time intervals specified in the file /etc/crontab.
Rotation entails compressing the current log file, incrementing the integer in the
filename of compressed log files, and creating a log file for new messages. For example,
the following files were created in the /var/log/ folder:
system.log
system.log.0.gz
system.log.1.gz
system.log.2.gz
system.log.3.gz
system.log.4.gz
The log files are rotated by a cron job, and the rotation occurs if the computer is on
when the job is scheduled. By default, log rotation tasks are scheduled for early in the
morning (for example, 4:30 a.m. on Saturday) to be as unobtrusive as possible. If the
computer will not be on at this time, adjust the settings in /etc/crontab.
The following example shows the default for running the weekly log rotation script,
which is configured for 4:15 a.m. on the last day of the week, Saturday (Sunday is 0). An
asterisk denotes β€œany,” so a line of all asterisks would execute every minute.
DayOf DayOf
#Minute Hour Month Month Week User Command
15 4 * * 6 root periodic weekly
The following line would change the time to 12:15 p.m. on Tuesday, when the computer
is more likely to be on:
DayOf DayOf
#Minute Hour Month Month Week User Command
15 12 * * 2 root periodic weekly
For more information about editing the /etc/crontab file, see the crontab man page.