Open craig65535 opened 1 year ago
This was noted by the Python people: https://github.com/python/cpython/issues/91070
FWIW I do have a (terrible) workaround for this that doesn't involve cgo. I exec /usr/bin/logger -p <facility>.<severity>
and then feed it messages over stdin. It doesn't tag the messages as coming from my process, but it does get logs into the Console and log store.
This should at least be documented properly, something akin to this by the python folks:
.. note:: On macOS 12.x (Monterey), Apple has changed the behaviour of their
syslog daemon - it no longer listens on a domain socket. Therefore, you cannot
expect :class:`SysLogHandler` to work on this system.
See :gh:`91070` for more information.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?darwin/arm64
What did you do?
What did you expect to see?
hello
logged to the macOS Console.appWhat did you see instead?
Nothing is logged.
I noticed that I can get this working with cgo -
So syslog is working and this is not a configuration issue. I think the problem is that macOS's
logd
no longer accepts syslog messages on/var/run/syslog
, or perhaps the expected format has changed.I can see that it's listening:
But I'm not sure if calling syslog(3) is using some other mechanism to reach
logd
.