B
B
beduin012018-02-08 16:29:04
Python
beduin01, 2018-02-08 16:29:04

How does systemd relate to /dev/log?

I read the article and do not quite understand what the author means.

When using systemd to run a daemon, applications can just send log messages to stdout or stderr and have systemd forward the messages to journald and syslog. As an additional perk, this does not even require catching exceptions, as Python already writes those to standard error.

import logging
import os

logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO"))

exit(main())

And then there is an example that they say in systems without systemd everything is more complicated. I can't figure out what's going on here? basicConfig is set up, but with what parameters?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question