Re: syslog_line_prefix

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: syslog_line_prefix
Date: 2009-09-14 08:53:40
Message-ID: 9837222c0909140153v4cf21691p7d639059c161b241@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 14, 2009 at 02:43, Itagaki Takahiro
<itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:
> Here is a patch to add a GUC parameter "syslog_line_prefix".
> It adds prefixes to syslog and eventlog. We still have
> "log_line_prefix", that will be used only for stderr logs.
>
> We have a tip that log_line_prefix is not required for syslog
> in the documentation, but we'd better to have independent setttings
> if we set log_destination to 'stderr, syslog'.
>
> http://developer.postgresql.org/pgdocs/postgres/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT
> | Tip:  Syslog produces its own time stamp and process ID
> | information, so you probably do not want to use those escapes
> | if you are logging to syslog.

I'm not sure I like this as a GUC. We're going to end up with a lot of
different GUCs, and everytime we add a new log destination (admittedly
not often, of course), that increases even further. And GUCs really
don't provide the level of flexibility you'd really like to have. I've
been thinking (long-term) in the direction of a separate config file,
since that could contain an arbitrary number of lines, with "rules" on
them (somewhat like pg_hba.conf maybe). You'd do the matching on
things like error level and destination, and then specify a bunch of
flags. Or potentially do it on error level and contents, and filtering
which destinations get it.

Forcing it into the guc framework seems like a limiting long-term strategy.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2009-09-14 09:07:53 Re: opportunistic tuple freezing
Previous Message Magnus Hagander 2009-09-14 08:50:06 Re: Why does LOG have higher priority than ERROR and WARNING?