diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-08-05 23:32:13 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-08-05 23:32:13 +0000 |
commit | bdf8ef6925de6ea1a9330fa1ce32e1a315d07eb2 (patch) | |
tree | 80d8dd5dd82a93e69e3e0133ffdca0a7c03ea893 /src/backend/utils/error/elog.c | |
parent | b4cd416ab0003483cbf5467974ead4732357b17d (diff) | |
download | postgresql-bdf8ef6925de6ea1a9330fa1ce32e1a315d07eb2.tar.gz postgresql-bdf8ef6925de6ea1a9330fa1ce32e1a315d07eb2.zip |
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/backend/utils/error/elog.c')
-rw-r--r-- | src/backend/utils/error/elog.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index 340cca03cac..9723cf76f59 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -37,7 +37,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.145 2004/08/04 20:58:46 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.146 2004/08/05 23:32:11 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -57,6 +57,7 @@ #include "mb/pg_wchar.h" #include "miscadmin.h" #include "postmaster/postmaster.h" +#include "postmaster/syslogger.h" #include "storage/ipc.h" #include "tcop/tcopprot.h" #include "utils/memutils.h" @@ -71,7 +72,7 @@ sigjmp_buf *PG_exception_stack = NULL; /* GUC parameters */ PGErrorVerbosity Log_error_verbosity = PGERROR_VERBOSE; char *Log_line_prefix = NULL; /* format for extra log line info */ -unsigned int Log_destination = LOG_DESTINATION_STDERR; +int Log_destination = LOG_DESTINATION_STDERR; #ifdef HAVE_SYSLOG char *Syslog_facility; /* openlog() parameters */ @@ -1589,6 +1590,10 @@ send_message_to_server_log(ErrorData *edata) fprintf(stderr, "%s", buf.data); } + /* If in the syslogger process, try to write messages direct to file */ + if (am_syslogger) + write_syslogger_file(buf.data, buf.len); + pfree(buf.data); } |