Re: Feature request concerning postmaster log file.

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: David BOURIAUD <david(dot)bouriaud(at)ac-rouen(dot)fr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Feature request concerning postmaster log file.
Date: 2007-11-09 14:17:25
Message-ID: 47346BF5.9070204@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David BOURIAUD wrote:
> Le vendredi 9 novembre 2007, vous avez écrit :
>> David BOURIAUD wrote:
>>> if the run-time option is chosen, any message issued by any command, from
>>> connexion to all sql commands launched in any way by a user should go in
>>> a separate log file, that could be named log.username for example.
>> You can enable logging user name into postgres log and grep or some
>> other text utility help you to generate required log file.
>>
> Thanks Zdenek for your answer.
> I know what you answered me, but in certain cases, using a text utility like
> grep is not suitable. I think of this when you get a many hundreds of Mo
> logfile at least, or when you need to track commands made by one peculiar
> user in real-time.
> That's why I thought that having a possibility to specify how log file(s)
> should be handled by postmaster could be of great help.
> I suggested an option to have one file per user, but one could think of having
> one file per IP address connected to the server, and so on. The way samba log
> files can be handled could be a good starting point, but I must admit that I
> don't have the programming skills required to code any patch...

I don't think we need to make our logging more clever than it already
is, when there's plenty of existing software out there to do
post-processing like that. For example, you could direct your logs to
syslog, and let it handle it. I don't think the stock syslogd can do it,
but for example with syslog-ng you could split logs based on regexp on
the message content, like the username.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-11-09 14:30:01 Re: Feature request concerning postmaster log file.
Previous Message David BOURIAUD 2007-11-09 14:03:40 Re: Feature request concerning postmaster log file.