Re: logging blemishes - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: logging blemishes
Date
Msg-id 200509211558.j8LFwNv15679@candle.pha.pa.us
Whole thread Raw
In response to Re: logging blemishes  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: logging blemishes
List pgsql-hackers
Andrew Dunstan wrote:
> 
> 
> Bruce Momjian wrote:
> 
> >Andrew Dunstan wrote:
> >  
> >
> >>While preparing for a presentation, I noticed some mildly ugly effects 
> >>with log_line_prefix during session startup if log_connections is turned on.
> >>
> >>Example (log_line_prefix = '%t %q%u@%d %r %p %c:%l'):
> >>
> >>2005-09-19 19:16:39 EDT [unknown]@[unknown]  6541 432f46d7.198d:1 LOG:  
> >>connection received: host=[local] port=
> >>    
> >>
> >>Anyway, currently, we test for "stop producing output here" with the 
> >>following code in elog.c:
> >>
> >>            case 'q':
> >>                /* in postmaster and friends, stop if %q is seen */
> >>                /* in a backend, just ignore */
> >>                if (MyProcPort == NULL)
> >>                    i = format_len;
> >>                break;
> >>
> >>I'm wondering if we should extend that test slightly, to something like
> >>
> >>                if (MyProcPort == NULL || MyProcPort->username == NULL 
> >>|| *(MyProcPort->username) == '\0')
> >>    
> >>
> >
> >Interesting, but I would like to find a need to add those tests.
> >
> >  
> >
> 
> In the case above, I rather expected %q to kick in. With the additional 
> tests it would.
> 
> It's debatable, though, and not hugely important either way, I think.

Are you saying "connection received" should honor %q?  It seems it is a
session line, rather than a server line, no?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: Where is pgxs?
Next
From: Hans-Jürgen Schönig
Date:
Subject: Re: R: feature proposal ...