Skip to content

Commit 6e1726d

Browse files
committed
Log replication connections only when log_connections is on
Previously we'd always log replication connections, with no way to turn them off.
1 parent b1dc45c commit 6e1726d

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/backend/utils/init/postinit.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -218,28 +218,17 @@ PerformAuthentication(Port *port)
218218
if (!disable_sig_alarm(true))
219219
elog(FATAL, "could not disable timer for authorization timeout");
220220

221-
/*
222-
* Log connection for streaming replication even if Log_connections
223-
* disabled.
224-
*/
225-
if (am_walsender)
221+
if (Log_connections)
226222
{
227-
if (port->remote_port[0])
223+
if (am_walsender)
228224
ereport(LOG,
229-
(errmsg("replication connection authorized: user=%s host=%s port=%s",
230-
port->user_name,
231-
port->remote_host,
232-
port->remote_port)));
225+
(errmsg("replication connection authorized: user=%s",
226+
port->user_name)));
233227
else
234228
ereport(LOG,
235-
(errmsg("replication connection authorized: user=%s host=%s",
236-
port->user_name,
237-
port->remote_host)));
229+
(errmsg("connection authorized: user=%s database=%s",
230+
port->user_name, port->database_name)));
238231
}
239-
else if (Log_connections)
240-
ereport(LOG,
241-
(errmsg("connection authorized: user=%s database=%s",
242-
port->user_name, port->database_name)));
243232

244233
set_ps_display("startup", false);
245234

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy