diff --git a/src/log.c b/src/log.c index 197a6a6..504d397 100644 --- a/src/log.c +++ b/src/log.c @@ -324,7 +324,7 @@ void log_debug(unsigned int class, char *file, int line, const char *format, ... output_to_stderr("", ap, file, line, format); - if (!log_to_stderr && silence_level < 1) { + if (silence_level < 1) { output_to_syslog("", LOG_DEBUG, ap, file, line, format); } diff --git a/src/siproxd.c b/src/siproxd.c index c903e12..5a6fd95 100644 --- a/src/siproxd.c +++ b/src/siproxd.c @@ -150,8 +150,13 @@ int main (int argc, char *argv[]) char *pidfilename=NULL; struct sigaction act; +/* + * initialize the loggin subsystem + */ log_init(); - + /* set log silencing for syslog as requested in config */ + log_set_silence(configuration.silence_log); + /* while not daemonized, log also to stderr */ log_set_stderr(1); /* @@ -276,6 +281,7 @@ int main (int argc, char *argv[]) setsid(); if (fork()!=0) exit(0); + /* we are daemonizing, no more logging to stderr */ log_set_stderr(0); /* detach STDIN/OUT/ERR file */ @@ -343,11 +349,6 @@ int main (int argc, char *argv[]) /* initialize the registration facility */ register_init(); -/* - * silence the log - if so required... - */ - log_set_silence(configuration.silence_log); - INFO(PACKAGE"-"VERSION"-"BUILDSTR" "BUILDDATE" "UNAME" started"); /*****************************