I'm trying to manually write an entry into journald from Python. Is there a way to do this?
Thanks for any insights.
-Paul
If by journald
you are referring to the systemd journal
, then a simple search for "journald python api" yields:
https://github.com/systemd/python-systemd
Quick example:
from systemd import journal
journal.send('Hello world')
journal.send('Hello, again, world', FIELD2='Greetings!', FIELD3='Guten tag')
journal.send('Binary message', BINARY=b'\xde\xad\xbe\xef')