Re: Systemd error messages for custom service

David Suna <david-lbDOmM3XA9gS/[email protected]>
Newsgroups gmane.linux.region.israel
Message-ID <[email protected]>
Thanks for the pointer. Yes, I was writing to stdout. I didn't know
about PHP's syslog call
( http://php.net/manual/en/function.syslog.php ) which produces output
that goes to systemd log and can be manipulated with journalctl.
That should solve my problem.

On 06/09/17 15:29, Yedidyah Bar David
wrote:

On Sun, Sep 3, 2017 at 6:44 PM, David Suna <david-lbDOmM3XA9gS/[email protected]> 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,

--
David Suna
david-lbDOmM3XA9gS/[email protected]

_______________________________________________
Linux-il mailing list
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.