naobe @ ウィキ
syslog
最終更新:
Bot(ページ名リンク)
-
view
Unix/Linuxにもどる
syslog.conf
selectorフィールドとactionフィールドから成る。selectorフィールドとactionフィールドの間は、1つ以上のスペースか、TABで区切られる。
selectorフィールドは、facilityとpriorityからなる。facilityとpriorityは、'.'で結合する。
"*"は全てを表す。
セミコロン";"を使うと、複数のセレクタに対して、1つのアクションを適用する。ただし、後続するセレクタがselect動作を上書きする。
selectorフィールドは、facilityとpriorityからなる。facilityとpriorityは、'.'で結合する。
"*"は全てを表す。
セミコロン";"を使うと、複数のセレクタに対して、1つのアクションを適用する。ただし、後続するセレクタがselect動作を上書きする。
【設定形式】
facility.priority action
~~~~~~~~~~~~~~~~~
selector
facility.priority action
~~~~~~~~~~~~~~~~~
selector
faclity
サブシステムを表す
項目 | 説明 |
---|---|
auth | |
authpriv | |
cron | |
daemon | |
kern | |
lpr | |
mark | アプリケーションでは使用すべきではない。 |
news | |
security | authと同じ。利用するべきではない。 |
syslog | |
user | |
uucp | |
local0~local7 |
priority
メッセージの重要性を表す。以下の昇順。
debug, info, notice, warning,warn ( warning と同じ), err, error (err と同じ), crit, alert, emerg, panic (emergと同じ)設定したpriority以上のプライオリティのメッセージをファイルに出力する。
noneを指定すると、与えられたfacilityのログを出力しない。
先頭に"="を書くと、指定したプライオリティに限定する
先頭に"!"を書くと、否定表現になる。
debug, info, notice, warning,warn ( warning と同じ), err, error (err と同じ), crit, alert, emerg, panic (emergと同じ)設定したpriority以上のプライオリティのメッセージをファイルに出力する。
noneを指定すると、与えられたfacilityのログを出力しない。
先頭に"="を書くと、指定したプライオリティに限定する
先頭に"!"を書くと、否定表現になる。
action
- 先頭に"/"を書くと出力ログファイルのフルパスを表す
- 先頭に"|"を書くと名前つきパイプへ転送する
- 先頭に@を書くと、リモートホストへ転送する
- 先頭に"-"を書くとシステムバッファのフラッシュ動作を抑制する
- 全てのユーザに出力するときは"*"を設定する
- コンマで区切って複数のユーザ名を設定する
【設定例】
# Log all kernel messages to the console. # Logging much else clutters up the screen. #kern.* /dev/console # Log anything (except mail) of level info or higher. # Don't log private authentication messages! # # iptablesのログ出力を出力しないようにkernel.info以上はログ出力しない *.info;kern.!info;mail.none;authpriv.none;cron.none /var/log/messages # The authpriv file has restricted access. authpriv.* /var/log/secure # Log all the mail messages in one place. mail.* -/var/log/maillog # Log cron stuff cron.* /var/log/cron # Everybody gets emergency messages *.emerg * # Save news errors of level crit and higher in a special file. uucp,news.crit /var/log/spooler # Save boot messages also to boot.log local7.* # iptables etc. # # iptablesのログ出力を別ファイルに出力する kern.*;kern.!notice /var/log/kernelinfo