Blob Blame History Raw
commit 63547179498c939dc1c3450c85fac23b3c86742c
Author: Andrew Beekhof <andrew@beekhof.net>
Date:   Tue Apr 8 11:26:56 2014 +1000

    Feature: logging: daemons always get a log file, unless explicitly set to configured 'none'
    
    (cherry picked from commit 8410680fbd7d5d1fea8e411fdf32f9c3ebe889cb)

diff --git a/lib/common/logging.c b/lib/common/logging.c
index 571cd03..ad6bcfd 100644
--- a/lib/common/logging.c
+++ b/lib/common/logging.c
@@ -696,7 +696,12 @@ crm_log_init(const char *entity, int level, gboolean daemon, gboolean to_stderr,
 
     crm_enable_stderr(to_stderr);
 
-    if (logfile) {
+    if (safe_str_eq("none", logfile)) {
+        /* No soup^Hlogs for you! */
+    } else if(crm_is_daemon) {
+        /* The daemons always get a log file, unless explicitly set to configured 'none' */
+        crm_add_logfile(logfile);
+    } else if(logfile) {
         crm_add_logfile(logfile);
     }
 
@@ -718,13 +723,6 @@ crm_log_init(const char *entity, int level, gboolean daemon, gboolean to_stderr,
         set_daemon_option("logfacility", facility);
     }
 
-    if (crm_is_daemon && crm_tracing_enabled()
-        && qb_log_ctl(QB_LOG_STDERR, QB_LOG_CONF_STATE_GET, 0) != QB_LOG_STATE_ENABLED
-        && qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_STATE_GET, 0) != QB_LOG_STATE_ENABLED) {
-        /* Make sure tracing goes somewhere */
-        crm_add_logfile(NULL);
-    }
-
     crm_update_callsites();
 
     /* Ok, now we can start logging... */