summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAndrew Dunstan2007-08-19 01:41:25 +0000
committerAndrew Dunstan2007-08-19 01:41:25 +0000
commitfd801f4faa8e0f00bc314b16549e3d8e8aa1b653 (patch)
tree246f025168f197ccd52ee322a2418ceee0cd0f78 /src/include
parente53a548794e7d79ab7466d2045db1049a63c0ee7 (diff)
Provide for logfiles in machine readable CSV format. In consequence, rename
redirect_stderr to logging_collector. Original patch from Arul Shaji, subsequently modified by Greg Smith, and then heavily modified by me.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/postmaster/syslogger.h16
-rw-r--r--src/include/utils/elog.h3
2 files changed, 11 insertions, 8 deletions
diff --git a/src/include/postmaster/syslogger.h b/src/include/postmaster/syslogger.h
index 535e4392c41..36125ac5e23 100644
--- a/src/include/postmaster/syslogger.h
+++ b/src/include/postmaster/syslogger.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 2004-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/postmaster/syslogger.h,v 1.10 2007/07/25 12:22:53 mha Exp $
+ * $PostgreSQL: pgsql/src/include/postmaster/syslogger.h,v 1.11 2007/08/19 01:41:25 adunstan Exp $
*
*-------------------------------------------------------------------------
*/
@@ -24,9 +24,9 @@
* also cope with non-protocol data coming down the pipe, though we cannot
* guarantee long strings won't get split apart.
*
- * We use 't' or 'f' instead of a bool for is_last to make the protocol a tiny
- * bit more robust against finding a false double nul byte prologue. But we
- * still might find it in the len and/or pid bytes unless we're careful.
+ * We use non-nul bytes in is_last to make the protocol a tiny bit
+ * more robust against finding a false double nul byte prologue. But
+ * we still might find it in the len and/or pid bytes unless we're careful.
*/
#ifdef PIPE_BUF
@@ -46,7 +46,9 @@ typedef struct
char nuls[2]; /* always \0\0 */
uint16 len; /* size of this chunk (counts data only) */
int32 pid; /* writer's pid */
- char is_last; /* last chunk of message? 't' or 'f' */
+ char is_last; /* last chunk of message? 't' or 'f'
+ * ('T' or 'F' for CSV case)
+ */
char data[1]; /* data payload starts here */
} PipeProtoHeader;
@@ -61,7 +63,7 @@ typedef union
/* GUC options */
-extern bool Redirect_stderr;
+extern bool Logging_collector;
extern int Log_RotationAge;
extern int Log_RotationSize;
extern PGDLLIMPORT char *Log_directory;
@@ -79,7 +81,7 @@ extern HANDLE syslogPipe[2];
extern int SysLogger_Start(void);
-extern void write_syslogger_file(const char *buffer, int count);
+extern void write_syslogger_file(const char *buffer, int count, int dest);
#ifdef EXEC_BACKEND
extern void SysLoggerMain(int argc, char *argv[]);
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index 0ad41c65b3a..6edc02c2332 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.87 2007/07/25 12:22:54 mha Exp $
+ * $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.88 2007/08/19 01:41:25 adunstan Exp $
*
*-------------------------------------------------------------------------
*/
@@ -291,6 +291,7 @@ extern int Log_destination;
#define LOG_DESTINATION_STDERR 1
#define LOG_DESTINATION_SYSLOG 2
#define LOG_DESTINATION_EVENTLOG 4
+#define LOG_DESTINATION_CSVLOG 8
/* Other exported functions */
extern void DebugFileOpen(void);