[bind10-dev] Logging of Individual Packets

Stephen Morris stephen at isc.org
Mon Jan 31 18:11:53 UTC 2011


On 28/01/2011 15:56, Jerry Scharf wrote:

> As I have been working on the MRD , the issue of debugging and logging
> is back in the forefront. As part of this, it really seems like there
> wants to be the ability to have different packets be processed with
> different amounts of logging. One case for this is for the digcc command
> to be able to collect much more detail that the standard traffic. A
> second case is where a problem is being seen on a busy server and you
> want more logging for some packets but not others.
> 
> There are two aspects to this from my perspective, that there needs to
> be the ability for the server have different logging "contexts" and that
> the server needs to be able to decide which context to use for a given
> query.

The logging code does have the idea of multiple contexts, so in practice
this should be _relatively_ easy.  If the query (presumably based on the
name being queried for) is identified as one that should be tracked, a
logger is created with a name based on the domain name and a pointer to
it held in the query context object  The code then logs trace-related
events to that logger.

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.

Perhaps the most complicated part of it is identifying the queries you
want to log and setting up per-query configuration options.

Stephen



More information about the bind10-dev mailing list