summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2017-03-01 13:34:32 +0100
committerLubomir Rintel <lkundrak@v3.sk>2017-03-24 12:42:09 +0100
commit03a3fd901486aa40b41f2aa066ce1ea832f0f965 (patch)
tree100ebb67156b2da0748634e629ec818f52faaf0f /src/main.c
parentb11b6038792a3da3f47717129580d7c661140291 (diff)
downloadNetworkManager-03a3fd901486aa40b41f2aa066ce1ea832f0f965.tar.gz
logging: respect choice of journal/syslog even with --debug
Previously, the daemon would just use syslog with LOG_PERROR when run with --debug option, even when actually configured to log into the journal. Let's respect the configuration, but preserve the logging to stderr.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 23c05f2952..56b14c9144 100644
--- a/src/main.c
+++ b/src/main.c
@@ -348,12 +348,11 @@ main (int argc, char *argv[])
/* Set up unix signal handling - before creating threads, but after daemonizing! */
nm_main_utils_setup_signals (main_loop);
- nm_logging_syslog_openlog (nm_config_get_is_debug (config)
- ? "debug"
- : nm_config_data_get_value_cached (NM_CONFIG_GET_DATA_ORIG,
- NM_CONFIG_KEYFILE_GROUP_LOGGING,
- NM_CONFIG_KEYFILE_KEY_LOGGING_BACKEND,
- NM_CONFIG_GET_VALUE_STRIP | NM_CONFIG_GET_VALUE_NO_EMPTY));
+ nm_logging_syslog_openlog (nm_config_data_get_value_cached (NM_CONFIG_GET_DATA_ORIG,
+ NM_CONFIG_KEYFILE_GROUP_LOGGING,
+ NM_CONFIG_KEYFILE_KEY_LOGGING_BACKEND,
+ NM_CONFIG_GET_VALUE_STRIP | NM_CONFIG_GET_VALUE_NO_EMPTY),
+ nm_config_get_is_debug (config));
nm_log_info (LOGD_CORE, "NetworkManager (version " NM_DIST_VERSION ") is starting...");