Make sure all calls to log_msg() send messages to STDERR until the config files are parsed.
(mrash/fwknop#102)
This commit is contained in:
parent
83952fc734
commit
69ed30edb4
@ -41,7 +41,7 @@ static int syslog_fac = LOG_DAEMON;
|
||||
* for force log to stderr instead of syslog simply be setting this to the
|
||||
* appropriate value (which is done at init_logging().
|
||||
*/
|
||||
static int static_log_flag = 0;
|
||||
static int static_log_flag = LOG_STDERR_ONLY;
|
||||
|
||||
/* The name to use for ID in log messages. This defaults to fwknopd.
|
||||
*/
|
||||
@ -100,6 +100,8 @@ init_logging(fko_srv_options_t *opts) {
|
||||
else
|
||||
strlcpy(log_name, my_name, strlen(MY_NAME)+1);
|
||||
|
||||
static_log_flag = LOG_SYSLOG_ONLY;
|
||||
|
||||
/* If we are running in the foreground or performing firewall operations,
|
||||
* all logging will go to stderr.
|
||||
*/
|
||||
@ -107,7 +109,7 @@ init_logging(fko_srv_options_t *opts) {
|
||||
|| opts->fw_flush != 0
|
||||
|| opts->fw_list != 0
|
||||
|| opts->fw_list_all != 0)
|
||||
static_log_flag = LOG_STDERR | LOG_WITHOUT_SYSLOG;
|
||||
static_log_flag = LOG_STDERR_ONLY;
|
||||
|
||||
/* If the user forces syslog using --syslog-enable, we remove the
|
||||
* LOG_WITHOUT_SYSLOG flag. It means all messages will go through syslog */
|
||||
|
||||
@ -39,6 +39,7 @@
|
||||
* LOG_STDERR_ONLY can be set to send a message stderr with a copy to
|
||||
* syslog as well.
|
||||
*/
|
||||
#define LOG_SYSLOG_ONLY 0x0000
|
||||
#define LOG_STDERR 0x1000
|
||||
#define LOG_WITHOUT_SYSLOG 0x2000
|
||||
#define LOG_STDERR_ONLY (LOG_STDERR | LOG_WITHOUT_SYSLOG)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user