Change the default value for log_line_prefix.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 14 Jan 2022 07:35:31 +0000 (16:35 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 14 Jan 2022 07:35:31 +0000 (16:35 +0900)
Currently the default value for log_line_prefix is "%t pid: %p", which
is the long standing default. Also since 4.2, %a (application name) and
since 4.3 %m (timestamp with millisecond) are available.

This commit changes %t" (timestamp without millisecond) to %m because
PostgreSQL's default is already %m.  Also add %a so that admins easily
distinguish particular process's log.

In summary the default is changed from:
"%t pid: %p"
to:
"%m %a pid: %p"

This change will be applied to not only master branch but 4.3
stable. There's not so many 4.3 users yet and changing the default
will not affect existing 4.3 users. Only new 4.3 will enjoy the new
default.

Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2022-January/004098.html

doc.ja/src/sgml/connection-pooling.sgml
doc/src/sgml/connection-pooling.sgml
src/config/pool_config_variables.c
src/sample/pgpool.conf.sample-stream

index 165cc7c915998d77dd816cde9aa82849d67babab..1faa6bfda3cab98cce8063f82637560be3748d0c 100644 (file)
@@ -1289,16 +1289,13 @@ local0.*    /var/log/pgpool.log
       <literal>%</literal> characters begin <quote>escape sequences</> that are replaced
       with information outlined below.
       All unrecognized escapes are ignored. Other characters are copied straight to
-      the log line. Default is '%t: pid %p: ', which prints timestamp and process id,
-      which keeps backward compatibly with pre<productname>Pgpool-II</productname>
-      <emphasis>V3.4</emphasis>.
+      the log line. Default is '%m: %a pid %p: ', which prints timestamp, application name and process id.
       -->
       これは、各ログ行の先頭に出力する<function>printf</>の書式文字列です。
       <literal>%</>から始まる<quote>エスケープシーケンス</>は、後述の通りのステータス情報で置き換えられます。
       認識できないエスケープは無視されます。
       他の文字はそのままログ行に出力されます。
-      デフォルトは '%t: pid %p: 'で、タイムスタンプとプロセスIDを印字します。
-      これは、<productname>Pgpool-II</productname> <emphasis>V3.4</emphasis>より前のバージョンとの互換性を保つためです。
+      デフォルトは '%m: %a pid %p: 'で、タイムスタンプ、アプリケーション名、プロセスIDを印字します。
      </para>
 
      <table id="log-line-prefix-table">
index d0793fb94f86cdb27fb9056d83cc106d7b982f0b..fbd59289d6d4987047416f937bae4ad627f4b832 100644 (file)
       <literal>%</literal> characters begin <quote>escape sequences</> that are replaced
       with information outlined below.
       All unrecognized escapes are ignored. Other characters are copied straight to
-      the log line. Default is '%t: pid %p: ', which prints timestamp and process id,
-      which keeps backward compatibility with pre<productname>Pgpool-II</productname>
-      <emphasis>V3.4</emphasis>.
+      the log line. Default is '%m: %a pid %p: ', which prints timestamp, application name and process id.
      </para>
 
      <table id="log-line-prefix-table">
index 1c33cf6c40e2ec59db83fb8c5500f2803bdd56ac..57b9dfe1710071e40d7e16c901cc1120a0476803 100644 (file)
@@ -911,7 +911,7 @@ static struct config_string ConfigureNamesString[] =
                        CONFIG_VAR_TYPE_STRING, false, 0
                },
                &g_pool_config.log_line_prefix,
-               "%t: pid %p: ",
+               "%m: %a pid %p: ",
                NULL, NULL, NULL, NULL
        },
 
index 2a3cc752cf64017d64739aefebbe1138629b2a13..7a71dc83d6c2cddd50390a376b81692fe2148ae1 100644 (file)
@@ -193,7 +193,7 @@ backend_clustering_mode = 'streaming_replication'
 
 # - What to log -
 
-#log_line_prefix = '%t: pid %p: '   # printf-style string to output at beginning of each log line.
+#log_line_prefix = '%m: %a pid %p: '   # printf-style string to output at beginning of each log line.
 
 #log_connections = off
                                    # Log connections