Posted in Linux

讓 bind DNS 把 log 記錄分類

讓 bind DNS 把 log 記錄分類 Posted on 2012 年 09 月 29 日Leave a comment

在 /etc/named.conf 加入如下

logging {
 channel default-log { // 名稱定義
 file "/var/log/named/default.log" versions 20 size 50m; // 記錄檔、保留多少個 (default.log , default.0~19)、檔案最大 50mb就輪替
 severity info; // 什麼等級的程度才記錄
 print-severity yes; // 記錄程度
 print-time yes; // 記錄時間
 print-category yes; // 記錄類別名稱
 };
 channel query-log {
 file "/var/log/named/query.log" versions 20 size 50m;
 severity info;
 print-severity yes;
 print-time yes;
 print-category yes;
 };
 channel security-log {
 file "/var/log/named/security.log" versions 20 size 50m;
 severity info;
 print-severity yes;
 print-time yes;
 print-category yes;
 };
 channel other-log {
 file "/var/log/named/other.log" versions 20 size 50m;
 severity info;
 print-severity yes;
 print-time yes;
 print-category yes;
 };
 category default {default-log;}; // 定義類別記錄到那裡
 category queries { query-log;};
 category security { security-log;};
 category lame-servers { null; };
 category client { other-log;};
 category config { other-log;};
 category database { other-log;};
 category general { other-log;};
};

category 還有其它的,可參考 http://www.zytrax.com/books/dns/ch7/logging.html

severity 可參考 http://docstore.mik.ua/orelly/networking_2ndEd/dns/ch07_05.htm

critical
error
warning
notice
info
debug [level]
dynamic

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *