Thread: RFC: New log_destination 'fifo'

RFC: New log_destination 'fifo'

From
"Joshua D. Drake"
Date:
Hello,

So it is possible to do this in other ways but I thought it might be 
interesting to allow people to define fifo or pipe as a log_desination. 
This would allow a person to tail the fifo to receive the outputs of the 
log as it happens but would not take up precious IO or space from the 
disk. I personally have found this valuable when diagnosing immediate 
unexpected problems. It would also work on Windows.

Sincerely,

JD


-- 
Command Prompt, Inc. - http://www.commandprompt.com/
PostgreSQL Support, Training, Professional Services and Development
High Availability, Oracle Conversion, Postgres-XC
@cmdpromptinc - 509-416-6579



Re: RFC: New log_destination 'fifo'

From
Magnus Hagander
Date:
On Wed, Nov 7, 2012 at 9:55 PM, Joshua D. Drake <jd@commandprompt.com> wrote:
>
> Hello,
>
> So it is possible to do this in other ways but I thought it might be
> interesting to allow people to define fifo or pipe as a log_desination. This
> would allow a person to tail the fifo to receive the outputs of the log as
> it happens but would not take up precious IO or space from the disk. I
> personally have found this valuable when diagnosing immediate unexpected
> problems. It would also work on Windows.

This is something that has been discussed before a couple of times.
I've even gotten started on an implementation at one point, though in
fairness I didn't get much past "git branch".

I definitely think it would be a useful thing.


--Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/



Re: RFC: New log_destination 'fifo'

From
David Fetter
Date:
On Wed, Nov 07, 2012 at 12:55:03PM -0800, Joshua D. Drake wrote:
> 
> Hello,
> 
> So it is possible to do this in other ways but I thought it might be
> interesting to allow people to define fifo or pipe as a
> log_desination.  This would allow a person to tail the fifo to
> receive the outputs of the log as it happens but would not take up
> precious IO or space from the disk.  I personally have found this
> valuable when diagnosing immediate unexpected problems.  It would
> also work on Windows.

I've often wanted this feature, and it's a pleasant surprise (at least
to me) that Windows has the underlying capability.

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate



Re: RFC: New log_destination 'fifo'

From
Peter Eisentraut
Date:
On Wed, 2012-11-07 at 12:55 -0800, Joshua D. Drake wrote:
> So it is possible to do this in other ways but I thought it might be 
> interesting to allow people to define fifo or pipe as a
> log_desination. 

You could do this with a logging hook as a plugin, so you don't have to
make the effort to get this integrated into the main line (yet).

One problem to consider with fifos and pipes is what happens when the
receiving side is down or not keeping up.  You don't want the logging to
become a potential source of failures.




Re: RFC: New log_destination 'fifo'

From
"Joshua D. Drake"
Date:
On 11/07/2012 02:46 PM, David Fetter wrote:
>
> On Wed, Nov 07, 2012 at 12:55:03PM -0800, Joshua D. Drake wrote:
>>
>> Hello,
>>
>> So it is possible to do this in other ways but I thought it might be
>> interesting to allow people to define fifo or pipe as a
>> log_desination.  This would allow a person to tail the fifo to
>> receive the outputs of the log as it happens but would not take up
>> precious IO or space from the disk.  I personally have found this
>> valuable when diagnosing immediate unexpected problems.  It would
>> also work on Windows.
>
> I've often wanted this feature, and it's a pleasant surprise (at least
> to me) that Windows has the underlying capability.

Alright, we will see what we can do to put this together.

JD


>
> Cheers,
> David.
>


-- 
Command Prompt, Inc. - http://www.commandprompt.com/
PostgreSQL Support, Training, Professional Services and Development
High Availability, Oracle Conversion, Postgres-XC
@cmdpromptinc - 509-416-6579



Re: RFC: New log_destination 'fifo'

From
"Joshua D. Drake"
Date:
On 11/07/2012 10:22 PM, Peter Eisentraut wrote:
>
> On Wed, 2012-11-07 at 12:55 -0800, Joshua D. Drake wrote:
>> So it is possible to do this in other ways but I thought it might be
>> interesting to allow people to define fifo or pipe as a
>> log_desination.
>
> You could do this with a logging hook as a plugin, so you don't have to
> make the effort to get this integrated into the main line (yet).
>
> One problem to consider with fifos and pipes is what happens when the
> receiving side is down or not keeping up.  You don't want the logging to
> become a potential source of failures.

Good point.

JD

>
>
>


-- 
Command Prompt, Inc. - http://www.commandprompt.com/
PostgreSQL Support, Training, Professional Services and Development
High Availability, Oracle Conversion, Postgres-XC
@cmdpromptinc - 509-416-6579