Index: main/logger.c =================================================================== --- main/logger.c (revision 277774) +++ main/logger.c (working copy) @@ -283,7 +283,7 @@ return chan; } -static void init_logger_chain(int locked) +static void init_logger_chain(int locked, const char *altconf) { struct logchannel *chan; struct ast_config *cfg; @@ -291,7 +291,7 @@ const char *s; struct ast_flags config_flags = { 0 }; - if (!(cfg = ast_config_load2("logger.conf", "logger", config_flags)) || cfg == CONFIG_STATUS_FILEINVALID) + if (!(cfg = ast_config_load2(S_OR(altconf, "logger.conf"), "logger", config_flags)) || cfg == CONFIG_STATUS_FILEINVALID) return; /* delete our list of log channels */ @@ -547,7 +547,7 @@ return res; } -static int reload_logger(int rotate) +static int reload_logger(int rotate, const char *altconf) { char old[PATH_MAX] = ""; int queue_rotate = rotate; @@ -590,7 +590,7 @@ filesize_reload_needed = 0; - init_logger_chain(1 /* locked */); + init_logger_chain(1 /* locked */, altconf); if (logfiles.queue_log) { snprintf(old, sizeof(old), "%s/%s", ast_config_AST_LOG_DIR, queue_log_name); @@ -618,7 +618,7 @@ a full Asterisk reload) */ int logger_reload(void) { - if(reload_logger(0)) + if (reload_logger(0, NULL)) return RESULT_FAILURE; return RESULT_SUCCESS; } @@ -628,14 +628,14 @@ switch (cmd) { case CLI_INIT: e->command = "logger reload"; - e->usage = - "Usage: logger reload\n" + e->usage = + "Usage: logger reload []\n" " Reloads the logger subsystem state. Use after restarting syslogd(8) if you are using syslog logging.\n"; return NULL; case CLI_GENERATE: return NULL; } - if (reload_logger(0)) { + if (reload_logger(0, argc == 3 ? argv[2] : NULL)) { ast_cli(a->fd, "Failed to reload the logger\n"); return CLI_FAILURE; } @@ -654,7 +654,7 @@ case CLI_GENERATE: return NULL; } - if (reload_logger(1)) { + if (reload_logger(1, NULL)) { ast_cli(a->fd, "Failed to reload the logger and rotate log files\n"); return CLI_FAILURE; } @@ -864,7 +864,7 @@ /* If we need to reload because of the file size, then do so */ if (filesize_reload_needed) { - reload_logger(-1); + reload_logger(-1, NULL); ast_verb(1, "Rotated Logs Per SIGXFSZ (Exceeded file size limit)\n"); } @@ -948,7 +948,7 @@ ast_mkdir(ast_config_AST_LOG_DIR, 0777); /* create log channels */ - init_logger_chain(0 /* locked */); + init_logger_chain(0 /* locked */, NULL); if (logfiles.queue_log) { snprintf(tmp, sizeof(tmp), "%s/%s", ast_config_AST_LOG_DIR, queue_log_name);