Re: logging stuff

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: logging stuff
Date: 2003-08-05 22:00:54
Message-ID: 200308052200.h75M0st22726@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


My issue is that I think there are reasonable people might want
username, dbname, hostname, host ip, and host port on the log lines.
This is the information that we currently report during a connection, if
enabled.

I have no problem adding those five booleans if people prefer booleans
--- my big point is that dbname isn't the only possible thing folks
would want. And of course, we already have pid and timestamp, so once
we are done, we will have seven possible data items on each line, and
with booleans there will be no control over their order on the line.

---------------------------------------------------------------------------

Andrew Dunstan wrote:
> Not quite the same - timestamps and pids have known formats, while db
> names are almost arbitrary. I know including spaces in names is horrible
> to my *nix way of thinking, but others might not have my prejudices.
> (interesting question - what characters are NOT allowed in a database
> name?).
>
> BTW, we're talking about 5 extra chars per line here. I know it adds up,
> but these days disk space is cheap and plentiful - for a million log
> lines we're still only talking 5Mb (says he whose first machine had a
> whopping 20Mb of disk space, and who paid hundreds of (aussie) dollars
> for the extra 10 Mb.)
>
> Syslog puts [] around pids, and typically has a lot of redundancy.
>
> I'm prepared to be guided by concensus, though.
>
> cheers
>
> andrew
>
>
> Tom Lane wrote:
>
> >Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> >
> >
> >>The dbname patch is now done. If nobody objects to the format
> >>("[db:yourdbname]") I'll submit it - I did it that way to make it fairly
> >>easy to split a log file based on it, although you would have to be
> >>careful with multiline log entries such as query strings.
> >>
> >>
> >
> >I'd tend to just put the dbname in a known column, and not bother with
> >the decoration --- decoration adds up fast when it's on every log line,
> >and I don't think it helps make the log more parseable. Compare what we
> >do with timestamps and pids.
> >
> > regards, tom lane
> >
> >
> >
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-08-05 22:02:45 Re: logging stuff
Previous Message Rod Taylor 2003-08-05 21:13:43 Re: Adjustment of spinlock sleep delays