[Proposal][WIP] Add option to log auto_explain output to separate logfile

Started by Timofeyover 4 years ago2 messageshackers
Jump to latest
#1Timofey
tim-shlyap@yandex-team.ru

Hello, hackers!

Now, all of auto_explain output is directed to postgres's log and it is
not comfortably to extract on big highloaded systems.
My proposal is add option to auto_explain to log data to separate
logfile. In my patch I plan to (re)open file every time associated guc
variable is changing, included extension boot. In case of error or
unexpected situation file closes and output directed to common
postgres's log.
What do you think about this idea? Also i would be grateful about any
ideas how conveniently and suitable rotate that new log

Attachments:

Different_logfile_for_auto_explain_option.patchtext/x-patch; charset=UTF-8; name=Different_logfile_for_auto_explain_option.patchDownload+98-4
#2Pavel Stehule
pavel.stehule@gmail.com
In reply to: Timofey (#1)
Re: [Proposal][WIP] Add option to log auto_explain output to separate logfile

Hi

st 22. 12. 2021 v 14:54 odesílatel Timofey <tim-shlyap@yandex-team.ru>
napsal:

Hello, hackers!

Now, all of auto_explain output is directed to postgres's log and it is
not comfortably to extract on big highloaded systems.
My proposal is add option to auto_explain to log data to separate
logfile. In my patch I plan to (re)open file every time associated guc
variable is changing, included extension boot. In case of error or
unexpected situation file closes and output directed to common
postgres's log.
What do you think about this idea? Also i would be grateful about any
ideas how conveniently and suitable rotate that new log

It is good idea, but I think so it needs to be implemented more generally.
There should be a) possibility to add some extra informations, that can
allows redirect in others tools like rsyslog, b) possibility to use more
logfiles than one - for more extensions, or for slow query log, for log
sensitive or audit data, ... General design solves the problem with log
rotation.

Regards

Pavel