MacOS – Mac ASL: Unable to see the application’s log messages

aslloggingmacossyslogd

I have just added ASL logging support to my application (a compiled binary) but I cannot see any log entries using Console.app. I am logging with facility 'com.mydomain.myapp' (that's not the actual value) and have added an entry to /private/etc/asl.conf to tell syslogd to 'store' entries at this Facility (with any Level):

? [= Facility com.mydomain.myapp] store

I HUP'd syslogd with no success so I restarted my MacBook Pro, which also made no difference.

I know my application is logging OK as I have added the option ASL_OPT_STDERR when calling asl_open() and can see the entries on stderr. I have also set the filters, using asl_set_filter(), to allow the appropriate levels to be sent to the server.

EDIT: I have seen this article, which gives an alternative way of setting the 'cutoff' value used by syslogd, however than doesn't work either (tried both temporary and permanent fixes):

… the reason you don't see Info or
Debug messages is that the syslogd
daemon filters them. If you want to
change the filtering in syslogd, you
can change the startup options in
/System/Library/
LaunchDaemons/com.apple.syslogd.plist
(add -c and
-7 in the
ProgramArguments array). That makes
the change "permanent" (until you
change the plist again). See the
syslogd (8) man page.

Alternatively, you can make a
temporary change to the syslogd
database filter value using the
"syslog" command-line utility.
sudo syslog -c syslogd -d

Best Answer

You don't say whether this app is a shell script or a compiled binary. If a shell script I have always used the logger command to update logs in syslog. If you are using Xcode and building a compiled Cocoa project you might get better assistance posting to StackOverFlow.

Related Question