Re: Feature request concerning postmaster log file.

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Feature request concerning postmaster log file.
Дата
Msg-id 47346EE9.2090407@dunslane.net
обсуждение исходный текст
Ответ на Re: Feature request concerning postmaster log file.  (David BOURIAUD <david.bouriaud@ac-rouen.fr>)
Список 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 hope that this answer will clarify my point of view.
>
>   

This would involve a lot of work, I suspect. It's doable but very far 
from simple. But you could use log_line_prefix to tag the lines and then 
pipe the log through a preprocessor. That would split them in real time 
without imposing the logic requirements on postgres.


cheers

andrew


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Feature request concerning postmaster log file.
Следующее
От: Greg Smith
Дата:
Сообщение: Re: Test lab