Re: Logging (was Re: PostgreSQL 7.0-2 RPMset released.) - Mailing list pgsql-general

From Giles Lean
Subject Re: Logging (was Re: PostgreSQL 7.0-2 RPMset released.)
Date
Msg-id 3981.958977780@nemeton.com.au
Whole thread Raw
In response to Logging (was Re: PostgreSQL 7.0-2 RPMset released.)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Mon, 22 May 2000 00:19:45 -0400  Tom Lane wrote:

> There needn't be a lot of code involved, we just need a
> well-thought-out spec for how it should work.  Comments anyone?

I run postmaster under Dan Bernstein's "daemontools", which include
logging facilities:

    http://cr.yp.to/daemontools.html

The summary of this setup is that postmaster runs in the forground
writing error messages to standard error, and standard error is a pipe
to another process.  The second process is responsible for selecting
messages to write, writing them, and rotating the log file.

More traditional Unix solutions would involve teaching postmaster what
the name of its log file is, and to reopen it on receipt of some
signal. Usually SIGHUP is used since SIGHUP is unlikely to be useful
to a daemon running in the background.

There are issues for logging errors that many applications handle
badly.  What happens when:

o there is an I/O error writing to a log file?
o the log file is at maximum size?
o the filesystem the log file is in is full?
o a write to a log file blocks?

To take a not random example, syslogd is OK for log file rotation but
makes a mess and a muddle of things otherwise including the points I
list.

Regards,

Giles

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Logging (was Re: PostgreSQL 7.0-2 RPMset released.)
Next
From: "Robert B. Easter"
Date:
Subject: Re: [HACKERS] Postgresql OO Patch