Re: Set log_line_prefix and application name in test drivers - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: Set log_line_prefix and application name in test drivers
Date
Msg-id 20160929141326.agfolqleicq5mlhg@msg.df7cb.de
Whole thread Raw
In response to Re: Set log_line_prefix and application name in test drivers  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
Re: Peter Eisentraut 2016-09-29 <21d2719f-36ff-06d2-5856-25ed48b965c5@2ndquadrant.com>
> > Christoph/Debian:
> >     log_line_prefix = '%t [%p-%l] %q%u@%d '
> > Peter:
> >     log_line_prefix = '%t [%p]: [%l] %qapp=%a '
>
> I'm aware of two existing guidelines on log line formats: syslog and
> pgbadger.  Syslog output looks like this:
>
> Sep 28 00:58:56 hostname syslogd[46]: some text here
>
> pgbadger by default asks for this:
>
> log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '
>
> I don't know why it wants that "-1" there, and I'm actually not sure
> what the point of %l is in practice.  Those are separate issues that are
> having their own lively discussions at times.  I could drop the [%l]
> from my proposal if that causes concerns.

[%l-1] is originally from pgfouine, and I vaguely remember that it
used to be something like [%l-%c] where %c was some extra line
numbering removed in later (7.something?) PG versions. In any case,
the -1 isn't useful.

I'm happy to remove %l as well. Log lines won't be out of order
anyway, and one needs to look at %p anyway to correlate them. %l
doesn't help there.

Christoph

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Set log_line_prefix and application name in test drivers
Next
From: Tomas Vondra
Date:
Subject: Re: Speed up Clog Access by increasing CLOG buffers