How to disable logging to system.log in OS X?
During my time with Yosemite, I've had an innocuous issue that gets logged to system.log
non-stop.
This question is not about solving the issue.
I'd like to stop the chatter, because they're writes to the drive which is an SSD, and could do without them.
How can I silence or prevent the writes to the log?
The messages come from the kernel and blame IO80211ScanManager
. Example:Nov 19 02:04:46 Louis-MBP kernel[0]: IO80211ScanManager::startScan: pid 29 had pending scan request. Deleting.
They dominate the log, whose 4000 most recent messages usually cover about a day.
Logging to system.log is controlled by the /etc/asl.conf file. The default is to send all kernel messages to system.log. If you add a priority level restriction, the trivial system complaints won't be logged.
Edit the file /etc/asl.conf and find a line that looks like this
? [= Sender kernel] file system.log
and change it to
? [= Sender kernel] [<= Level error] file system.log
Send a HUP signal to the syslogd
process (or just restart your system) and the logging behavior will be changed. Use pgrep
from Terminal to find the process ID for syslogd. E.g.
$ pgrep syslogd
21
$
Then send a HUP signal to that process ID with the kill
program.
$ sudo kill -HUP 21
$
Delete the system log with the command
sudo rm /System/Library/LaunchDaemons/com.apple.syslogd.plist
macOS is the same as iOS. Whatever service is running is stored in a plist to give the command to run a script. So if you can disable or remove a service in iOS you can do it in macOS too.
This only deletes the system log service running on boot, nothing else. You can run logging manually if you want when you open the console.