[Pdns-users] Error prio events with loglevel 2
Otto Moerbeek
otto at drijf.net
Sat Sep 16 15:51:21 UTC 2023
On Sat, Sep 16, 2023 at 05:40:42PM +0200, Otto Moerbeek via Pdns-users wrote:
> On Sat, Sep 16, 2023 at 05:19:01PM +0200, Otto Moerbeek via Pdns-users wrote:
>
> > On Sat, Sep 16, 2023 at 12:04:16PM +0200, Christoph via Pdns-users wrote:
> >
> > > Hello,
> > >
> > > we changed our recursor loglevel from 3 to 2 with the intention to avoid
> > > logging these events because they contain qnames:
> > >
> > > msg="qtype unsupported" error="Cannot push task" subsystem="taskq" level="0"
> > > prio="Error" tid="6" ts="..." name="..." netmask="" qtype="TYPE65535"
> > >
> > > but these events are still in the logs after the config change and a service
> > > restart.
> > >
> > > Are these expected log entries with loglevel 2?
> >
> > This is a bit confusing. The determining thing is prio. That name
> > derives from the name as used in the syslog man page, e.g.
> > https://www.man7.org/linux/man-pages/man3/syslog.3.html
> >
> > It's a hystorical accident that this is called Loglevel in in the
> > settings file.
>
> But to answer your question better, it *is* surprising. leglevel=2 should
> exclude pro=Error, as Error corresponds to prio 3.
The explanation can be found in rec-main:
if (s_logUrgency < Logger::Error) {
s_logUrgency = Logger::Error;
}
if (!g_quiet && s_logUrgency < Logger::Info) { // Logger::Info=6, Logger::Debug=7
s_logUrgency = Logger::Info; // if you do --quiet=no, you need
Info to also see the query log
}
g_log.setLoglevel(s_logUrgency);
g_log.toConsole(s_logUrgency);
This means that in these two cases s_logUrgency gets overridden, so
the efective loglevel is different from what you expect.
Apart from re-evaluating this, we might ponder a structured logging
backend that filters out privacy sensitive information, independent of
log/prio considerations. e.g. that would never print values of keys
"qname" (and a few more). But this all something of a somewhat vague
idea.
-Otto
More information about the Pdns-users
mailing list