Skip site navigation (1) Skip section navigation (2)

Re: enable logging of start time/cookie for all backendprocesses

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: enable logging of start time/cookie for all backendprocesses
Date: 2007-08-02 04:41:31
Message-ID: 20070802044131.GA5949@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-patches
Andrew Dunstan wrote:
>
> The attached patch makes a very small but useful change to the behaviour of 
> log_line_prefix, by enabling the start time (%s) and cookie (%c) logging to 
> occur for all backends rather than just for session processes (i.e. 
> backends started for a client connection). We actually need almost all of 
> this patch, with or without the change in behaviour, so we can put the 
> cookie in CSVlogs (which I'm still working on), since the cookie+line 
> number make the natural primary key for the logs. The actual change in 
> behaviour from this patch comes from the removal of 2 "if (MyProcPort)" 
> lines in elog.c. Given that, can I sneak this in or should I wait for 8.4 
> given we're long past feature freeze?

Thinking again about the feature itself I wonder if it actually makes
sense -- maybe it does make sense to be able to display the session ID,
but the start time?  Why would anyone care about the start time of
syslogger or bgwriter?  We don't even have a use for the "hey, this
process was started" log line, why would anyone care about having the
start time in the log line prefix?

Actually having the cookie in all processes is another matter, as far as
it's useful for CSV logs.  But then, is it?  Maybe the auxiliary
processes should identify themselves with fixed cookies or something
particular that lets one distinguish, say, a bgwriter from a syslogger,
but is there a case from distinguishing one bgwriter from another?

-- 
Alvaro Herrera                 http://www.amazon.com/gp/registry/CTMLCN8V17R4
"Amanece.                                               (Ignacio Reyes)
 El Cerro San Cristóbal me mira, cínicamente, con ojos de virgen"

In response to

Responses

pgsql-patches by date

Next:From: Pavan DeolaseeDate: 2007-08-02 06:53:26
Subject: Re: HOT patch - version 11
Previous:From: Andrew DunstanDate: 2007-08-01 23:57:03
Subject: Re: enable logging of start time/cookie for all backend processes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group