CVS User Account cvsuser
Mon Sep 27 21:40:35 PDT 2004
Log Message:
-----------
Support for user derfined timestamp logging thanks goes to:
"Ed L." <pgsql at bluepolka.net>

Modified Files:
--------------
    slony1-engine/src/slon:
        confoptions.h (r1.4 -> r1.5)
        misc.c (r1.13 -> r1.14)

-------------- next part --------------
Index: confoptions.h
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/confoptions.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lsrc/slon/confoptions.h -Lsrc/slon/confoptions.h -u -w -r1.4 -r1.5
--- src/slon/confoptions.h
+++ src/slon/confoptions.h
@@ -26,6 +26,7 @@
 int Use_syslog;
 bool logpid;
 bool logtimestamp;
+char *log_timestamp_format;
 
 
 enum config_type
@@ -233,6 +234,16 @@
 		&pid_file,
 		NULL
 	},
+      {
+              {
+                      (const char *)"log_timestamp_format",
+                      gettext_noop("A strftime()-style log timestamp format string."),
+                      gettext_noop("A strftime()-style log timestamp format string."),
+                      SLON_C_STRING
+              },
+              &log_timestamp_format,
+              "%Y-%m-%d %H:%M:%S %Z"
+      },
 #ifdef HAVE_SYSLOG
 	{
 		{
Index: misc.c
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/misc.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -Lsrc/slon/misc.c -Lsrc/slon/misc.c -u -w -r1.13 -r1.14
--- src/slon/misc.c
+++ src/slon/misc.c
@@ -38,6 +38,7 @@
 
 extern bool     logpid;
 extern bool     logtimestamp;
+extern char    *log_timestamp_format;
 
 static pthread_mutex_t log_mutex = PTHREAD_MUTEX_INITIALIZER;
 
@@ -149,7 +150,7 @@
 
 	if (logtimestamp == true && (Use_syslog != 1))
 	{
-		strftime(time_buf, sizeof(time_buf), "%Y-%m-%d %H:%M:%S %Z", localtime(&stamp_time));
+		strftime(time_buf, sizeof(time_buf), log_timestamp_format, localtime(&stamp_time));
 		sprintf(outbuf, "%s ", time_buf);
 	}
 	if (logpid == true)


More information about the Slony1-commit mailing list