Re: log_statement and syslog severity

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Stuart Bishop <stuart(at)stuartbishop(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: log_statement and syslog severity
Date: 2010-03-11 17:06:39
Message-ID: 4B99231F.7080206@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stuart Bishop wrote:
> It might be possible to trick csvlog to log to a static filename, and
> perhaps substituting that with a named pipe might work (under unix at
> least).

As someone who did a bit of the work on the CSV log feature, I'll tell
you the way you have to note the log filename, account for rotations,
and everything else involved makes for a painful API to actually use was
obvious from day one. What I suggested was that many admins would want
a "tail-f like" API available to grabs at they come out, without having
to care about the underlying name. But no one has dumped enough
development resources into actually building one of them. At the time,
there were a host of genuine bugs in the logging approached used for CVS
logs, and just closing them all up before release time was difficult
enough. And there hasn't been enough asking about it to inspire
development since.

> I need to be analyzing log messages from PostgreSQL in real time, so
> am starting to investigate solutions. It seems painful, which would be
> avoidable for future generations if PostgreSQL could spawn a
> subprocess and send log messages to that in a machine readable format.

That is the only direction something like this is going to get built
in. What Bruce was suggesting is that the idea of building any more
logging intelligence into the database itself will never go anywhere.
The alternate question of "how do I get a better API for exporting
real-time logging messages I can process?" is still quite open in my
mind. The idea Magnus was already suggesting here, to add an alternate
"pipe" destination, would be one useful step forward here.

--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.us

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ozz Nixon 2010-03-11 17:47:22 Small install (w/ pSQLODBC support) needed.
Previous Message Gerhard Heift 2010-03-11 16:53:15 Re: Naming conventions for lots of stored procedures