1.明白 channels 和 categories.
Channel:说明日志去往哪里,syslog,file,stderr,null.
五种日志等级(critical, error, warning, notice, and info)这五种类似于syslog。
还有其他两种(debug,dynamic)为BIND 8 和 9 所有.
Category:对日志的分类存放,如对查询的日志专门存放到一个文件(应先开启rndc querylog)
2.Logging 的语法如下
logging {
[ channel channel_name {
( file path_name
[ versions ( number | unlimited ) ]
[ size size_spec ]
| syslog ( kern | user | mail | daemon | auth | syslog | lpr |
news | uucp | cron | authpriv | ftp |
local0 | local1 | local2 | local3 |
local4 | local5 | local6 | local7 )
| stderr
| null );
[ severity ( critical | error | warning | notice |
info | debug [ level ] | dynamic ); ]
[ print-category yes or no; ]
[ print-severity yes or no; ]
[ print-time yes or no; ]
}; ]
[ category category_name {
channel_name; [ channel_name; … ]
}; ]
…
};
3.我的 logging 模板
logging {
channel default_debug {
file “data/named.run”;
severity dynamic;
};
channel my_syslog {
syslog daemon;
severity info;
};
category statistics { default_debug;my_syslog; };
category queries { default_debug; };
};
转载请注明:爱开源 » BIND 配置文件(named.conf) logging 的使用