我在BIND9服务器上configuration了日志logging,并且有两个日志文件:1)debug.log; 2)query.log。 第二个是好的。 目前没有投诉。 但是第一个对我来说太冗长(太唠叨)了。 就像在那里说的90%,我甚至不明白。 只有在几个小时内,你就可以得到几百个文本行。 太疯狂了! 这里是如何设置的:
channel debug_log { file "/var/log/named/debug.log"; severity debug 3;
如果我理解正确,为了减less冗长(chatty),我可以尝试debugging2或简单地debugging(其中默认为debugging1)。 对? 下一个级别(less聊)是:
severity info;
对?
PS这是我的完整日志logging部分:
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; };
};
作为参考点,如果您不通过named.conf指定任何自定义日志logging设置, 则默认值为:
logging { category default { default_syslog; default_debug; }; category unmatched { null; }; };
预定义的渠道是:
channel default_syslog { // send to syslog's daemon facility syslog daemon; // only send priority info and higher severity info; }; channel default_debug { // write to named.run in the working directory // Note: stderr is used instead of "named.run" if // the server is started with the '-f' option. file "named.run"; // log at the server's current debug level severity dynamic; }; channel default_stderr { // writes to stderr stderr; // only send priority info and higher severity info; }; channel null { // toss anything sent to this channel null; };
也就是说,如果您在configuration文件中没有触及日志logging设置,则会将严重性info到syslog中。
如果打开debugging日志logging( rndc trace ),它也会将当前的debugging级别logging到named的工作目录中的named.run文件中。
如果你想要的是默认的日志logging,通常会进入系统日志,但直接进入一个单独的文件, info将是严重性。
如果您没有debuggingnamed ,我没有看到任何理由loggingdebug严重性。 与您的典型操作故障排除相关的正常错误已使用默认设置logging下来。
对于debug ,您可以设置的最低值是1,这比2或更高版本的冗余更less。 当然,您也可以将debugging值设置为0,但这意味着您已禁用debugging。
你是正确的,debugging后的下一个级别或更less的唠叨的严重程度将是info ,其次是notice , warning , error和critical (只有重要的错误,因此less得多chatt)。
阅读本文档中的严重性部分
对于debug严重性,您也可以将其设置为dynamic ,这在您想要在testing阶段或故障排除期间进行更改时非常有用。 一旦设置为dynamic,使用rndc trace将值增加1,或使用rndc notrace将debugging值设置为0.您还可以使用`rndc跟踪级别控制debugging值。
使用dynamic严重性 –
ns1绑定#rndc状态 ... debugging级别:0 .. ns1绑定#rndc跟踪2 ns1绑定#rndc状态 ... debugging级别:2 ... ns1绑定#rndc跟踪0 ns1绑定#rndc状态 ... debugging级别:0 ...