Index: logger.c =================================================================== --- logger.c (revision 8072) +++ logger.c (working copy) @@ -91,7 +91,8 @@ static struct { unsigned int queue_log:1; unsigned int event_log:1; -} logfiles = { 1, 1 }; + unsigned int asciitime_in_queue_log:1; +} logfiles = { 1, 1 ,0}; static struct msglist { char *msg; @@ -336,6 +337,9 @@ if ((s = ast_variable_retrieve(cfg, "general", "queue_log"))) { logfiles.queue_log = ast_true(s); } + if ((s = ast_variable_retrieve(cfg, "general", "asciitime_in_queue_log"))) { + logfiles.asciitime_in_queue_log = ast_true(s); + } if ((s = ast_variable_retrieve(cfg, "general", "event_log"))) { logfiles.event_log = ast_true(s); } @@ -364,7 +368,17 @@ ast_mutex_lock(&qloglock); if (qlog) { va_start(ap, fmt); - fprintf(qlog, "%ld|%s|%s|%s|%s|", (long)time(NULL), callid, queuename, agent, event); + if(logfiles.asciitime_in_queue_log) { + time_t t; + struct tm tm; + char date[256]; + + time(&t); + localtime_r(&t, &tm); + strftime(date, sizeof(date), dateformat, &tm); + fprintf(qlog, "%s|%s|%s|%s|%s|", date, callid, queuename, agent, event); + } else + fprintf(qlog, "%ld|%s|%s|%s|%s|", (long)time(NULL), callid, queuename, agent, event); vfprintf(qlog, fmt, ap); fprintf(qlog, "\n"); va_end(ap); @@ -466,8 +480,8 @@ filesize_reload_needed = 0; + init_logger_chain(); queue_log_init(); - init_logger_chain(); if (logfiles.event_log) { if (eventlog) { @@ -594,12 +608,12 @@ ast_cli_register(&rotate_logger_cli); ast_cli_register(&logger_show_channels_cli); + /* create log channels */ + init_logger_chain(); + /* initialize queue logger */ queue_log_init(); - /* create log channels */ - init_logger_chain(); - /* create the eventlog */ if (logfiles.event_log) { mkdir((char *)ast_config_AST_LOG_DIR, 0755); Index: configs/logger.conf.sample =================================================================== --- configs/logger.conf.sample (revision 8072) +++ configs/logger.conf.sample (working copy) @@ -20,6 +20,11 @@ ; (defaults to yes). ;queue_log = no ; +; This determines whether or not we log time stamp of queue events +; in ascii format +; (defaults to no). +;asciitime_in_queue_log = yes +; ; This determines whether or not we log generic events to a file ; (defaults to yes). ;event_log = no