summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2004-08-05 23:32:13 +0000
committerTom Lane2004-08-05 23:32:13 +0000
commitbdf8ef6925de6ea1a9330fa1ce32e1a315d07eb2 (patch)
tree80d8dd5dd82a93e69e3e0133ffdca0a7c03ea893 /src/include
parentb4cd416ab0003483cbf5467974ead4732357b17d (diff)
Create a built-in log rotation program, so that we no longer have to
recommend that people go get Apache's rotatelogs program. Additional benefits are that configuration is done through GUC, rather than externally, and that the postmaster can monitor the log rotator and restart it after failure (though we certainly hope that won't happen often). Andreas Pflug, some rework by Tom Lane.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/postmaster/postmaster.h4
-rw-r--r--src/include/postmaster/syslogger.h39
-rw-r--r--src/include/utils/elog.h4
3 files changed, 43 insertions, 4 deletions
diff --git a/src/include/postmaster/postmaster.h b/src/include/postmaster/postmaster.h
index 75242d156d1..9afc228efd0 100644
--- a/src/include/postmaster/postmaster.h
+++ b/src/include/postmaster/postmaster.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/postmaster/postmaster.h,v 1.4 2004/07/21 20:34:48 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/postmaster/postmaster.h,v 1.5 2004/08/05 23:32:12 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -36,7 +36,7 @@ extern HANDLE PostmasterHandle;
extern int PostmasterMain(int argc, char *argv[]);
-extern void ClosePostmasterPorts(void);
+extern void ClosePostmasterPorts(bool am_syslogger);
#ifdef EXEC_BACKEND
extern pid_t postmaster_forkexec(int argc, char *argv[]);
extern int SubPostmasterMain(int argc, char *argv[]);
diff --git a/src/include/postmaster/syslogger.h b/src/include/postmaster/syslogger.h
new file mode 100644
index 00000000000..a0f775c9a21
--- /dev/null
+++ b/src/include/postmaster/syslogger.h
@@ -0,0 +1,39 @@
+/*-------------------------------------------------------------------------
+ *
+ * syslogger.h
+ * Exports from postmaster/syslogger.c.
+ *
+ * Copyright (c) 2004, PostgreSQL Global Development Group
+ *
+ * $PostgreSQL: pgsql/src/include/postmaster/syslogger.h,v 1.1 2004/08/05 23:32:12 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef _SYSLOGGER_H
+#define _SYSLOGGER_H
+
+/* GUC options */
+extern bool Redirect_stderr;
+extern int Log_RotationAge;
+extern int Log_RotationSize;
+extern char *Log_directory;
+extern char *Log_filename_prefix;
+
+extern bool am_syslogger;
+
+#ifndef WIN32
+extern int syslogPipe[2];
+#else
+extern HANDLE syslogPipe[2];
+#endif
+
+
+extern int SysLogger_Start(void);
+
+extern void write_syslogger_file(const char *buffer, int count);
+
+#ifdef EXEC_BACKEND
+extern void SysLoggerMain(int argc, char *argv[]);
+#endif
+
+#endif /* _SYSLOGGER_H */
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index 4a2d26ddb9d..ac27b796249 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.72 2004/07/31 23:04:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.73 2004/08/05 23:32:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -272,7 +272,7 @@ typedef enum
extern PGErrorVerbosity Log_error_verbosity;
extern char *Log_line_prefix;
-extern unsigned int Log_destination;
+extern int Log_destination;
/* Log destination bitmap */
#define LOG_DESTINATION_STDERR 1