diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2021-10-11 14:05:08 +0100 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2021-11-18 19:37:17 +0000 |
commit | 9c4161800898513914f2c99faefe528c1aecbd40 (patch) | |
tree | 282916ff624c529f3d00bab5176a9f5965843fe0 /src/basic/log.c | |
parent | 86bd939d7fe840d4a9e413f65143fc01090314f8 (diff) | |
download | systemd-9c4161800898513914f2c99faefe528c1aecbd40.tar.gz |
journal: Don't discard kmsg messages coming from journald itself
Previously, we discarded any kmsg messages coming from journald
itself to avoid infinite loops where potentially the processing
of a kmsg message causes journald to log one or more messages to
kmsg which then get read again by the kmsg handler, ...
However, if we completely disable logging whenever we're processing
a kmsg message coming from journald itself, we also prevent any
infinite loops as we can be sure that journald won't accidentally
generate logging messages while processing a kmsg log message.
This change allows us to store all journald logs generated during
the processing of log messages from other services in the system
journal. Previously these could only be found in kmsg which has
low retention, can't be queried using journalctl and whose logs
don't survive reboots.
Diffstat (limited to 'src/basic/log.c')
-rw-r--r-- | src/basic/log.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/log.c b/src/basic/log.c index 983e5bc69c..7bc2f28007 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -358,7 +358,7 @@ void log_forget_fds(void) { } void log_set_max_level(int level) { - assert((level & LOG_PRIMASK) == level); + assert(level == LOG_NULL || (level & LOG_PRIMASK) == level); log_max_level = level; } |