Systemd error messages for custom service

Systemd error messages for custom service

Yedidyah Bar David linux-il at didi.bardavid.org
Wed Sep 6 15:29:54 IDT 2017


On Sun, Sep 3, 2017 at 6:44 PM, David Suna <david at davidsconsultants.com> wrote:
> I am getting started with systemd on an Ubuntu 16.04 system. I have a custom
> service implemented in PHP which is outputting messages

How? Writing to stdout?

> which I can see
> using journalctl. I would like to be able to filter on the message priority
> to distinguish between error messages and debug messages. However, all of my
> messages seem to be showing as info messages. How can I format my messages
> so that they will fit into the different log levels?

I think you should use syslog, and/or systemd-/journald-specific means, e.g.:

https://github.com/systemd/php-systemd

Best,
-- 
Didi



More information about the Linux-il mailing list