Re: Logging (was Re: PostgreSQL 7.0-2 RPMset released.)

From: Giles Lean <giles-pgsql(at)nemeton(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>, Thomas Good <tomg(at)admin(dot)nrnet(dot)org>, pgsql-ports(at)postgresql(dot)org, "PostgreSQL::General List" <pgsql-general(at)postgresql(dot)org>, teg(at)redhat(dot)com, Richard Smith <ozric(at)tampabay(dot)rr(dot)com>
Subject: Re: Logging (was Re: PostgreSQL 7.0-2 RPMset released.)
Date: 2000-05-22 06:43:00
Message-ID: 3981.958977780@nemeton.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-announce pgsql-general pgsql-hackers pgsql-ports


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

In response to

Browse pgsql-announce by date

  From Date Subject
Next Message Palle Girgensohn 2000-05-22 15:02:37 Re: [PORTS] Logging (was Re: PostgreSQL 7.0-2 RPMset released.)
Previous Message Tom Lane 2000-05-22 04:19:45 Logging (was Re: PostgreSQL 7.0-2 RPMset released.)

Browse pgsql-general by date

  From Date Subject
Next Message Robert B. Easter 2000-05-22 06:52:41 Re: [HACKERS] Postgresql OO Patch
Previous Message Tom Lane 2000-05-22 04:19:45 Logging (was Re: PostgreSQL 7.0-2 RPMset released.)

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert B. Easter 2000-05-22 06:52:41 Re: [HACKERS] Postgresql OO Patch
Previous Message Michael Robinson 2000-05-22 06:39:46 A test to add to the crashme test

Browse pgsql-ports by date

  From Date Subject
Next Message Palle Girgensohn 2000-05-22 15:02:37 Re: [PORTS] Logging (was Re: PostgreSQL 7.0-2 RPMset released.)
Previous Message Tom Lane 2000-05-22 04:19:45 Logging (was Re: PostgreSQL 7.0-2 RPMset released.)