Re: Unfiltered server logs routing via a new elog hook or existing emit_log_hook bypassing log_min_message check

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема Re: Unfiltered server logs routing via a new elog hook or existing emit_log_hook bypassing log_min_message check
Дата
Msg-id 20220502131419.xfhjnnmce3velh7u@jrouhaud
обсуждение исходный текст
Ответ на Re: Unfiltered server logs routing via a new elog hook or existing emit_log_hook bypassing log_min_message check  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: Unfiltered server logs routing via a new elog hook or existing emit_log_hook bypassing log_min_message check  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
On Mon, May 02, 2022 at 06:40:05PM +0530, Bharath Rupireddy wrote:
> On Mon, May 2, 2022 at 6:32 PM Julien Rouhaud <rjuju123@gmail.com> wrote:
> >
> > Unless I'm missing something you can already do all of that with the current
> > hook, since as mentioned in the comment above the hook can disable the server's
> > logging:
> >
> >          * Call hook before sending message to log.  The hook function is allowed
> >          * to turn off edata->output_to_server, so we must recheck that afterward.
> >
> > So you can configure your server with a very verbose log_min_message, and have
> > the same setting in your own extension to disable output_to_server after its
> > own processing is done.
> 
> No. The emit_log_hook isn't called for all the log messages, but only
> when output_to_server = true which means, say my log_min_messages is
> 'WARNING', the hook isn't called for the messages say elevel above it
> (NOTICE, INFO, DEBUGX).

I know.  What I said you could do is configure log_min_message to DEBUGX, so
your extension sees everything you want it to see.  And *in your extension* set
output_to_server to false if the level is not the *real level* you want to log.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Add pg_strtoupper and pg_strtolower functions
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: testclient.exe installed under MSVC