Re: How To Log User Name + Database?

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: pggeneral <pgsql-general(at)postgresql(dot)org>
Subject: Re: How To Log User Name + Database?
Date: 2000-12-06 17:30:50
Message-ID: 20001206113050.A13539@lerami.lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> [001206 11:25]:
> Ed Loehr <eloehr(at)austin(dot)rr(dot)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(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Darrin Ladd 2000-12-06 17:35:16 Trigger Problems?
Previous Message Lamar Owen 2000-12-06 17:29:59 Re: How To Log User Name + Database?