Sample Header Ad - 728x90

How do I need to configure the macOS logging system to log LOG_INFO messages from Perl?

0 votes
0 answers
1343 views
In the dovecot port for macOS in MacPorts, there is a pushnotify capability (requires you to be able to create the right certificates). This is perl code that contains the following snippet: # Open the socket to Dovecot unlink $sockpath; umask (0111); my $socket = IO::Socket::UNIX->new( Type => SOCK_DGRAM, Local => $sockpath, Listen => SOMAXCONN, ) or die("Can't create server socket: $!\n"); drop_privileges($user); openlog ('apns', 'ndelay', 'mail'); # When we last checked the feedback service (right now, never). my $last_feedback = 0; # When we last reconnected to APNS my $last_connect = 0; # We'll defer connecting to APNS until our first notification, but define $apns here my $apns; syslog (LOG_INFO, 'Dovecot APNS service running'); Supposedly, this code wants to log using the old syslog interface. Now ASL supersedes syslog, but it is supposed to be able to catch the syslog stuff as well, when correctly configured. Or so I think. But I am unable to find that logging. During boot, I see warnings from ASL: Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.cdscheduler" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.install" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.family.asl" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.callhistory.asl.conf" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.contacts.ContactsUICore" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.authd" sharing output destination "/var/log/asl" with ASL Module "com.apple.asl". Output parameters from ASL Module "com.apple.asl" override any specified in ASL Module "com.apple.authd". Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.authd" sharing output destination "/var/log/system.log" with ASL Module "com.apple.asl". Output parameters from ASL Module "com.apple.asl" override any specified in ASL Module "com.apple.authd". Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.authd" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.eventmonitor" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.mail" sharing output destination "/var/log/mail.log" with ASL Module "com.apple.asl". Output parameters from ASL Module "com.apple.asl" override any specified in ASL Module "com.apple.mail". Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.mail" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.coreaudio" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.performance" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.iokit.power" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "org.macports.daemon" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.contacts.ContactsAutocomplete" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.mkb" sharing output destination "/private/var/log/keybagd.log" with ASL Module "com.apple.mkb.internal". Output parameters from ASL Module "com.apple.mkb.internal" override any specified in ASL Module "com.apple.mkb". Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.mkb" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.AddressBookLegacy" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.MessageTracer" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.networking.boringssl" sharing output destination "/Library/Logs/CrashReporter" with ASL Module "com.apple.networking.networkextension". Output parameters from ASL Module "com.apple.networking.networkextension" override any specified in ASL Module "com.apple.networking.boringssl". Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.clouddocs" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. which seem to imply that configuration may be an issue here. The perl program tries to send to syslog, syslog will catch it, but because syslog on macOS is ASL it somehow disappears in a black hole, even if there are output files mentioned, they tend to be empty or only have a few unrelated messages. I'd like to get to the bottom of his. Having no logging is killing me.
Asked by gctwnl (762 rep)
Nov 23, 2020, 11:15 AM
Last activity: Nov 23, 2020, 12:29 PM