Replace deprecated log_connections values in docs and tests
9219093cab2607f modularized log_connections output to allow more granular control over which aspects of connection establishment are logged. It converted the boolean log_connections GUC into a list of strings and deprecated previously supported boolean-like values on, off, true, false, 1, 0, yes, and no. Those values still work, but they are supported mainly for backwards compatability. As such, documented examples of log_connections should not use these deprecated values. Update references in the docs to deprecated log_connections values. Many of the tests use log_connections. This commit also updates the tests to use the new values of log_connections. In some of the tests, the updated log_connections value covers a narrower set of aspects (e.g. the 'authentication' aspect in the tests in src/test/authentication and the 'receipt' aspect in src/test/postmaster). In other cases, the new value for log_connections is a superset of the previous included aspects (e.g. 'all' in src/test/kerberos/t/001_auth.pl). Reported-by: Peter Eisentraut <peter@eisentraut.org> Author: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: Jacob Champion <jacob.champion@enterprisedb.com> Discussion: https://postgr.es/m/e1586594-3b69-4aea-87ce-73a7488cdc97%40eisentraut.org
This commit is contained in:
parent
d376ab570e
commit
cb1456423d
@ -140,7 +140,7 @@
|
||||
An example of what this file might look like is:
|
||||
<programlisting>
|
||||
# This is a comment
|
||||
log_connections = yes
|
||||
log_connections = all
|
||||
log_destination = 'syslog'
|
||||
search_path = '"$user", public'
|
||||
shared_buffers = 128MB
|
||||
@ -337,7 +337,7 @@ UPDATE pg_settings SET setting = reset_val WHERE name = 'configuration_parameter
|
||||
<option>-c name=value</option> command-line parameter, or its equivalent
|
||||
<option>--name=value</option> variation. For example,
|
||||
<programlisting>
|
||||
postgres -c log_connections=yes --log-destination='syslog'
|
||||
postgres -c log_connections=all --log-destination='syslog'
|
||||
</programlisting>
|
||||
Settings provided in this way override those set via
|
||||
<filename>postgresql.conf</filename> or <command>ALTER SYSTEM</command>,
|
||||
|
@ -3693,7 +3693,7 @@ set_debug_options(int debug_flag, GucContext context, GucSource source)
|
||||
|
||||
if (debug_flag >= 1 && context == PGC_POSTMASTER)
|
||||
{
|
||||
SetConfigOption("log_connections", "true", context, source);
|
||||
SetConfigOption("log_connections", "all", context, source);
|
||||
SetConfigOption("log_disconnections", "true", context, source);
|
||||
}
|
||||
if (debug_flag >= 2)
|
||||
|
@ -107,7 +107,7 @@ $node->append_conf(
|
||||
listen_addresses = '$hostaddr'
|
||||
|
||||
# Capturing the EVENTS that occur during tests requires these settings
|
||||
log_connections = on
|
||||
log_connections = 'receipt,authentication,authorization'
|
||||
log_disconnections = on
|
||||
trace_connection_negotiation = on
|
||||
lc_messages = 'C'
|
||||
|
@ -71,7 +71,7 @@ sub test_role
|
||||
|
||||
my $node = PostgreSQL::Test::Cluster->new('node');
|
||||
$node->init;
|
||||
$node->append_conf('postgresql.conf', "log_connections = on\n");
|
||||
$node->append_conf('postgresql.conf', "log_connections = authentication\n");
|
||||
# Needed to allow connect_fails to inspect postmaster log:
|
||||
$node->append_conf('postgresql.conf', "log_min_messages = debug2");
|
||||
$node->start;
|
||||
|
@ -18,7 +18,7 @@ if (!$windows_os || $use_unix_sockets)
|
||||
# Initialize primary node
|
||||
my $node = PostgreSQL::Test::Cluster->new('primary');
|
||||
$node->init;
|
||||
$node->append_conf('postgresql.conf', "log_connections = on\n");
|
||||
$node->append_conf('postgresql.conf', "log_connections = authentication\n");
|
||||
$node->start;
|
||||
|
||||
my $huge_pages_status =
|
||||
|
@ -20,7 +20,7 @@ my $node = PostgreSQL::Test::Cluster->new('primary');
|
||||
$node->init;
|
||||
$node->append_conf(
|
||||
'postgresql.conf', q[
|
||||
log_connections = on
|
||||
log_connections = 'receipt,authentication'
|
||||
]);
|
||||
|
||||
$node->start;
|
||||
|
@ -65,7 +65,7 @@ $node->append_conf(
|
||||
'postgresql.conf', qq{
|
||||
listen_addresses = '$hostaddr'
|
||||
krb_server_keyfile = '$krb->{keytab}'
|
||||
log_connections = on
|
||||
log_connections = all
|
||||
log_min_messages = debug2
|
||||
lc_messages = 'C'
|
||||
});
|
||||
|
@ -47,7 +47,7 @@ note "setting up PostgreSQL instance";
|
||||
|
||||
my $node = PostgreSQL::Test::Cluster->new('node');
|
||||
$node->init;
|
||||
$node->append_conf('postgresql.conf', "log_connections = on\n");
|
||||
$node->append_conf('postgresql.conf', "log_connections = all\n");
|
||||
# Needed to allow connect_fails to inspect postmaster log:
|
||||
$node->append_conf('postgresql.conf', "log_min_messages = debug2");
|
||||
$node->start;
|
||||
|
@ -43,7 +43,7 @@ note "setting up PostgreSQL instance";
|
||||
|
||||
my $node = PostgreSQL::Test::Cluster->new('node');
|
||||
$node->init;
|
||||
$node->append_conf('postgresql.conf', "log_connections = on\n");
|
||||
$node->append_conf('postgresql.conf', "log_connections = all\n");
|
||||
$node->start;
|
||||
|
||||
$node->safe_psql('postgres', 'CREATE USER test0;');
|
||||
|
@ -42,7 +42,8 @@ note "setting up PostgreSQL instance";
|
||||
|
||||
my $node = PostgreSQL::Test::Cluster->new('node');
|
||||
$node->init;
|
||||
$node->append_conf('postgresql.conf', "log_connections = on\n");
|
||||
$node->append_conf('postgresql.conf',
|
||||
"log_connections = 'receipt,authentication,authorization'\n");
|
||||
$node->append_conf('postgresql.conf',
|
||||
"shared_preload_libraries = 'ldap_password_func'");
|
||||
$node->start;
|
||||
|
@ -45,7 +45,7 @@ if ($ENV{with_python} ne 'yes')
|
||||
|
||||
my $node = PostgreSQL::Test::Cluster->new('primary');
|
||||
$node->init;
|
||||
$node->append_conf('postgresql.conf', "log_connections = on\n");
|
||||
$node->append_conf('postgresql.conf', "log_connections = all\n");
|
||||
$node->append_conf('postgresql.conf',
|
||||
"oauth_validator_libraries = 'validator'\n");
|
||||
# Needed to allow connect_fails to inspect postmaster log:
|
||||
|
@ -26,7 +26,7 @@ if (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\boauth\b/)
|
||||
|
||||
my $node = PostgreSQL::Test::Cluster->new('primary');
|
||||
$node->init;
|
||||
$node->append_conf('postgresql.conf', "log_connections = on\n");
|
||||
$node->append_conf('postgresql.conf', "log_connections = all\n");
|
||||
$node->append_conf('postgresql.conf',
|
||||
"oauth_validator_libraries = 'validator'\n");
|
||||
$node->start;
|
||||
|
@ -20,7 +20,8 @@ $node->init(
|
||||
$node->append_conf('postgresql.conf', "max_connections = 6");
|
||||
$node->append_conf('postgresql.conf', "reserved_connections = 2");
|
||||
$node->append_conf('postgresql.conf', "superuser_reserved_connections = 1");
|
||||
$node->append_conf('postgresql.conf', "log_connections = on");
|
||||
$node->append_conf('postgresql.conf',
|
||||
"log_connections = 'receipt,authentication,authorization'");
|
||||
$node->append_conf('postgresql.conf', "log_min_messages=debug2");
|
||||
$node->start;
|
||||
|
||||
|
@ -33,7 +33,8 @@ $node->append_conf('postgresql.conf', "max_connections = 5");
|
||||
$node->append_conf('postgresql.conf', "max_wal_senders = 0");
|
||||
$node->append_conf('postgresql.conf', "autovacuum_max_workers = 1");
|
||||
$node->append_conf('postgresql.conf', "max_worker_processes = 1");
|
||||
$node->append_conf('postgresql.conf', "log_connections = on");
|
||||
$node->append_conf('postgresql.conf',
|
||||
"log_connections = 'receipt,authentication,authorization'");
|
||||
$node->append_conf('postgresql.conf', "log_min_messages = debug2");
|
||||
$node->append_conf('postgresql.conf',
|
||||
"authentication_timeout = '$authentication_timeout s'");
|
||||
|
@ -27,7 +27,7 @@ $node->start();
|
||||
$node->safe_psql(
|
||||
'postgres',
|
||||
q[ALTER SYSTEM SET restart_after_crash = 1;
|
||||
ALTER SYSTEM SET log_connections = 1;
|
||||
ALTER SYSTEM SET log_connections = receipt;
|
||||
SELECT pg_reload_conf();]);
|
||||
|
||||
# Run psql, keeping session alive, so we have an alive backend to kill.
|
||||
|
@ -26,7 +26,7 @@ $node->start();
|
||||
$node->safe_psql(
|
||||
'postgres',
|
||||
q[ALTER SYSTEM SET remove_temp_files_after_crash = on;
|
||||
ALTER SYSTEM SET log_connections = 1;
|
||||
ALTER SYSTEM SET log_connections = receipt;
|
||||
ALTER SYSTEM SET work_mem = '64kB';
|
||||
ALTER SYSTEM SET restart_after_crash = on;
|
||||
SELECT pg_reload_conf();]);
|
||||
|
@ -14,7 +14,7 @@ $node_primary->init(allows_streaming => 1);
|
||||
$node_primary->append_conf(
|
||||
'postgresql.conf', q[
|
||||
allow_in_place_tablespaces = true
|
||||
log_connections=on
|
||||
log_connections=receipt
|
||||
# to avoid "repairing" corruption
|
||||
full_page_writes=off
|
||||
log_min_messages=debug2
|
||||
|
@ -15,7 +15,7 @@ $node->append_conf(
|
||||
autovacuum = off
|
||||
max_prepared_transactions=5
|
||||
log_min_duration_statement=0
|
||||
log_connections=on
|
||||
log_connections=receipt
|
||||
log_disconnections=on
|
||||
));
|
||||
|
||||
|
@ -200,7 +200,7 @@ sub configure_test_server_for_ssl
|
||||
$node->append_conf(
|
||||
'postgresql.conf', <<EOF
|
||||
fsync=off
|
||||
log_connections=on
|
||||
log_connections=all
|
||||
log_hostname=on
|
||||
listen_addresses='$serverhost'
|
||||
log_statement=all
|
||||
|
@ -8,7 +8,7 @@ max_prepared_transactions = 10
|
||||
# Settings that make logs more useful
|
||||
log_autovacuum_min_duration = 0
|
||||
log_checkpoints = true
|
||||
log_connections = true
|
||||
log_connections = all
|
||||
log_disconnections = true
|
||||
log_line_prefix = '%m [%p][%b] %q[%a][%v:%x] '
|
||||
log_lock_waits = true
|
||||
|
Loading…
x
Reference in New Issue
Block a user