Closed stapelberg closed 2 years ago
Seems totally reasonable, but thinking about this from a multi-device perspective: what could we do to multiplex the output from several devices to stdout? Should we prefix the messages somehow and ensure that lines are cleanly flushed so that they can be grepped/filtered out later in a logging system?
Seems totally reasonable, but thinking about this from a multi-device perspective: what could we do to multiplex the output from several devices to stdout?
I think the simplest is adding a mutex that’s acquired by all copy-to-stdout goroutines before writing to stdout.
Should we prefix the messages somehow and ensure that lines are cleanly flushed so that they can be grepped/filtered out later in a logging system?
Prefixing with device.Name sounds reasonable to me.
We could probably only add the prefix when more than 1 device is configured. What do you think?
SGTM, thank you!
Done! PTAL
This is handy with gokrazy’s remote syslog support:
https://gokrazy.org/userguide/remotesyslog/
…and the gokrazy syslog daemon:
https://github.com/gokrazy/syslogd
fixes https://github.com/mdlayher/consrv/issues/2