[asterisk-commits] russell: trunk r380209 - in /trunk: ./ configs/ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Jan 27 19:50:58 CST 2013
Author: russell
Date: Sun Jan 27 19:50:54 2013
New Revision: 380209
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380209
Log:
Add queue_log_realtime_use_gmt option to logger.conf
Add an option that lets you specify that the timestamps going into the realtime
queue log should be in GMT instead of local time.
Review: https://reviewboard.asterisk.org/r/2287/
Modified:
trunk/CHANGES
trunk/configs/logger.conf.sample
trunk/main/logger.c
Modified: trunk/CHANGES
URL: http://svnview.digium.com/svn/asterisk/trunk/CHANGES?view=diff&rev=380209&r1=380208&r2=380209
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Sun Jan 27 19:50:54 2013
@@ -66,6 +66,9 @@
* When performing queue pause/unpause on an interface without specifying an
individual queue, the PAUSEALL/UNPAUSEALL event will only be logged if at
least one member of any queue exists for that interface.
+
+ * Added the 'queue_log_realtime_use_gmt' option to have timestamps in GMT
+ for realtime queue log entries.
Queue
-------------------
Modified: trunk/configs/logger.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/logger.conf.sample?view=diff&rev=380209&r1=380208&r2=380209
==============================================================================
--- trunk/configs/logger.conf.sample (original)
+++ trunk/configs/logger.conf.sample Sun Jan 27 19:50:54 2013
@@ -38,6 +38,10 @@
; Set the queue_log filename
; (defaults to queue_log)
;queue_log_name = queue_log
+;
+; When using realtime for the queue log, use GMT for the timestamp
+; instead of localtime. The default of this option is 'no'.
+;queue_log_realtime_use_gmt = yes
;
; Log rotation strategy:
; none: Do not perform any logrotation at all. You should make
Modified: trunk/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/logger.c?view=diff&rev=380209&r1=380208&r2=380209
==============================================================================
--- trunk/main/logger.c (original)
+++ trunk/main/logger.c Sun Jan 27 19:50:54 2013
@@ -111,6 +111,7 @@
unsigned int queue_log:1;
unsigned int queue_log_to_file:1;
unsigned int queue_adaptive_realtime:1;
+ unsigned int queue_log_realtime_use_gmt:1;
} logfiles = { 1 };
static char hostname[MAXHOSTNAMELEN];
@@ -427,6 +428,9 @@
if ((s = ast_variable_retrieve(cfg, "general", "queue_log_name"))) {
ast_copy_string(queue_log_name, s, sizeof(queue_log_name));
}
+ if ((s = ast_variable_retrieve(cfg, "general", "queue_log_realtime_use_gmt"))) {
+ logfiles.queue_log_realtime_use_gmt = ast_true(s);
+ }
if ((s = ast_variable_retrieve(cfg, "general", "exec_after_rotate"))) {
ast_copy_string(exec_after_rotate, s, sizeof(exec_after_rotate));
}
@@ -554,7 +558,7 @@
if (ast_check_realtime("queue_log")) {
tv = ast_tvnow();
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&tv, &tm, logfiles.queue_log_realtime_use_gmt ? "GMT" : NULL);
ast_strftime(time_str, sizeof(time_str), "%F %T.%6q", &tm);
va_start(ap, fmt);
vsnprintf(qlog_msg, sizeof(qlog_msg), fmt, ap);
More information about the asterisk-commits
mailing list