summaryrefslogtreecommitdiff
path: root/src/backend/utils/misc
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/misc')
-rw-r--r--src/backend/utils/misc/guc.c68
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample14
2 files changed, 70 insertions, 12 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 22df3effc3..a827653bec 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.225 2004/07/28 14:23:29 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.226 2004/08/05 23:32:12 tgl Exp $
*
*--------------------------------------------------------------------
*/
@@ -44,6 +44,7 @@
#include "parser/parse_expr.h"
#include "parser/parse_relation.h"
#include "postmaster/bgwriter.h"
+#include "postmaster/syslogger.h"
#include "postmaster/postmaster.h"
#include "storage/bufmgr.h"
#include "storage/fd.h"
@@ -801,19 +802,13 @@ static struct config_bool ConfigureNamesBool[] =
&default_with_oids,
true, NULL, NULL
},
-
{
- {"integer_datetimes", PGC_INTERNAL, COMPILE_OPTIONS,
- gettext_noop("Datetimes are integer based"),
- NULL,
- GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
+ {"redirect_stderr", PGC_POSTMASTER, LOGGING_WHERE,
+ gettext_noop("Start a subprocess to capture stderr output into log files"),
+ NULL
},
- &integer_datetimes,
-#ifdef HAVE_INT64_TIMESTAMP
- true, NULL, NULL
-#else
+ &Redirect_stderr,
false, NULL, NULL
-#endif
},
#ifdef WAL_DEBUG
@@ -828,6 +823,20 @@ static struct config_bool ConfigureNamesBool[] =
},
#endif
+ {
+ {"integer_datetimes", PGC_INTERNAL, COMPILE_OPTIONS,
+ gettext_noop("Datetimes are integer based"),
+ NULL,
+ GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
+ },
+ &integer_datetimes,
+#ifdef HAVE_INT64_TIMESTAMP
+ true, NULL, NULL
+#else
+ false, NULL, NULL
+#endif
+ },
+
/* End-of-list marker */
{
{NULL, 0, 0, NULL, NULL}, NULL, false, NULL, NULL
@@ -1246,6 +1255,24 @@ static struct config_int ConfigureNamesInt[] =
},
{
+ {"log_rotation_age", PGC_SIGHUP, LOGGING_WHERE,
+ gettext_noop("Automatic logfile rotation will occur after N minutes"),
+ NULL
+ },
+ &Log_RotationAge,
+ 24*60, 0, INT_MAX, NULL, NULL
+ },
+
+ {
+ {"log_rotation_size", PGC_SIGHUP, LOGGING_WHERE,
+ gettext_noop("Automatic logfile rotation will occur after N kilobytes"),
+ NULL
+ },
+ &Log_RotationSize,
+ 10*1024, 0, INT_MAX, NULL, NULL
+ },
+
+ {
{"max_function_args", PGC_INTERNAL, COMPILE_OPTIONS,
gettext_noop("Shows the maximum number of function arguments"),
NULL,
@@ -1634,6 +1661,23 @@ static struct config_string ConfigureNamesString[] =
&log_destination_string,
"stderr", assign_log_destination, NULL
},
+ {
+ {"log_directory", PGC_SIGHUP, LOGGING_WHERE,
+ gettext_noop("Sets the destination directory for logfiles."),
+ gettext_noop("May be specified as relative to the cluster directory "
+ "or as absolute path.")
+ },
+ &Log_directory,
+ "pg_log", NULL, NULL
+ },
+ {
+ {"log_filename_prefix", PGC_SIGHUP, LOGGING_WHERE,
+ gettext_noop("Prefix for file names created in the log_directory."),
+ NULL
+ },
+ &Log_filename_prefix,
+ "postgresql-", NULL, NULL
+ },
#ifdef HAVE_SYSLOG
{
@@ -5055,7 +5099,7 @@ assign_log_destination(const char *value, bool doit, GucSource source)
char *rawstring;
List *elemlist;
ListCell *l;
- unsigned int newlogdest = 0;
+ int newlogdest = 0;
/* Need a modifiable copy of string */
rawstring = pstrdup(value);
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index 9dc1ec8d83..633bb5a322 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -170,9 +170,23 @@
#log_destination = 'stderr' # Valid values are combinations of stderr,
# syslog and eventlog, depending on
# platform.
+
+# This is relevant when logging to stderr:
+#redirect_stderr = false # Enable capturing of stderr into log files.
+# These are only relevant if redirect_stderr is true:
+#log_directory = 'pg_log' # Directory where logfiles are written.
+ # May be specified absolute or relative to PGDATA
+#log_filename_prefix = 'postgresql_' # Prefix for logfile names.
+#log_rotation_age = 1440 # Automatic rotation of logfiles will happen after
+ # so many minutes. 0 to disable.
+#log_rotation_size = 10240 # Automatic rotation of logfiles will happen after
+ # so many kilobytes of log output. 0 to disable.
+
+# These are relevant when logging to syslog:
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
+
# - When to Log -
#client_min_messages = notice # Values, in order of decreasing detail: