If you refer to the man entry of syslog.conf, I guess the line is just an example:
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none /var/log/messages
If you want to use that directory in your configuration, you'll have to create it.
Edit: The actual syslog.conf on Mac OS X uses the system.log
file.
As Chealion mentioned, there are several ways that your mysql could have been installed. Each of which will place your data dir and/or logs in different locations. The following command will give you (and us) a good indication of where to look.
ps auxww|grep [m]ysqld
# Putting brackets around the first char is a `grep`+`ps` trick
# to keep it from matching its own process.
# Note: For zsh compatibility put quotes around the grep regex
Can you post the result of that command here please? Mine looks like this:
_mysql 101 0.0 0.3 112104 13268 ?? S 12:30AM 0:13.20 /opt/local/libexec/mysqld --basedir=/opt/local --datadir=/opt/local/var/db/mysql --user=mysql --pid-file=/opt/local/var/db/mysql/rbronosky-mbp.pid
root 76 0.0 0.0 600172 688 ?? S 12:30AM 0:00.02 /bin/sh /opt/local/lib/mysql/bin/mysqld_safe --datadir=/opt/local/var/db/mysql --pid-file=/opt/local/var/db/mysql/rbronosky-mbp.pid
From that you can see that my datadir is /opt/local/var/db/mysql
(because I installed via MacPorts). Let's take this lesson a bit further...
From the first line you can see the my daemon is /opt/local/libexec/mysqld
. The mysqld
can be called with --verbose --help
to get a list of all command line options (and here is the important/valuable part!) followed by the values that would be used if you were launching mysqld instead of just checking the help output. The values are the result of your compile time configuration, my.cnf
file, and any command line options. I can exploit this feature to find out EXACTLY where my log files are, like so:
/opt/local/libexec/mysqld --verbose --help|grep '^log'
Mine looks like this:
log /tmp/mysql.log
log-bin /tmp/mysql-bin
log-bin-index (No default value)
log-bin-trust-function-creators FALSE
log-bin-trust-routine-creators FALSE
log-error /tmp/mysql.error.log
log-isam myisam.log
log-queries-not-using-indexes FALSE
log-short-format FALSE
log-slave-updates FALSE
log-slow-admin-statements FALSE
log-slow-queries (No default value)
log-tc tc.log
log-tc-size 24576
log-update (No default value)
log-warnings 1
LO AND BEHOLD! all of the advice in the world was not going to help me because my log file is kept in a completely non-standard location! I keep mine in /tmp/
because on my laptop, I don't care (actually I prefer) to loose all of my logs on reboot.
Let's put it all together and make you a oneliner:
$(ps auxww|sed -n '/sed -n/d;/mysqld /{s/.* \([^ ]*mysqld\) .*/\1/;p;}') --verbose --help|grep '^log'
Execute that one command and you will get a list of all of the logs for your running instance of mysql.
Enjoy!
This Bash-Fu brought to you for free by my commitment to all things Open Source.
Best Answer
On OS X, /var/log/system.log is rotated by the
newsyslog
command, which is run at half-past each hour (see /System/Library/LaunchDaemons/com.apple.newsyslog.plist) whenever the Mac is running and awake. The rotation rules are in /etc/newsyslog.conf, from which the relevant lines are:If I understand this right (see the newsyslog.conf man page), the "@T00" in the "when" field means that the log will be rotated if newsyslog runs between midnight and 1am -- i.e. at the 12:30am run. But if the Mac is off or asleep at 12:30, this run won't happen and the log won't get rotated that day, which is probably why you see such variable results.
If you want to change the rotation criteria, feel free to edit /etc/newsyslog.conf; most of the other logs get rotated based on size, and I'm not sure why system.log is different.
UPDATE: Starting in 10.9, the rotation control for system.log moved from /etc/newsyslog.conf to /etc/asl.conf (the config for the Apple System Log facility, which does the writing to system.log). It'll have a section like this:
The "rotate=seq compress file_max=5M all_max=50M" section controls archiving and retention. See man asl.conf for more info and options.
The logging system got a pretty thorough rewrite in 10.12, but this doesn't appear to have changed.