[bind10-dev] Enabling/disabling logging on per-message basis
Stephen Morris
stephen at isc.org
Thu Mar 1 17:30:08 UTC 2012
On 01/03/2012 09:33, Michal 'vorner' Vaner wrote:
>
> Maybe enabling/disabling is not the right word. But I want to be
> able to override the logging level for some messages, like say I
> want INFO with the exception of this debug message, which should be
> logged as well. As I said, I believed this would be almost for
> free, at least when no overrides are configured (and some log n
> would be paid for n overridden messages). But if you think this
> would involve too much overhead, I think doing an experiment and
> measuring how much it slows things down would be a really easy
> task.
I think the main question here is why you would want to log only one
debug message?
The current setup is that each message is generated by a single module
and logged at a particular level. It is possible to set the logging
levels for each module independently of one another, so (for example)
have the entire system log messages at INFO and above, with the
exception of the cache code, for which debug messages at level 30 or
below are also logged.
So we can already get a fairly fine level of granularity and isolate
the logging to groups of related messages.
If it is felt that this is not enough and that there are cases where a
specific message (or messages) needs to be logged, then we ought to
look at the code and see how the messages are grouped. I gave the
example of messages generated by the RRset cache: at present these are
generated by a logger named "cache". But it is perfectly possible to
have multiple loggers in this module (e.g. "message_cache",
"rrset_cache" and "resolver_cache"), and to have the messages related
to different parts of the code logged by the appropriate logger.
I'm not completely against this proposal. But at present I don't
think there is a definite need; and even if there were, it is
something that could be handled by the existing code.
Stephen
More information about the bind10-dev
mailing list