[PATCH] Log CSV by default

From: David Fetter <david(at)fetter(dot)org>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: [PATCH] Log CSV by default
Date: 2018-11-30 18:53:18
Message-ID: 20181130185318.GA2834@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


This makes it much simpler for computers to use the logs while not
making it excessively difficult for humans to use them.

diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 03594e77fe..21a0f4f86c 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1544,7 +1544,7 @@ static struct config_bool ConfigureNamesBool[] =
NULL
},
&Logging_collector,
- false,
+ true,
NULL, NULL, NULL
},
{
@@ -3727,13 +3727,13 @@ static struct config_string ConfigureNamesString[] =
{
{"log_destination", PGC_SIGHUP, LOGGING_WHERE,
gettext_noop("Sets the destination for server log output."),
- gettext_noop("Valid values are combinations of \"stderr\", "
- "\"syslog\", \"csvlog\", and \"eventlog\", "
+ gettext_noop("Valid values are combinations of \"csvlog\", "
+ "\"stderr\", \"syslog\", and \"eventlog\", "
"depending on the platform."),
GUC_LIST_INPUT
},
&Log_destination_string,
- "stderr",
+ "csvlog",
check_log_destination, assign_log_destination, NULL
},
{
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index 1fa02d2c93..c68ac6868c 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -411,13 +411,13 @@

# - Where to Log -

-#log_destination = 'stderr' # Valid values are combinations of
- # stderr, csvlog, syslog, and eventlog,
- # depending on platform. csvlog
- # requires logging_collector to be on.
+#log_destination = 'csvlog' # Valid values are combinations of
+ # csvlog, stderr, syslog, and eventlog,
+ # depending on platform. Options other than csvlog
+ # do not require that logging_collector be on.

# This is used when logging to stderr:
-#logging_collector = off # Enable capturing of stderr and csvlog
+#logging_collector = on # Enable capturing of stderr and csvlog
# into log files. Required to be on for
# csvlogs.
# (change requires restart)

--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-11-30 18:54:53 Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query
Previous Message Peter Eisentraut 2018-11-30 18:33:26 Re: pgbench doc fix