[asterisk-commits] qwell: trunk r43666 - in /trunk: configs/logger.conf.sample main/logger.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Sep 26 10:09:02 MST 2006


Author: qwell
Date: Tue Sep 26 12:09:01 2006
New Revision: 43666

URL: http://svn.digium.com/view/asterisk?rev=43666&view=rev
Log:
Add optional queue_log_name config option for logger.conf, to change the
name of the queue_log file.

Issue #7363, patch by Steve Davies, slightly modified by me.

Modified:
    trunk/configs/logger.conf.sample
    trunk/main/logger.c

Modified: trunk/configs/logger.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/logger.conf.sample?rev=43666&r1=43665&r2=43666&view=diff
==============================================================================
--- trunk/configs/logger.conf.sample (original)
+++ trunk/configs/logger.conf.sample Tue Sep 26 12:09:01 2006
@@ -19,6 +19,10 @@
 ; This determines whether or not we log queue events to a file
 ; (defaults to yes).
 ;queue_log = no
+;
+; Set the queue_log filename
+; (defaults to queue_log)
+;queue_log_name = queue_log
 ;
 ; This determines whether or not we log generic events to a file
 ; (defaults to yes).

Modified: trunk/main/logger.c
URL: http://svn.digium.com/view/asterisk/trunk/main/logger.c?rev=43666&r1=43665&r2=43666&view=diff
==============================================================================
--- trunk/main/logger.c (original)
+++ trunk/main/logger.c Tue Sep 26 12:09:01 2006
@@ -82,6 +82,8 @@
 
 
 static char dateformat[256] = "%b %e %T";		/* Original Asterisk Format */
+
+static char queue_log_name[256] = QUEUELOG;
 
 static int filesize_reload_needed = 0;
 static int global_logmask = -1;
@@ -336,6 +338,8 @@
 		logfiles.queue_log = ast_true(s);
 	if ((s = ast_variable_retrieve(cfg, "general", "event_log")))
 		logfiles.event_log = ast_true(s);
+	if ((s = ast_variable_retrieve(cfg, "general", "queue_log_name")))
+		ast_copy_string(queue_log_name, s, sizeof(queue_log_name));
 
 	AST_LIST_LOCK(&logchannels);
 	var = ast_variable_browse(cfg, "logfiles");
@@ -450,10 +454,10 @@
 	}
 
 	if (logfiles.queue_log) {
-		snprintf(old, sizeof(old), "%s/%s", (char *)ast_config_AST_LOG_DIR, QUEUELOG);
+		snprintf(old, sizeof(old), "%s/%s", (char *)ast_config_AST_LOG_DIR, queue_log_name);
 		if (queue_rotate) {
 			for (x = 0; ; x++) {
-				snprintf(new, sizeof(new), "%s/%s.%d", (char *)ast_config_AST_LOG_DIR, QUEUELOG, x);
+				snprintf(new, sizeof(new), "%s/%s.%d", (char *)ast_config_AST_LOG_DIR, queue_log_name, x);
 				myf = fopen((char *)new, "r");
 				if (myf) 	/* File exists */
 					fclose(myf);
@@ -610,7 +614,7 @@
 	}
 
 	if (logfiles.queue_log) {
-		snprintf(tmp, sizeof(tmp), "%s/%s", (char *)ast_config_AST_LOG_DIR, QUEUELOG);
+		snprintf(tmp, sizeof(tmp), "%s/%s", (char *)ast_config_AST_LOG_DIR, queue_log_name);
 		qlog = fopen(tmp, "a");
 		ast_queue_log("NONE", "NONE", "NONE", "QUEUESTART", "%s", "");
 	}



More information about the asterisk-commits mailing list