From ec0bb02db8452d4098023f82b100ba68d8f7dfab Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 22 Jun 2007 16:15:23 +0000 Subject: [PATCH] Add a 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. --- doc/src/sgml/config.sgml | 55 ++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 1d806bf1b7..a38b02fd21 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -1,4 +1,4 @@ - + Server Configuration @@ -2774,17 +2774,15 @@ SELECT * FROM parent WHERE key = 2400; This is a printf-style string that is output at the - beginning of each log line. The default is an empty string. - Each recognized escape is replaced as outlined - below - anything else that looks like an escape is ignored. Other + beginning of each log line. + % characters begin escape sequences + 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 only recognized by session processes, and do not apply to - background processes such as the main server process. Syslog - produces its own - time stamp and process ID information, so you probably do not want to - use those escapes if you are using syslog. + background processes such as the main server process. This parameter can only be set in the postgresql.conf - file or on the server command line. + file or on the server command line. The default is an empty string. @@ -2823,7 +2821,7 @@ SELECT * FROM parent WHERE key = 2400; %t - Time stamp (no milliseconds, no timezone on Windows) + Time stamp without milliseconds (no timezone either on Windows) no @@ -2833,16 +2831,12 @@ SELECT * FROM parent WHERE key = 2400; %i - Command tag: This is the command that generated the log line. + Command tag: type of session's current command yes %c - Session ID: A unique identifier for each session. - 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. + Session ID: see below yes @@ -2862,9 +2856,9 @@ SELECT * FROM parent WHERE key = 2400; %q - Does not produce any output, but tells non-session - processes to stop at this point in the string. Ignored by - session processes. + Produces no output, but tells non-session + processes to stop at this point in the string; ignored by + session processes no @@ -2875,7 +2869,30 @@ SELECT * FROM parent WHERE key = 2400; + + The %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 %c can also be used as a space saving way + of printing those items. + + + + If you set a nonempty value for 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. + + + + + + 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 syslog. + +