Tom Lane wrote:
>
> 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.
>
> Comments anyone?
That'd be an improvement. Considering the case where you have many users
and many dbs, with log lines co-mingled. Would it be better to
(optionally) allow the db name and user name to be logged on each line?
That way, you wouldn't have to do the visual correlation with a line
possibly tens or hundreds of lines earlier in the log. It might also
simplify log processing scripts a bit.
Regards,
Ed Loehr