From 5752de9913d91788f6efe8338aca82dca0c694d5 Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Mon, 16 Dec 2024 17:03:55 +0900 Subject: [PATCH] Feature: Allow logging_collector related parameters to be changed by reloading the Pgpool-II configurations. The following logging_collector related parameters can now be changed by reloading: - log_truncate_on_rotation - log_directory - log_filename - log_rotation_age - log_rotation_size - log_file_mode --- doc.ja/src/sgml/connection-pooling.sgml | 48 ++++++++++++------------- doc/src/sgml/connection-pooling.sgml | 36 +++++++++---------- src/config/pool_config_variables.c | 12 +++---- src/main/pgpool_main.c | 4 +++ 4 files changed, 52 insertions(+), 48 deletions(-) diff --git a/doc.ja/src/sgml/connection-pooling.sgml b/doc.ja/src/sgml/connection-pooling.sgml index 66980ce8d..3335e85ae 100644 --- a/doc.ja/src/sgml/connection-pooling.sgml +++ b/doc.ja/src/sgml/connection-pooling.sgml @@ -714,10 +714,10 @@ local0.* /var/log/pgpool.log デフォルトは/tmp/pgpool_logsです。 - - このパラメータはPgpool-II起動時のみ設定可能です。 + + このパラメータはPgpool-IIの設定を再読み込みすることで変更可能です。 @@ -760,10 +760,10 @@ local0.* /var/log/pgpool.log デフォルトはpgpool-%Y-%m-%d_%H%M%S.logです。 - - このパラメータはPgpool-II起動時のみ設定可能です。 + + このパラメータはPgpool-IIの設定を再読み込みすることで変更可能です。 @@ -799,10 +799,10 @@ local0.* /var/log/pgpool.log - - このパラメータはPgpool-II起動時のみ設定可能です。 + + このパラメータはPgpool-IIの設定を再読み込みすることで変更可能です。 @@ -834,10 +834,10 @@ local0.* /var/log/pgpool.log ゼロに設定することで、寿命に基づいた新しいログファイルの生成は無効になります。 - - このパラメータはPgpool-II起動時のみ設定可能です。 + + このパラメータはPgpool-IIの設定を再読み込みすることで変更可能です。 @@ -868,10 +868,10 @@ local0.* /var/log/pgpool.log ゼロに設定することで、サイズに基づいた新しいログファイルの生成は無効になります。 - - このパラメータはPgpool-II起動時のみ設定可能です。 + + このパラメータはPgpool-IIの設定を再読み込みすることで変更可能です。 @@ -904,10 +904,10 @@ local0.* /var/log/pgpool.log 例えば、この設定をpgpool-%H.logのようなと組み合わせて使用すると、24個の時別のログファイルが生成され、それらは周期的に上書きされることになります。 - - このパラメータはPgpool-II起動時のみ設定可能です。 + + このパラメータはPgpool-IIの設定を再読み込みすることで変更可能です。 diff --git a/doc/src/sgml/connection-pooling.sgml b/doc/src/sgml/connection-pooling.sgml index aff34b94b..daa84c3f7 100644 --- a/doc/src/sgml/connection-pooling.sgml +++ b/doc/src/sgml/connection-pooling.sgml @@ -453,9 +453,9 @@ the directory in which log files will be created. The default is /tmp/pgpool_logs. - - This parameter can only be set at the Pgpool-II start. - + + This parameter can be changed by reloading the Pgpool-II configurations. + @@ -482,9 +482,9 @@ The default is pgpool-%Y-%m-%d_%H%M%S.log. - - This parameter can only be set at the Pgpool-II start. - + + This parameter can be changed by reloading the Pgpool-II configurations. + @@ -507,9 +507,9 @@ - - This parameter can only be set at the Pgpool-II start. - + + This parameter can be changed by reloading the Pgpool-II configurations. + @@ -529,9 +529,9 @@ Set to zero to disable time-based creation of new log files. - - This parameter can only be set at the Pgpool-II start. - + + This parameter can be changed by reloading the Pgpool-II configurations. + @@ -550,9 +550,9 @@ Set to zero to disable size-based creation of new log files. - - This parameter can only be set at the Pgpool-II start. - + + This parameter can be changed by reloading the Pgpool-II configurations. + @@ -574,9 +574,9 @@ like pgpool-%H.log would result in generating twenty-four hourly log files and then cyclically overwriting them. - - This parameter can only be set at the Pgpool-II start. - + + This parameter can be changed by reloading the Pgpool-II configurations. + diff --git a/src/config/pool_config_variables.c b/src/config/pool_config_variables.c index 34e6430e6..4fa039664 100644 --- a/src/config/pool_config_variables.c +++ b/src/config/pool_config_variables.c @@ -799,7 +799,7 @@ static struct config_bool ConfigureNamesBool[] = NULL, NULL, NULL }, { - {"log_truncate_on_rotation", CFGCXT_INIT, LOGGING_CONFIG, + {"log_truncate_on_rotation", CFGCXT_RELOAD, LOGGING_CONFIG, "If on, an existing log file gets truncated on time based log rotation.", CONFIG_VAR_TYPE_BOOL, false, 0 }, @@ -1348,7 +1348,7 @@ static struct config_string ConfigureNamesString[] = NULL, NULL, NULL, NULL }, { - {"log_directory", CFGCXT_INIT, LOGGING_CONFIG, + {"log_directory", CFGCXT_RELOAD, LOGGING_CONFIG, "directory where log files are written.", CONFIG_VAR_TYPE_STRING, false, 0 }, @@ -1358,7 +1358,7 @@ static struct config_string ConfigureNamesString[] = }, { - {"log_filename", CFGCXT_INIT, LOGGING_CONFIG, + {"log_filename", CFGCXT_RELOAD, LOGGING_CONFIG, "log file name pattern.", CONFIG_VAR_TYPE_STRING, false, 0 }, @@ -2270,7 +2270,7 @@ static struct config_int ConfigureNamesInt[] = NULL, NULL, NULL }, { - {"log_rotation_age", CFGCXT_INIT, LOGGING_CONFIG, + {"log_rotation_age", CFGCXT_RELOAD, LOGGING_CONFIG, "Automatic rotation of logfiles will happen after that (minutes) time.", CONFIG_VAR_TYPE_INT, false, GUC_UNIT_MIN }, @@ -2280,7 +2280,7 @@ static struct config_int ConfigureNamesInt[] = NULL, NULL, NULL }, { - {"log_rotation_size", CFGCXT_INIT, LOGGING_CONFIG, + {"log_rotation_size", CFGCXT_RELOAD, LOGGING_CONFIG, "Automatic rotation of logfiles will happen after that much (kilobytes) log output.", CONFIG_VAR_TYPE_INT, false, GUC_UNIT_KB }, @@ -2290,7 +2290,7 @@ static struct config_int ConfigureNamesInt[] = NULL, NULL, NULL }, { - {"log_file_mode", CFGCXT_INIT, LOGGING_CONFIG, + {"log_file_mode", CFGCXT_RELOAD, LOGGING_CONFIG, "creation mode for log files.", CONFIG_VAR_TYPE_INT, false, 0 }, diff --git a/src/main/pgpool_main.c b/src/main/pgpool_main.c index 1fbc2ccd9..d74cf12b2 100644 --- a/src/main/pgpool_main.c +++ b/src/main/pgpool_main.c @@ -2225,6 +2225,10 @@ kill_all_children(int sig) /* make watchdog process reload as well */ if (watchdog_pid > 0) kill(watchdog_pid, sig); + + /* make logger process reload as well */ + if (pgpool_logger_pid > 0) + kill(pgpool_logger_pid, sig); } } -- 2.39.5