Getting Syslog working on OSX Monterey

Dennis Lee Bieber wlfraed at ix.netcom.com
Sun Feb 27 14:17:39 EST 2022


On Sun, 27 Feb 2022 08:34:21 -0800, Philip Bloom
<philip.bloom at applovin.com> declaimed the following:

>
>sys_handler = SysLogHandler(address='/var/run/syslog')

	As I read the documentation, the address is supposed to be the NETWORK
address of the machine to receive the log messages...

https://docs.python.org/3/library/logging.handlers.html#sysloghandler

>#sys_handler.encodePriority(SysLogHandler.LOG_USER, SysLogHandler.LOG_ALERT)
># Tried with the above, but didn't make a difference.  Neither did not
>defining the address and letting it go to local host.
>sys_handler.setFormatter(syslog_format)
>root_logger.addHandler(sys_handler)
>
>logging.critical("This is a test")
>logging.error("This is a test error")
>logging.info("Still a test")
>logging.debug("Testy test")
>
>Using command line: Oddly, this gets to Console.Apps messages from device
>reliably, though doesn't get picked up by syslog -w or get received by the
>ASL config redirect:
>syslog -s -l error -k Message "appName: this is a test2"
>syslog -s -l notice -k Message "appName: this is a test3"
>
>ASL configuration, which is loaded according to syslog -config:
>> /var/log/appName/appName.log mode=0640 compress format=std rotate=seq
>file_max=50M all_max=500M
>? [CA= Sender appName] file /var/log/appName/appName.log
>
>My end goal is really to get just a working python logging ->
>var/log/appname/appname.log again so glad to just be pointed in the right
>direction if way off base.


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed at ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/


More information about the Python-list mailing list