JournalHandler: set journald unit
FedericoCeratto opened this issue · 2 comments
FedericoCeratto commented
Daemons need to be able to generate logs with the same unit name configured in the systemd unit file.
JournalHandler should provide a way to do so and document it as as recommended pattern.
Phibonacci commented
This can be done with:
from systemd.journal import JournalHandler
JournalHandler(SYSLOG_IDENTIFIER="unit_name")frq-asgard-fake commented
SYSLOG_IDENTIFIER sets the syslog identifier not the unit name. Specifically filtering with journalctl -u $name is not possibly according to my tests. Am I missing something or is the example just wrong?