LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-01-2015, 09:23 AM   #1
grigory
Member
 
Registered: Oct 2015
Posts: 133

Rep: Reputation: Disabled
BIND9 logging gets too verbose (too chatty) for my taste


Hello!

I've configured logging in my BIND9 server and I have 2 log files:
1) debug.log;
2) query.log.
The second one is Okay. No complaints so far. But the first one is too verbose (too chatty) for me. Like 90% of what it says there I don't even understand. You get like 100's of thousands of text lines within couple of hours only. That's crazy!
Here how it's set:

Code:
 channel debug_log {
         file "/var/log/named/debug.log";
        severity debug 3;
If I understand it right, to make it less verbose (chatty), I can try debug 2 or simply debug (which defaults to debug 1). Right?
The next level (less chatty) would be:

Code:
severity info;
Right?
 
Old 11-01-2015, 12:56 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
If I understand it right, to make it less verbose (chatty), I can try debug 2 or simply debug (which defaults to debug 1). Right?
The next level (less chatty) would be:

severity info;
You could use severity "warning" or "notice", that are less verbose.
Besides debug is used for debugging purposes, so it's not recommended for a production dns server

Regards
 
Old 11-01-2015, 10:51 PM   #3
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
Thanks for your reply!

I don't know... After I switched to info, both logs stopped doing anything (they're both empty).

Here's my full logging section:

Quote:
logging {

channel debug_log {
file "/var/log/named/debug.log";
severity info;
print-category yes;
print-severity yes;
print-time yes;
};

channel query_log {
file "/var/log/named/query.log";
severity dynamic;
print-category yes;
print-severity yes;
print-time yes;
};

category resolver { debug_log; };
category security { debug_log; };
category queries { query_log; };

};

Last edited by grigory; 11-01-2015 at 11:15 PM.
 
Old 11-01-2015, 11:22 PM   #4
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
Sorry, had to re-start BIND. Now my second file gets the info (query.log), but debug.log is still empty.


Has switched debug.log to notice, still no difference. query.log is getting the info, but debug.log is still empty. Looks like it needs to be done differently...

Last edited by grigory; 11-01-2015 at 11:32 PM.
 
Old 11-02-2015, 02:38 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by grigory View Post
Sorry, had to re-start BIND. Now my second file gets the info (query.log), but debug.log is still empty.


Has switched debug.log to notice, still no difference. query.log is getting the info, but debug.log is still empty. Looks like it needs to be done differently...
If the logfile remains blank that means that everything works as expected
If you want, you can turn severity to info (the default), so you get some logs.
Read this for more info

Regards
 
Old 11-02-2015, 04:39 AM   #6
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
Thanks for your reply!
Frankly, it needs some clarification for me. Otherwise, I don't quite understand.
Are you saying that in my debug.log I won't get any info if all works right? But that's when I use info level or less. When I had severity level debug 3, I got too much info being added into the log file. Again, right now I'm talking about my 1st log file (debug.log). As per 2nd log file (query.log), it gets "populated" without any issues, no matter what.
Is it Okay to have two different levels of severity at the same time for my two log files OR I'd better stick to just one?
Does it make any difference?
 
Old 11-02-2015, 07:16 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Are you saying that in my debug.log I won't get any info if all works right?
Yes. If you're using severity notice and above, you'll get no logs, unless something goes terribly wrong.


Quote:
When I had severity level debug 3, I got too much info being added into the log file. Again, right now I'm talking about my 1st log file (debug.log). As per 2nd log file (query.log), it gets "populated" without any issues, no matter what.
Debug and its various levels is used when you're having dns problems. In a normal dns operation you don't need debug.
The default severity info is good in most cases.


Quote:
Is it Okay to have two different levels of severity at the same time for my two log files OR I'd better stick to just one?
Does it make any difference?
These are 2 different logs. One regarding the dns operation and the other regarding client queries.
In a production server with a modest traffic, you don't even need to log the queries, as it makes the respective logfile getting big very fast. That's why the queries category is not enabled by default in bind logging.
So it's up to you what you want to log and how to do this.

