You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like Apple changed the way the syslog daemon receives log messages, causing all Go programs to not log anything to syslog when using the log/syslog package.
The current workaround is to use CGO and call the syslog() system call.
Are you open to receive a PR that implements the syslog for darwin like that? It could be disabled by simply setting CGO=0, which would revert to the current behaviour, i.e. not working :(
Let me know if you have other possible solutions for this. Thanks!
The text was updated successfully, but these errors were encountered:
As I mentioned in the linked bug report, I do have a (bad) workaround for when CGO is not desired, and I'll describe it here in case you find it useful.
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. Note also that the facility seems to be ignored, and all messages going to logger will be logged with the severity given when it was launched. You can work around this in turn by starting separate logger processes for debug, info and notice (notice and higher severity messages like error all appear in the Console as default-level).
One thing I had to do was exec logger into a new process group so it wouldn't be affected by the parent process receiving a ctrl-C. This allowed me to catch SIGINT in my process and continue logging.
Looks like Apple changed the way the syslog daemon receives log messages, causing all Go programs to not log anything to syslog when using the
log/syslog
package.The current workaround is to use CGO and call the
syslog()
system call.Are you open to receive a PR that implements the syslog for darwin like that? It could be disabled by simply setting
CGO=0
, which would revert to the current behaviour, i.e. not working :(Let me know if you have other possible solutions for this. Thanks!
The text was updated successfully, but these errors were encountered: