Re: Custom timestamp format in logs
От
Michael Paquier
Тема
Re: Custom timestamp format in logs
Дата
Msg-id
CAB7nPqSJVCceTi2F+CyOB9dKKY1fkA3eVGgmHmhH_mrpCTq5Ug@mail.gmail.com
Ответ на
Re: Custom timestamp format in logs (Magnus Hagander)
Список
Дерево обсуждения
Custom timestamp format in logs Michael Paquier <michael.paquier@gmail.com>
Re: Custom timestamp format in logs Magnus Hagander <magnus@hagander.net>
Re: Custom timestamp format in logs Tom Lane <tgl@sss.pgh.pa.us>
Re: Custom timestamp format in logs Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Custom timestamp format in logs Tom Lane <tgl@sss.pgh.pa.us>
Re: Custom timestamp format in logs Michael Paquier <michael.paquier@gmail.com>
Re: Custom timestamp format in logs Heikki Linnakangas <hlinnakangas@vmware.com>
Re: Custom timestamp format in logs Michael Paquier <michael.paquier@gmail.com>
On Mon, Dec 15, 2014 at 1:36 AM, Magnus Hagander wrote: > On Sat, Dec 13, 2014 at 3:50 PM, Michael Paquier > wrote: >> >> Hi all, >> >> This week, we heard about a user willing to use a custom timestamp >> format across a set of services to improve the debugability of the >> whole set, Postgres being one of them. Unfortunately datestyle does >> not take into account the logs. Would it be worth adding a new GUC >> able to control the timestamp format in the logs? >> >> We could still redirect the logs with syslog and have a custom >> timestamp format there, but in the case of this particular user syslog >> was a no-go. Looking at the code, timestamp format is now hardcoded in >> setup_formatted_log_time and setup_formatted_start_time when calling >> pg_strftime @ elog.c, so it doesn't seem to be much complicated to do. >> >> Opinions? This thread is here for that. > > > A separate GUC seems kind of weird. Check. > Wouldn't it be better with something like %(format)t or such in the log_line_prefix itself in that case? > That could also be expanded to other parameters, should we need them? Possible. I am not sure if we will be able to have a new parameter in log_line_prefix as modulable as timestamps for formatting though. -- Michael
В списке pgsql-hackers по дате отправления