* Tom Lane <[EMAIL PROTECTED]> [001206 11:25]:
> Ed Loehr <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

Reply via email to