You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Takes a boolean argument. If true and StandardOutput= or StandardError= are set to syslog, kmsg or journal, log lines written by the executed process that are prefixed with a log level will be passed on to syslog with this log level set but the prefix removed. If set to false, the interpretation of these prefixes is disabled and the logged lines are passed on as-is. For details about this prefixing see sd-daemon(3). Defaults to true.
i.e. for the simple case where a service emits output to stdout, and systemd picks that up, it may be helpful to add a prefix with the syslog log level. systemd will also pick that up, strip it from its output, and use it as the log level, by default.
There are two parts to this:
Adding the syslog log level to event_dict, i.e. "4" (or syslog.LOG_WARNING) for "warn"/"warning", etc. Python's logging.handlers.SysLogHandler has code for that, and python-systemd is trying to do something more clever to cover custom log levels. Neither are reusable, but should be simple to implement. It should be similar to the existing add_log_level_number processor.
A simple processor that prepends the event message with said level. I'm guessing that will be more controversial though. Alternatively, it could also be an argument to PrintLogger.
The "syslog" log level will also be useful in case one e.g. wants to write a processor using the stdlib syslog module (i.e. without involving logging).
The text was updated successfully, but these errors were encountered:
From systemd.exec(5):
i.e. for the simple case where a service emits output to stdout, and systemd picks that up, it may be helpful to add a prefix with the syslog log level. systemd will also pick that up, strip it from its output, and use it as the log level, by default.
There are two parts to this:
event_dict
, i.e. "4" (orsyslog.LOG_WARNING
) for "warn"/"warning", etc. Python's logging.handlers.SysLogHandler has code for that, and python-systemd is trying to do something more clever to cover custom log levels. Neither are reusable, but should be simple to implement. It should be similar to the existingadd_log_level_number
processor.event
message with said level. I'm guessing that will be more controversial though. Alternatively, it could also be an argument to PrintLogger.The "syslog" log level will also be useful in case one e.g. wants to write a processor using the stdlib
syslog
module (i.e. without involvinglogging
).The text was updated successfully, but these errors were encountered: