How to disable/ set logging level /preferences PER Mac OS X application?
You may want to look at asl.conf(5)
which allows you to ignore/process log messages on quite a fine-grained level.
Something like:
? [= Sender ObnoxiousLogger] ignore
should do the trick. If you still want to see the more serious messages from the obnoxious sender, something along the lines of:
? [= Sender ObnoxiousLogger] [> Level error] ignore
might be more appropriate.
Note: after editing /etc/asl.conf
, don't forget to kill -HUP
your syslogd.
Just create a File » New Database Search…, looking for Facility contains "console
" and Sender does not contain "ObnoxiousLogger
", and ignore the default Console Messages database search?
You can use the following command to set individual log filtering levels for specific processes:
syslog -c processname -d
This will set the log level of currently running instances of processname
to all messages of debug level or higher. the possible levels are each character of pacewnid
: (Panic), Alert, Critical, Error, Warning, Notice, Info, and Debug.
So, to only enable logging of warning messages and higher for Finder, use:
syslog -c Finder -w
You will need to repeat this whenever you restart the process in question.
I am on MacOS Mojave (10.14.3) and this post was helpful to me so I want to clarify what worked for me as I have not seen it all together in a single place. In my case I wanted to filter out Microsoft OneNote messages which were constantly spamming my system.log file at a rate of 5 a second. Sample message:
Feb 3 22:52:49 MyMacMini-2 Microsoft OneNote[393]: [ACT]:[TASKSCHEDULER]:[Info]:opQueue=0x6000012d7760 after call to waitUntilAllOperationsAreFinished
So I edited /etc/asl.conf with the following rule:
# Disable Microsoft OneNote logging as is filling up system.log!
? [= Sender Microsoft OneNote] ignore
You need to add this before the line that says:
# Rules for /var/log/system.log
As otherwise it will not work. Then just restart syslogd with this command and the messages should be gone from system.log:
sudo killall -HUP syslogd