Re: [HACKERS] WIP: Separate log file for extension

2017-09-27 Thread Antonin Houska
Magnus Hagander wrote: > > On Fri, Aug 25, 2017 at 12:12 AM, Antonin Houska wrote: > > I like this idea in general. > > Then it's supposed to change some of its attributes > > > adjust_log_stream_attr(>filename, "my_extension.log"); > > This,

Re: [HACKERS] WIP: Separate log file for extension

2017-09-27 Thread Antonin Houska
Tomas Vondra wrote: > On 08/28/2017 11:23 AM, Antonin Houska wrote: > > Craig Ringer wrote: > > > >> On 25 August 2017 at 15:12, Antonin Houska wrote: > >> > >> How will this play with syslog? csvlog? etc? > > > > There's

Re: [HACKERS] WIP: Separate log file for extension

2017-09-10 Thread Magnus Hagander
On Fri, Aug 25, 2017 at 12:12 AM, Antonin Houska wrote: > Attached is a draft patch to allow extension to write log messages to a > separate file. It introduces a concept of a "log stream". The extension's > shared library gets its stream assigned by calling this function from

Re: [HACKERS] WIP: Separate log file for extension

2017-09-09 Thread Tomas Vondra
On 08/28/2017 11:23 AM, Antonin Houska wrote: > Craig Ringer wrote: > >> On 25 August 2017 at 15:12, Antonin Houska wrote: >> >> How will this play with syslog? csvlog? etc? > > There's nothing special about csvlog: the LogStream structure has a >

Re: [HACKERS] WIP: Separate log file for extension

2017-08-30 Thread Antonin Houska
Masahiko Sawada wrote: > On Fri, Aug 25, 2017 at 4:12 PM, Antonin Houska 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 >

Re: [HACKERS] WIP: Separate log file for extension

2017-08-29 Thread Masahiko Sawada
On Fri, Aug 25, 2017 at 4:12 PM, Antonin Houska 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

Re: [HACKERS] WIP: Separate log file for extension

2017-08-28 Thread Antonin Houska
Craig Ringer wrote: > On 25 August 2017 at 15:12, Antonin Houska wrote: > > How will this play with syslog? csvlog? etc? There's nothing special about csvlog: the LogStream structure has a "destination" field, so if particular extension wants this kind

Re: [HACKERS] WIP: Separate log file for extension

2017-08-27 Thread Craig Ringer
On 25 August 2017 at 15:12, Antonin Houska wrote: > Attached is a draft patch to allow extension to write log messages to a > separate file. I like the idea a lot. I'm not so sure about the approach. How will this play with syslog? csvlog? etc? I wonder if a level of

[HACKERS] WIP: Separate log file for extension

2017-08-25 Thread Antonin Houska
Attached is a draft patch to allow extension to write log messages to a separate file. It introduces a concept of a "log stream". The extension's shared library gets its stream assigned by calling this function from _PG_init() my_stream_id = get_log_stream("my_extension", _log_stream);