Re: Set log_line_prefix and application name in test drivers

From: Christoph Berg <myon(at)debian(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: Set log_line_prefix and application name in test drivers
Date: 2016-09-29 14:18:20
Message-ID: 20160929141820.ks7ykduo7gtrzofz@msg.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Re: Tom Lane 2016-09-29 <16946(dot)1475157978(at)sss(dot)pgh(dot)pa(dot)us>
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > As long as we get %t and %p in there we're going to be way ahead, really.
>
> Could we get consensus on just changing the default to
>
> log_line_prefix = '%t [%p] '
>
> and leaving the rest out of it? I think pretty much everybody agrees
> that those fields are useful, whereas the rest of it is a lot more
> context-dependent. (For example, there are a whole lot of real
> installations where neither %u nor %d would be worth the log space.)

Nod. In many installations %u and %d will be effectively constants.

> Personally I'm also on board with using this for regression testing:
>
> log_line_prefix = '%t [%p] %q%a '
>
> but I doubt it can be sold as a general-purpose default.

I don't think it makes much sense to log only %a unconditionally,
except maybe for making more applications actually set it.

If we were to add more fields I'd go for

log_line_prefix = '%t [%p] %q%u(at)%d/%a '

but the above-proposed '%t [%p] ' is already fixing 95% of the problem
(and the remaining 5% are unclear).

Possibly the longer version could be added as an example in the
documentation.

So, in short, +1.

Christoph

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-09-29 14:30:25 Re: Bug in to_timestamp().
Previous Message Tomas Vondra 2016-09-29 14:14:44 Re: Speed up Clog Access by increasing CLOG buffers