Re: [GENERAL] How To Log User Name + Database?

2000-12-06 Thread Larry Rosenman

* 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



Re: [GENERAL] How To Log User Name + Database?

2000-12-06 Thread Tom Lane

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.

Comments anyone?

regards, tom lane



[GENERAL] How To Log User Name + Database?

2000-12-06 Thread Ed Loehr

Can anyone tell me how to log the db user name and db name to the server
log?  Is this possible at present?  Couldn't find anything about it in
the docs or deja...

Regards,
Ed Loehr