From 97d6fcbd4dc9f716620fb87de89c83e0b3cbe1d5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 16 Jul 2008 17:52:41 -0700 Subject: [PATCH] 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. --- lib/vlog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.30.2