Re: How To Log User Name + Database?
От | Larry Rosenman |
---|---|
Тема | Re: How To Log User Name + Database? |
Дата | |
Msg-id | 20001206113050.A13539@lerami.lerctr.org обсуждение исходный текст |
Ответ на | Re: How To Log User Name + Database? (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: How To Log User Name + Database?
|
Список | 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 по дате отправления: