×

BIND 配置文件(named.conf) logging 的使用

hqy hqy 发表于2020-06-02 19:14:21 浏览2439 评论0

抢沙发发表评论



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; };
};


打赏

本文链接:https://www.kinber.cn/post/1329.html 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

 您阅读本篇文章共花了: 

群贤毕至

访客