I have a script that I intend to run as a systemd service.
I know that stdout and stderr will be routed to the systemd journal. Is there any way for me to indicate that a line of output be treated as INFO or ERROR or whatever is appropriate?
systemdsystemd-journald
I have a script that I intend to run as a systemd service.
I know that stdout and stderr will be routed to the systemd journal. Is there any way for me to indicate that a line of output be treated as INFO or ERROR or whatever is appropriate?
Best Answer
From systemd for Developers III: Revenge of the systemd we find:
And the magic numbers are apparently copied from
syslog(3)
soTo emit info or error messages from e.g. a TCL script would look something like