improving log management

Поиск
Список
Период
Сортировка
От Euler Taveira de Oliveira
Тема improving log management
Дата
Msg-id 4B4E88E5.6030603@timbira.com
обсуждение исходный текст
Ответы Re: improving log management  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: improving log management  (Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>)
Список 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 по дате отправления:

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Odd cruft in .psql_history in HEAD
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: plpython3