diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 946081a486..a1f64adf7e 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -678,7 +678,14 @@ daemonSetupLogging(struct daemonConfig *config, (godaemon || !isatty(STDIN_FILENO))) { char *tmp; if (access("/run/systemd/journal/socket", W_OK) >= 0) { - if (virAsprintf(&tmp, "%d:journald", virLogGetDefaultPriority()) < 0) + virLogPriority priority = virLogGetDefaultPriority(); + + /* By default we don't want to log too much stuff into journald as + * it may employ rate limiting and thus block libvirt execution. */ + if (priority == VIR_LOG_DEBUG) + priority = VIR_LOG_INFO; + + if (virAsprintf(&tmp, "%d:journald", priority) < 0) goto error; virLogParseOutputs(tmp); VIR_FREE(tmp); diff --git a/daemon/libvirtd.conf b/daemon/libvirtd.conf index c73423f0dd..2d80274edc 100644 --- a/daemon/libvirtd.conf +++ b/daemon/libvirtd.conf @@ -309,6 +309,10 @@ # Logging level: 4 errors, 3 warnings, 2 information, 1 debug # basically 1 will log everything possible +# Note: Journald may employ rate limiting of the messages logged +# and thus lock up the libvirt daemon. To use the debug level with +# journald you have to specify it explicitly in 'log_outputs', otherwise +# only information level messages will be logged. #log_level = 3 # Logging filters: