|
|
7ebc05 |
commit 63547179498c939dc1c3450c85fac23b3c86742c
|
|
|
7ebc05 |
Author: Andrew Beekhof <andrew@beekhof.net>
|
|
|
7ebc05 |
Date: Tue Apr 8 11:26:56 2014 +1000
|
|
|
7ebc05 |
|
|
|
7ebc05 |
Feature: logging: daemons always get a log file, unless explicitly set to configured 'none'
|
|
|
7ebc05 |
|
|
|
7ebc05 |
(cherry picked from commit 8410680fbd7d5d1fea8e411fdf32f9c3ebe889cb)
|
|
|
7ebc05 |
|
|
|
7ebc05 |
diff --git a/lib/common/logging.c b/lib/common/logging.c
|
|
|
7ebc05 |
index 571cd03..ad6bcfd 100644
|
|
|
7ebc05 |
--- a/lib/common/logging.c
|
|
|
7ebc05 |
+++ b/lib/common/logging.c
|
|
|
7ebc05 |
@@ -696,7 +696,12 @@ crm_log_init(const char *entity, int level, gboolean daemon, gboolean to_stderr,
|
|
|
7ebc05 |
|
|
|
7ebc05 |
crm_enable_stderr(to_stderr);
|
|
|
7ebc05 |
|
|
|
7ebc05 |
- if (logfile) {
|
|
|
7ebc05 |
+ if (safe_str_eq("none", logfile)) {
|
|
|
7ebc05 |
+ /* No soup^Hlogs for you! */
|
|
|
7ebc05 |
+ } else if(crm_is_daemon) {
|
|
|
7ebc05 |
+ /* The daemons always get a log file, unless explicitly set to configured 'none' */
|
|
|
7ebc05 |
+ crm_add_logfile(logfile);
|
|
|
7ebc05 |
+ } else if(logfile) {
|
|
|
7ebc05 |
crm_add_logfile(logfile);
|
|
|
7ebc05 |
}
|
|
|
7ebc05 |
|
|
|
7ebc05 |
@@ -718,13 +723,6 @@ crm_log_init(const char *entity, int level, gboolean daemon, gboolean to_stderr,
|
|
|
7ebc05 |
set_daemon_option("logfacility", facility);
|
|
|
7ebc05 |
}
|
|
|
7ebc05 |
|
|
|
7ebc05 |
- if (crm_is_daemon && crm_tracing_enabled()
|
|
|
7ebc05 |
- && qb_log_ctl(QB_LOG_STDERR, QB_LOG_CONF_STATE_GET, 0) != QB_LOG_STATE_ENABLED
|
|
|
7ebc05 |
- && qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_STATE_GET, 0) != QB_LOG_STATE_ENABLED) {
|
|
|
7ebc05 |
- /* Make sure tracing goes somewhere */
|
|
|
7ebc05 |
- crm_add_logfile(NULL);
|
|
|
7ebc05 |
- }
|
|
|
7ebc05 |
-
|
|
|
7ebc05 |
crm_update_callsites();
|
|
|
7ebc05 |
|
|
|
7ebc05 |
/* Ok, now we can start logging... */
|