pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
split postgresql logfile
2+ messages / 2 participants
[nested] [flat]

* split postgresql logfile
@ 2021-11-29 11:12 Paul van Rixel <p.van.rixel@trendpage.nl>
  2021-11-30 01:14 ` Re: split postgresql logfile Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 2+ messages in thread

From: Paul van Rixel @ 2021-11-29 11:12 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hi all,

 

I wondered if it is worthwile to split the general postgresql.log file into
a logfile for rdbms related log entries and a connection based logfile?
Just like the Oracle rdbms.log and the listener.log for connections.

Now the postgresql.logs are polluted with log connections/disconnection,
Agent monitoring entries and in between some entries which need some
attention but you missed them. I know the option exists to disable
log_(dis)connections but because of auditing this option must be enabled.
We don't use a tool like Grafana yet and with pgBadger we are experimenting
but skipping "unnessary" lines makes the manually reading of the logs much
more clear.

Any hints, tips or best practice scenario is welcome!

 

Thanks and have a nice day,

 

Best regards,

Paul

 

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: split postgresql logfile
  2021-11-29 11:12 split postgresql logfile Paul van Rixel <p.van.rixel@trendpage.nl>
@ 2021-11-30 01:14 ` Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2021-11-30 01:14 UTC (permalink / raw)
  To: Paul van Rixel <p.van.rixel@trendpage.nl>; +Cc: pgsql-general@lists.postgresql.org

On Mon, Nov 29, 2021 at 12:12:11PM +0100, Paul van Rixel wrote:
> Now the postgresql.logs are polluted with log connections/disconnection,
> Agent monitoring entries and in between some entries which need some
> attention but you missed them. I know the option exists to disable
> log_(dis)connections but because of auditing this option must be enabled.
> We don't use a tool like Grafana yet and with pgBadger we are experimenting
> but skipping "unnessary" lines makes the manually reading of the logs much
> more clear.

The logging collector is an all-or-nothing operation, so your options
when using it are limited when it comes to filtering, I am afraid.  If
you'd wish to split the log entries, something that you could consider
is using the elog hook and redirect those logs into a dedicated file,
but that would mean being also careful about concurrency as you cannot
send those entries into the logging collector that would just write
logs in a serializable fashion in which log file it sees suited
depending on the server configuration (.csv, .log, etc.).

Another option for more filtering flexibility is syslog.  While,
contrary to the logging collector that it designed to never lose
messages, it could drop messages that cannot be written :/

For auditing compliance, the latter is never a good option.

(FWIW, another thing that's been asked across the years is to have
JSON as logging format.  There is a patch floating around to add this
support, but that won't apply to already-released versions.)
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-11-30 01:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-11-29 11:12 split postgresql logfile Paul van Rixel <p.van.rixel@trendpage.nl>
2021-11-30 01:14 ` Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox