summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-05-21 07:21:44 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2015-05-21 07:21:44 -0500
commitf5e195b44e1caa87b006a75f87027b1742c870e0 (patch)
treebbb70053fdfa4a874c782eb05598de0392e9d12b
parente8a4e01c328cef4a46de02e10eaa0340af17b515 (diff)
parent9b6e228419d821a5384e3b6b056c8d5e4f30b4f4 (diff)
Merge "Logger: Reset defaults before processing config." into 13
-rw-r--r--main/logger.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/main/logger.c b/main/logger.c
index 183e75d08..f84221f64 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -383,16 +383,25 @@ static int init_logger_chain(int locked, const char *altconf)
const char *s;
struct ast_flags config_flags = { 0 };
- display_callids = 1;
-
if (!(cfg = ast_config_load2(S_OR(altconf, "logger.conf"), "logger", config_flags)) || cfg == CONFIG_STATUS_FILEINVALID) {
cfg = NULL;
}
- /* delete our list of log channels */
if (!locked) {
AST_RWLIST_WRLOCK(&logchannels);
}
+
+ /* Set defaults */
+ hostname[0] = '\0';
+ display_callids = 1;
+ memset(&logfiles, 0, sizeof(logfiles));
+ logfiles.queue_log = 1;
+ ast_copy_string(dateformat, "%b %e %T", sizeof(dateformat));
+ ast_copy_string(queue_log_name, QUEUELOG, sizeof(queue_log_name));
+ exec_after_rotate[0] = '\0';
+ rotatestrategy = SEQUENTIAL;
+
+ /* delete our list of log channels */
while ((chan = AST_RWLIST_REMOVE_HEAD(&logchannels, list))) {
ast_free(chan);
}
@@ -432,17 +441,14 @@ static int init_logger_chain(int locked, const char *altconf)
ast_copy_string(hostname, "unknown", sizeof(hostname));
fprintf(stderr, "What box has no hostname???\n");
}
- } else
- hostname[0] = '\0';
- } else
- hostname[0] = '\0';
+ }
+ }
if ((s = ast_variable_retrieve(cfg, "general", "display_callids"))) {
display_callids = ast_true(s);
}
- if ((s = ast_variable_retrieve(cfg, "general", "dateformat")))
+ if ((s = ast_variable_retrieve(cfg, "general", "dateformat"))) {
ast_copy_string(dateformat, s, sizeof(dateformat));
- else
- ast_copy_string(dateformat, "%b %e %T", sizeof(dateformat));
+ }
if ((s = ast_variable_retrieve(cfg, "general", "queue_log"))) {
logfiles.queue_log = ast_true(s);
}