Re: Why does LOG have higher priority than ERROR and WARNING?

Lists: pgsql-hackers
From: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Why does LOG have higher priority than ERROR and WARNING?
Date: 2009-09-11 09:07:02
Message-ID: 20090911175340.E257.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

LOG messages have higher priority than ERROR and WARNING
in log_min_messages (PANIC > FATAL > LOG > ERROR > WARNING) now.
Can I reorder them to ERROR > WARNING > LOG ? It makes a difference
to "per-destination minimum message levels" feature that I working on.

LOG messages are often used for performance logging. On the other hand,
WARNING and ERROR messages report something bad. It should be no surprise
that users think ERRORs and WARNINGs are more important than LOGs.
So, I think we should allow users to set log_min_messages to report
only PANIC, FATAL, ERROR and WARNING messages in server logs.

Am I missing something?

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why does LOG have higher priority than ERROR and WARNING?
Date: 2009-09-11 14:08:32
Message-ID: 19783.1252678112@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> writes:
> LOG messages have higher priority than ERROR and WARNING
> in log_min_messages (PANIC > FATAL > LOG > ERROR > WARNING) now.
> Can I reorder them to ERROR > WARNING > LOG ?

No. That was an intentional decision. LOG is for stuff that we
really want to get logged, in most cases. ERROR is very often not
that interesting, and WARNING even more so.

regards, tom lane


From: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why does LOG have higher priority than ERROR and WARNING?
Date: 2009-09-14 00:16:01
Message-ID: 20090914090133.E159.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> writes:
> > Can I reorder them to ERROR > WARNING > LOG ?
>
> No. That was an intentional decision. LOG is for stuff that we
> really want to get logged, in most cases. ERROR is very often not
> that interesting, and WARNING even more so.

I think the decision is in hacker's viewpoint. Many times I see
DBAs are interested in only WARNING, ERROR and FATAL, but often
ignores LOG messages. We should use WARNING level for really important
message -- and also priority of WARNINGs should be higher than LOGs.

Another matter is that we use LOG level both cases of important
activity logging and mere performance or query logging. Maybe
we should have used another log level (PERFORMANCE?) for the
latter case, and its priority is less than WARNINGs and LOGs.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why does LOG have higher priority than ERROR and WARNING?
Date: 2009-09-14 05:57:29
Message-ID: 1252907849.30236.2.camel@fsopti579.F-Secure.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, 2009-09-14 at 09:16 +0900, Itagaki Takahiro wrote:
> Another matter is that we use LOG level both cases of important
> activity logging and mere performance or query logging. Maybe
> we should have used another log level (PERFORMANCE?) for the
> latter case, and its priority is less than WARNINGs and LOGs.

Ideally, LOG messages are messages that you explicitly requested using
various log_* parameters. If you need more control, we could
conceivably add more of those.


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why does LOG have higher priority than ERROR and WARNING?
Date: 2009-09-14 08:50:06
Message-ID: 9837222c0909140150j6a5f53a7o47718f5eb3c96569@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Sep 14, 2009 at 02:16, Itagaki Takahiro
<itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:
>
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> writes:
>> > Can I reorder them to ERROR > WARNING > LOG ?
>>
>> No.  That was an intentional decision.  LOG is for stuff that we
>> really want to get logged, in most cases.  ERROR is very often not
>> that interesting, and WARNING even more so.
>
> I think the decision is in hacker's viewpoint. Many times I see
> DBAs are interested in only WARNING, ERROR and FATAL, but often
> ignores LOG messages. We should use WARNING level for really important
> message -- and also priority of WARNINGs should be higher than LOGs.
>
> Another matter is that we use LOG level both cases of important
> activity logging and mere performance or query logging. Maybe
> we should have used another log level (PERFORMANCE?) for the
> latter case, and its priority is less than WARNINGs and LOGs.

I think the requirement you're talking about is the same one I was
when I said I wanted a "logging source" thing. Which is basically that
an ERROR log from a user query or stored procedure is often not
interesting at all to the DBA - but it is to the developer. But an
ERROR log from the background writer or a low-level routine is *very*
interesting to the DBA. Basically, the log levels mean completely
different things depending on where they're coming in from.

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