Andrew Dunstan wrote: > Bruce Momjian said: > > Andrew Dunstan wrote: > >> > >> 2 things. > >> > >> I submitted a patch for this 5 months ago, which is still waiting to > be merged (hope it hasn't bitrotted in the meantime): > >> > >> . Allow log lines to include session-level information, like database > and user > >> > >> If nobody is working on this I am prepared to look at it: > >> > >> . Allow logging of only data definition(DDL), or DDL and modification > statements > > > > Yes, sorry I haven't gotten back to that, and yes the DDL idea is a good > one. > > > > For the log idea, I think we need to get a way to merge all the > > per-line info into one setup, so pid, timestamp, user, etc would all be > configurable using your setup. > > > > I thought we had thrashed this out back in August. Certainly the only > thing I recall seeing after I submitted the patch was some stylistic > criticism from Neil, which I addressed in a revised patch. > > Anyway, it is in principle doable. That's partly why I adopted a printf > style format string. There are some wrinkles, though: > . interaction with syslog pid/timestamp logging
Yes. If you use syslog, just don't ask for pid/timestamp and let syslog do it. Of course, right now we are able to send non-pid/timestamp to syslog _and_ send pid/timestamp to a log file, but that seems like a rare operation that doesn't justify keeping the various log parameters separate. Also, I would like to see some kind of session identifier that is more unique than pid, which wraps around. Ideally we could have 10{pid}, then then the pid wraps around, 20{pid), or something like that. > . making sure the info is available when you need to log it - I had to > rearrange a few thing to avoid getting SEGVs, IIRC. Of course some messages, like postmaster status messages, don't have some of these fields, like username or host. Is that going to cause problems for tools that read our log files? > Also, the session duration logging part of the patch is orthogonal to the > issue. You mean query duration? Yes, it is orthoginal. -- Bruce Momjian | http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings