Re: [PATCH] Include application_name in "connection authorized" log message

From: Andres Freund <andres(at)anarazel(dot)de>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Don Seiler <don(at)seiler(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Include application_name in "connection authorized" log message
Date: 2018-06-22 19:38:07
Message-ID: 20180622193807.6jcwp5mno2ujxzc4@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-06-22 15:26:06 -0400, Alvaro Herrera wrote:
> On 2018-Jun-22, Andres Freund wrote:
>
> > On 2018-06-22 12:16:18 -0400, Robert Haas wrote:
>
> > > OK, that makes more sense, but I'm still skeptical of adding a special
> > > case particularly for application_name.
> >
> > I think a fair argument could be made that you'd want to have
> > application_name logged exactly once, not in every line. Just to cope
> > with log volume. With decent log analysis tools once is enough.
>
> Seems harder than it sounds ... because if the user turns off
> log_connections then it's not longer in the log.

That's superuser only, so I really don't quite buy that argument.

> And what about the application changing it after the fact?

I don't think that matters in a lot of scenarios. Poolers are the big
exception to that, obviously.

> One idea would be to have a log line designed specifically to be
> printed once at connection start (if not log_connections) and then
> once immediately after it changes. Am I the only one for whom this
> sounds like overengineering?

Yea. I think on balance, I don't buy that it's worth the cost. But I
don't think it's a clear cut "you don't need this".

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2018-06-22 19:43:10 Re: [WIP] [B-Tree] Retail IndexTuple deletion
Previous Message Alvaro Herrera 2018-06-22 19:26:06 Re: [PATCH] Include application_name in "connection authorized" log message