BTW you can use rndc to change the logging setting at run-time.
 
Old 11-02-2015, 08:05 AM   #8
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
Thank you!

Well, I should probably learn some more about BIND9 logging, 'cos it seems to me a little bit more complicated than it should've been.
And what about just temporarily commenting out just the debug.log section? Should I use # for that?
 
Old 11-02-2015, 08:43 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by grigory View Post
Thank you!

Well, I should probably learn some more about BIND9 logging, 'cos it seems to me a little bit more complicated than it should've been.
And what about just temporarily commenting out just the debug.log section? Should I use # for that?
You should also comment out:
Quote:
category resolver { debug_log; };
category security { debug_log; };
or use another logging channel.
 
Old 11-02-2015, 10:47 AM   #10
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
Some update:
I have severity level "notice" for debug.log
After I turned on my PC, there's something new that was added to the file:

02-Nov-2015 19:16:01.684 security: warning: using built-in root key for view _default

And query.log works as usual. Does it mean that both files are getting the info that they should be getting under the conditions set in named.conf.local? Should I just leave it alone for now and IF there're problems with BIND, then I could escalate the severity level to debug 3 for debugging purposes?
 
Old 11-02-2015, 12:16 PM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
have severity level "notice" for debug.log
After I turned on my PC, there's something new that was added to the file:

02-Nov-2015 19:16:01.684 security: warning: using built-in root key for view _default
From the log snippet above, I see that you use severity warningand not severity notice. Not a big deal, but note that's less verbose than notice.


Quote:
And query.log works as usual. Does it mean that both files are getting the info that they should be getting under the conditions set in named.conf.local?
Yup


Quote:
Should I just leave it alone for now and IF there're problems with BIND, then I could escalate the severity level to debug 3 for debugging purposes?
As I've already told you, turn on debugging only if you have problems that are not logged with the current setting.
 
Old 11-02-2015, 07:26 PM   #12
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
Thanks for your reply!

How could it be that I'm using severity level "warning", when my debug.log is set to "notice" and query.log to "dynamic"?

Can I make it this way?

Quote:
category default { debug_log; };
category queries { query_log; };
So BIND would log everything except the queries which would go to query.log?

OR... I could do this?

Quote:
logging {

#channel debug_log {
# file "/var/log/named/debug.log";
# severity debug 3;
# print-category yes;
#print-severity yes;
# print-time yes;
# };

channel query_log {
file "/var/log/named/query.log";
severity dynamic;
print-category yes;
print-severity yes;
print-time yes;
};

#category resolver { debug_log; };
#category security { debug_log; };
category queries { query_log; };

};
And then uncomment the appropriate lines if needed for debugging purposes...?

Last edited by grigory; 11-02-2015 at 08:24 PM.
 
Old 11-02-2015, 09:04 PM   #13
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
P.S. In my example above " 02-Nov-2015 19:16:01.684 security: warning: using built-in root key for view _default" I just happened to extract the line which corresponded to a LOWER LEVEL than the current that was set at a time. Bad example.
 
Old 11-03-2015, 02:19 AM   #14
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Yes you can have debug stuff commented out and uncomment it when needed
Or you can set the debug level to 0 at a first place and use
Code:
rndc trace X
to start using debug at level X
 
Old 11-03-2015, 03:58 AM   #15
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
Thank you!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Logging in BIND9 dns server Upendra Pratap Singh Linux - Server 1 03-10-2015 11:17 AM
How to enable more verbose logging for Centos 5/RHCS cman and openais? innajl Linux - Server 1 02-18-2011 10:17 AM
BIND9 non logging ddaas Linux - Server 5 12-21-2010 02:12 PM
caching only named is very chatty setiDude Linux - Networking 1 01-03-2005 04:44 PM
Verbose vsFTP Logging?? (eek!) BSCItech Linux - Networking 6 08-26-2004 09:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration