[bind10-dev] Logging of Individual Packets
Stephen Morris
stephen at isc.org
Wed Apr 6 11:38:00 UTC 2011
On 03/04/2011 16:28, Danny Mayer wrote:
> On 1/31/2011 1:11 PM, Stephen Morris wrote:
>> For example, if we identify that queries to www.example.com should be
>> tracked, we create a logger called (e.g. "trace.com.example.www") and
>> add a pointer to it in the query structure. By making the logger a
>> sub-logger of some known component (in this case, "trace") we can set
>> default options for the logging of query tracing.
>
> Out of curiosity why would you not create a logger called
> com.example.www.trace? It would be much more consistent.
Owing to the hierarchy of the loggers. The loggers further up the
hierarchy are placed on the left of the logger name. So this logger is
a descendent of a logger called "trace" and, unless any specific options
are applied to it, it will inherit characteristics (such as what level
to log and where to log the information) from that one.
The idea of using a separate logger for each query being traced was to
give the ability to override the default configuration on a per-query
basis, e.g. to route the trace information for each domain name to a
separate file.
However, as suggested, using the name of the domain in the logger name
introduces additional elements in the logger hierarchy (the hierarchy is
defined by the name, with levels being separated by periods). A
side-effect of that idea would be to allow (for example) the routing of
output from all names being traced in .com to one file and everything
else to another file. This may not be necessary and it would be
entirely possible (and perhaps have less overhead) for some flatter
naming scheme to be used.
Stephen
More information about the bind10-dev
mailing list