improving log management - Mailing list pgsql-hackers

From Euler Taveira de Oliveira
Subject improving log management
Date
Msg-id 4B4E88E5.6030603@timbira.com
Whole thread Raw
Responses Re: improving log management
Re: improving log management
List pgsql-hackers
Hi,

We support several methods for logging server messages. The "native" methods
(stderr, csvlogs) has poor management. We can't compress logs, send them to
another location/server, or just remove old ones. Another problem is that we
can't remove (automatically) old logs based on the number of existing log
files (of course we can do it using log_truncate_on_rotation and a
log_filename that matches the number of files -- but it *isn't* flexible). The
other log management softwares have a way to do that so why our logger doesn't
have such capability?

I want to propose a new command to be execute after the log file is rotated. A
GUC parameter log_after_rotation_command that takes a (set of) command(s) that
will be executed after a log file is rotated. It should be set only by
superuser. For example:

# compress and store the log file in another location
log_after_rotation_command = 'gzip %f && mv %p.gz /a/mylogs'

Depending on the comments, I will clean up the patch and send it later today.


--  Euler Taveira de Oliveira http://www.timbira.com/


pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Odd cruft in .psql_history in HEAD
Next
From: "Joshua D. Drake"
Date:
Subject: Re: plpython3