|From:||Antonin Houska <ah(at)cybertec(dot)at>|
|To:||Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>|
|Subject:||Re: WIP: Separate log file for extension|
|Views:||Raw Message | Whole Thread | Download mbox|
Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> On Fri, Aug 25, 2017 at 4:12 PM, Antonin Houska <ah(at)cybertec(dot)at> wrote:
> > Attached is a draft patch to allow extension to write log messages to a
> > separate file.
> Does it allow postgres core code to write log messages to multiple log
> files as well? I can imagine a use case where we want to write log
> messages to separate log files by error level or purpose (server log
> and SQL log etc).
At low level it should work as long as several log streams are reserved for
the core code. However, as every single stream needs multiple variables, I
have no idea how to configure those additional streams w/o adding many new GUC
variables to the core.
Also the discussion what should (not) be logged separate would probably be
Specifically to log SQL statements to a separate file, I think (but not
verified) that you can write an extension that reserves a stream for itself
and also uses emit_log_hook to recognize SQL statements among the logged
messages. If the hook adjusts the syslogger_stream field of ErrorData
accordingly, the message should end up in the separate file.
|Next Message||Alexander Korotkov||2017-08-30 12:26:36||Re: ALTER INDEX .. SET STATISTICS ... behaviour|
|Previous Message||Tom Lane||2017-08-30 12:04:27||Re: Parallel worker error|