summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2016-10-17 16:31:13 -0400
committerRobert Haas <rhaas@postgresql.org>2016-10-17 16:34:48 -0400
commit7d3235ba42f8d5fc70c58e242702cc5e2e3549a6 (patch)
treee105c3e73288dc9ed7164d44ef94678d7e2cbdc8 /doc/src
parent5ff4a67f63fd6d3eb01ff9707d4674ed54a89f3b (diff)
By default, set log_line_prefix = '%m [%p] '.
This value might not be to everyone's taste; in particular, some people might prefer %t to %m, and others may want %u, %d, or other fields. However, it's a vast improvement on the old default of ''. Christoph Berg
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/config.sgml14
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index e826c19698c..99ff9f5ab5a 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -5004,7 +5004,8 @@ local0.* /var/log/postgresql
value will pad on the left. Padding can be useful to aid human
readability in log files.
This parameter can only be set in the <filename>postgresql.conf</>
- file or on the server command line. The default is an empty string.
+ file or on the server command line. The default is
+ <literal>'%m [%p] '</> which logs a time stamp and the process ID.
<informaltable>
<tgroup cols="3">
@@ -5142,6 +5143,17 @@ FROM pg_stat_activity;
include those escapes if you are logging to <application>syslog</>.
</para>
</tip>
+
+ <tip>
+ <para>
+ The <literal>%q</> escape is useful when including information that is
+ only available in session (backend) context like user or database
+ name. For example:
+<programlisting>
+log_line_prefix = '%m [%p] %q%u@%d/%a '
+</programlisting>
+ </para>
+ </tip>
</listitem>
</varlistentry>