Re: [HACKERS] WIP: Separate log file for extension
От | Antonin Houska |
---|---|
Тема | Re: [HACKERS] WIP: Separate log file for extension |
Дата | |
Msg-id | 10280.1504094914@localhost обсуждение исходный текст |
Ответ на | Re: [HACKERS] WIP: Separate log file for extension (Masahiko Sawada <sawada.mshk@gmail.com>) |
Список | pgsql-hackers |
Masahiko Sawada <sawada.mshk@gmail.com> wrote: > On Fri, Aug 25, 2017 at 4:12 PM, Antonin Houska <ah@cybertec.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 difficult. 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. -- Antonin Houska Cybertec Schönig & Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt Web: http://www.postgresql-support.de, http://www.cybertec.at
В списке pgsql-hackers по дате отправления: