service - How do I create a log entry for the systemd Journal? -
i have service, , have create logs journald daemon in cases. far, have not been able find instructions on how so.
am misunderstanding intended use of journal? or obvious missing?
any appreciated.
if have service, write log standard error. (it's available stream named std::clog in c++, more "log-like" semantics std::cerr.) that's it. it's logging mechanism works systemd, daemontools, daemontools-encore, runit, s6, perp, nosh, freedt, , others.
there api writing systemd journal. make sure have excellent reason locking softwares , users in api, however. writing standard error mechanism works, pretty everywhere. it's understood , easy administrators control, tweak, , comprehend. should first choice.
further reading
- jonathan de boyne pollard (2015). "logging". daemontools family. given answers.
- jonathan de boyne pollard (2001). "don't use `syslog().". mistakes avoid when designing unix dæmon programs. given answers.
- laurent bercot (2011). "the logging chain" the s6-log program. s6.
- sd-journal. freedesktop.org.
- https://superuser.com/a/868519/38062
- what difference between cout, cerr, clog of iostream header in c++? when use one?
Comments
Post a Comment