diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index d2e0a046be..d5f3e4c29c 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -636,10 +636,13 @@ daemonSetupLogging(struct daemonConfig *config, virLogParseOutputs(config->log_outputs); /* - * If no defined outputs, then first try to direct it - * to the systemd journal (if it exists).... + * If no defined outputs, and either running + * as daemon or not on a tty, then first try + * to direct it to the systemd journal + * (if it exists).... */ - if (virLogGetNbOutputs() == 0) { + if (virLogGetNbOutputs() == 0 && + (godaemon || !isatty(STDIN_FILENO))) { char *tmp; if (access("/run/systemd/journal/socket", W_OK) >= 0) { if (virAsprintf(&tmp, "%d:journald", virLogGetDefaultPriority()) < 0) diff --git a/src/util/logging.c b/src/util/logging.c index 9a8bba119a..dd4384276e 100644 --- a/src/util/logging.c +++ b/src/util/logging.c @@ -1247,6 +1247,8 @@ virLogParseOutputs(const char *outputs) if (cur == NULL) return -1; + VIR_DEBUG("outputs=%s", outputs); + virSkipSpaces(&cur); while (*cur != 0) { prio= virParseNumber(&cur);