Re: logs of postgresql and pid-stamping. possible improvement?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Sullivan <andrew(at)libertyrms(dot)info>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: logs of postgresql and pid-stamping. possible improvement?
Date: 2002-08-15 18:13:14
Message-ID: 29819.1029435194@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andrew Sullivan <andrew(at)libertyrms(dot)info> writes:
> Yes, but all that stuff with the ! at the beginning is associated
> with the LOG: QUERY STATISTICS ahead of it, no? Isn't that enough of
> a separator to make it clear? Or am I missing something (likely)?

He's concerned about query stats printed by concurrent backends becoming
interleaved in the log file. A fair concern, but I don't think it's
real, at least not since 7.2.

As of 7.2, the whole multiline stats message will be written in a
single write() call, so I'd be pretty surprised if it got interleaved
with other processes' messages. At least on HPUX, this is guaranteed
not to happen when stderr is a pipe, so if you're piping the postmaster
log to some kind of log rotation script then it ought to be quite safe.
Possibly if the log is a plain disk file there might be trouble on some
kernels.

If you're logging via syslog() then it's a different story: each line is
sent to syslog individually, I believe. But syslog already marks each
line with PID.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Larry Rosenman 2002-08-15 18:16:43 Re: logs of postgresql and pid-stamping. possible
Previous Message Andrew Sullivan 2002-08-15 17:26:00 Re: logs of postgresql and pid-stamping. possible improvement?