Bind logging

Roy Arends Roy.Arends at nominum.com
Tue May 8 11:12:03 UTC 2001


On Tue, 8 May 2001, firstleft wrote:

> Hi all-
> 
> As it stands named logs all messages to /var/log/messages.  I would like to
> have named log to it's own file, for example var/log/named.log, I know it's
> an issue of modifying the logging statement in named.conf, but I am still
> trying to get the whole channels/categories thing worked out in my head, and
> am having trouble deciphering the syntax of things, so any help would be
> much appreciated.
> 
> Thanks
> -ben thielsen

Its not so difficult:

Messages can be of different categories and levels, for instance, a
started server will log a message similar like "server started", this an
informational level of a specific category. You can configure BIND to
channel (or filter) specific categories in their own way. You can specify
the filter (or channel) and the category. Lets say you want to log all
queries to a file called "querydumpfile".

first a channel (or filter):
 
 channel query_dump {          // pick any name you want, be creative :-)
    file "querydumpfile";      // pretty straightforward
    severity info;             // the default.
    }

Now lets associate the channel to a category. There is a special category
for query messages, its called: category queries:
  
  category queries { query_dump; } // dump all messages from category
                                   // queries through the query_dump
				   // channel

These two specifications (channel & category) need to be in a logging
statement:

  logging {
    channel query_dump {
      file "querydumpfile";
      severity info;
      };
    category queries { 
      query_dump; 
      };
  };

There you go. In general you associate specific categories with specific
channels.

To answer your question, there is a category default, which is associated
with all categories (as a last resort). So what you do is channel all
messages of category default to your own specified file. Bind uses the
predifined channel default_syslog which logs any informational level
messages to the syslog daemon. You can't alter the channel, but you can
associate the default category to your own channel

Regards,

Roy Arends
Nominum



More information about the bind-users mailing list