aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/init/postinit.c
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2011-01-18 20:02:25 +0100
committerMagnus Hagander <magnus@hagander.net>2011-01-18 20:02:25 +0100
commit6e1726d082b5a9c305ed44a69ff50bc3407d01a2 (patch)
treec6a1452faffa249070899186e6110cb95ccafd25 /src/backend/utils/init/postinit.c
parentb1dc45c11d8e63df34044ea73e643f5fa9d8c316 (diff)
downloadpostgresql-6e1726d082b5a9c305ed44a69ff50bc3407d01a2.tar.gz
postgresql-6e1726d082b5a9c305ed44a69ff50bc3407d01a2.zip
Log replication connections only when log_connections is on
Previously we'd always log replication connections, with no way to turn them off.
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r--src/backend/utils/init/postinit.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 76890f2fda7..f3ca5a5cd6a 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -218,28 +218,17 @@ PerformAuthentication(Port *port)
if (!disable_sig_alarm(true))
elog(FATAL, "could not disable timer for authorization timeout");
- /*
- * Log connection for streaming replication even if Log_connections
- * disabled.
- */
- if (am_walsender)
+ if (Log_connections)
{
- if (port->remote_port[0])
+ if (am_walsender)
ereport(LOG,
- (errmsg("replication connection authorized: user=%s host=%s port=%s",
- port->user_name,
- port->remote_host,
- port->remote_port)));
+ (errmsg("replication connection authorized: user=%s",
+ port->user_name)));
else
ereport(LOG,
- (errmsg("replication connection authorized: user=%s host=%s",
- port->user_name,
- port->remote_host)));
+ (errmsg("connection authorized: user=%s database=%s",
+ port->user_name, port->database_name)));
}
- else if (Log_connections)
- ereport(LOG,
- (errmsg("connection authorized: user=%s database=%s",
- port->user_name, port->database_name)));
set_ps_display("startup", false);