mirror of
https://github.com/postgres/postgres.git
synced 2025-04-21 12:05:57 +03:00
Add a <tip> that log_line_prefix should usually end with a space to
provide visual separation from the rest of the log line; I've been noticing lately that quite a few newbies fail to figure this out for themselves. Also a little editorial cleanup of the log_line_prefix description.
This commit is contained in:
parent
2128e5c392
commit
ec0bb02db8
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.127 2007/06/19 20:13:21 tgl Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.128 2007/06/22 16:15:23 tgl Exp $ -->
|
||||||
|
|
||||||
<chapter Id="runtime-config">
|
<chapter Id="runtime-config">
|
||||||
<title>Server Configuration</title>
|
<title>Server Configuration</title>
|
||||||
@ -2774,17 +2774,15 @@ SELECT * FROM parent WHERE key = 2400;
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This is a <function>printf</>-style string that is output at the
|
This is a <function>printf</>-style string that is output at the
|
||||||
beginning of each log line. The default is an empty string.
|
beginning of each log line.
|
||||||
Each recognized escape is replaced as outlined
|
<literal>%</> characters begin <quote>escape sequences</>
|
||||||
below - anything else that looks like an escape is ignored. Other
|
that are replaced with status information as outlined below.
|
||||||
|
Unrecognized escapes are ignored. Other
|
||||||
characters are copied straight to the log line. Some escapes are
|
characters are copied straight to the log line. Some escapes are
|
||||||
only recognized by session processes, and do not apply to
|
only recognized by session processes, and do not apply to
|
||||||
background processes such as the main server process. <application>Syslog</>
|
background processes such as the main server process.
|
||||||
produces its own
|
|
||||||
time stamp and process ID information, so you probably do not want to
|
|
||||||
use those escapes if you are using <application>syslog</>.
|
|
||||||
This parameter can only be set in the <filename>postgresql.conf</>
|
This parameter can only be set in the <filename>postgresql.conf</>
|
||||||
file or on the server command line.
|
file or on the server command line. The default is an empty string.
|
||||||
|
|
||||||
<informaltable>
|
<informaltable>
|
||||||
<tgroup cols="3">
|
<tgroup cols="3">
|
||||||
@ -2823,7 +2821,7 @@ SELECT * FROM parent WHERE key = 2400;
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>%t</literal></entry>
|
<entry><literal>%t</literal></entry>
|
||||||
<entry>Time stamp (no milliseconds, no timezone on Windows)</entry>
|
<entry>Time stamp without milliseconds (no timezone either on Windows)</entry>
|
||||||
<entry>no</entry>
|
<entry>no</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
@ -2833,16 +2831,12 @@ SELECT * FROM parent WHERE key = 2400;
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>%i</literal></entry>
|
<entry><literal>%i</literal></entry>
|
||||||
<entry>Command tag: This is the command that generated the log line.</entry>
|
<entry>Command tag: type of session's current command</entry>
|
||||||
<entry>yes</entry>
|
<entry>yes</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>%c</literal></entry>
|
<entry><literal>%c</literal></entry>
|
||||||
<entry>Session ID: A unique identifier for each session.
|
<entry>Session ID: see below</entry>
|
||||||
It is 2 4-byte hexadecimal numbers (without leading zeros)
|
|
||||||
separated by a dot. The numbers
|
|
||||||
are the session start time and the process ID, so this can also
|
|
||||||
be used as a space saving way of printing these items.</entry>
|
|
||||||
<entry>yes</entry>
|
<entry>yes</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
@ -2862,9 +2856,9 @@ SELECT * FROM parent WHERE key = 2400;
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>%q</literal></entry>
|
<entry><literal>%q</literal></entry>
|
||||||
<entry>Does not produce any output, but tells non-session
|
<entry>Produces no output, but tells non-session
|
||||||
processes to stop at this point in the string. Ignored by
|
processes to stop at this point in the string; ignored by
|
||||||
session processes.</entry>
|
session processes</entry>
|
||||||
<entry>no</entry>
|
<entry>no</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
@ -2875,7 +2869,30 @@ SELECT * FROM parent WHERE key = 2400;
|
|||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
</informaltable>
|
</informaltable>
|
||||||
|
|
||||||
|
The <literal>%c</> escape prints a quasi-unique session identifier,
|
||||||
|
consisting of two 4-byte hexadecimal numbers (without leading zeros)
|
||||||
|
separated by a dot. The numbers are the session start time and the
|
||||||
|
process ID, so <literal>%c</> can also be used as a space saving way
|
||||||
|
of printing those items.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<tip>
|
||||||
|
<para>
|
||||||
|
If you set a nonempty value for <varname>log_line_prefix</>,
|
||||||
|
you should usually make its last character be a space, to provide
|
||||||
|
visual separation from the rest of the log line. A punctuation
|
||||||
|
character could be used too.
|
||||||
|
</para>
|
||||||
|
</tip>
|
||||||
|
|
||||||
|
<tip>
|
||||||
|
<para>
|
||||||
|
<application>Syslog</> produces its own
|
||||||
|
time stamp and process ID information, so you probably do not want to
|
||||||
|
use those escapes if you are logging to <application>syslog</>.
|
||||||
|
</para>
|
||||||
|
</tip>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user