From: Ben Pfaff Date: Thu, 17 Jul 2008 00:52:41 +0000 (-0700) Subject: By default, log to syslog also. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97d6fcbd4dc9f716620fb87de89c83e0b3cbe1d5;p=openvswitch By default, log to syslog also. It seems that this should be useful for debugging post-mortems. Also, this ensures that the "current time is negative" log message appears in syslog. Otherwise, it won't ever, because we log it before the vlog client has a chance to configure its log levels. --- diff --git a/lib/vlog.c b/lib/vlog.c index 17be077a..1d70a5d9 100644 --- a/lib/vlog.c +++ b/lib/vlog.c @@ -245,7 +245,7 @@ vlog_set_verbosity(const char *arg) fatal(0, "processing \"%s\": %s", arg, msg); } } else { - vlog_set_levels(VLM_ANY_MODULE, VLF_CONSOLE, VLL_DBG); + vlog_set_levels(VLM_ANY_MODULE, VLF_ANY_FACILITY, VLL_DBG); } } @@ -254,8 +254,10 @@ void vlog_init(void) { time_t now; + openlog(program_name, LOG_NDELAY, LOG_DAEMON); - vlog_set_levels(VLM_ANY_MODULE, VLF_CONSOLE, VLL_WARN); + vlog_set_levels(VLM_ANY_MODULE, VLF_ANY_FACILITY, VLL_WARN); + now = time(0); if (now < 0) { struct tm tm;