Re: Detecting when running under systemd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




you want to check specifically whether stderr is tied to the journal, for which you can use JOURNAL_STREAM

You are right, nice catch!

(In addition to disabling the timestamps you should *at least* add message priority indicators as well, either by using SyslogLevelPrefix=, or by avoiding stderr entirely and using the syslog() API for logging – if not going all the way with sd_journal_send*().)

It's an application written in crystal, so while it would be straight forward to either use the syslog API or write bindings for sd_journal_send, my logging requirements are basic (to put it mildly) and simply dumping to stderr works well enough when paired with the priority parsing provided by SyslogLevelPrefix.

Thank you!




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux