Re: How To Log User Name + Database? - Mailing list pgsql-general

From Larry Rosenman
Subject Re: How To Log User Name + Database?
Date
Msg-id 20001206113050.A13539@lerami.lerctr.org
Whole thread Raw
In response to Re: How To Log User Name + Database?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: How To Log User Name + Database?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
* Tom Lane <tgl@sss.pgh.pa.us> [001206 11:25]:
> Ed Loehr <eloehr@austin.rr.com> writes:
> > Can anyone tell me how to log the db user name and db name to the server
> > log?  Is this possible at present?
>
> Offhand I don't think that happens at the moment, but it does seem like
> it'd be a good idea to have a backend do an elog(DEBUG) at startup that
> mentions its database name and user name.  Assuming you have logging of
> timestamps/PIDs turned on, that would be enough to correlate later log
> messages with a user name.
in 7.1, I use:
log_connections = on
fsync = off
syslog_facility = LOCAL5
syslog_ident = pg-test
syslog=2
show_source_port = on

Which produces:

Dec  4 04:57:09 lerami pg-test[27458]: [1] DEBUG:  connection: host=[local] user=ler database=regression
Dec  4 04:57:11 lerami pg-test[27462]: [1] DEBUG:  connection: host=[local] user=ler database=regression

in the syslog.

So, I think it's there already.


>
> Comments anyone?
>
>             regards, tom lane
--
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: How To Log User Name + Database?
Next
From: Isaac
Date:
Subject: localization design for DB structures?