syslogd可以负责记录系统运作中,
kernel或应用程式产生的各种讯息。这些讯息被写入到系统的纪录档中,让管理人员,进行故障排除、追踪尝试非法入侵的使用者、进行使用者的分析等等。
运作方式
kernel
kernel产生的讯息交由
klogd处理,klogd再交由syslogd处理。
应用程式
应用程式产生的讯息,可以在应用程式的设定档中,改变设定参数,以决定要将应用程式产生的讯息交由syslogd处理,或是由应用程式自行处理。
运作方式设定
有二个设定档
# Options to syslogd
# -m 0 disables 'MARK' messages.
# -r enables logging from remote machines
# -x disables DNS lookups on messages recieved with -r
# See syslogd(8) for more details
# Options to klogd
# -2 prints all kernel oops messages twice; once for klogd to decode, and
# once for processing with 'ksymoops'
# -x disables all klogd processing of oops messages entirely
# See klogd(8) for more details
#
SYSLOG_UMASK=077
# set this to a umask value to use for all log files as in umask(1).
/etc/syslog.conf
# 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!
*.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.* /var/log/boot.log
设定档格式
(/etc/syslog.conf的设定档格式)
应用程式类型.记录等级 储存位置
应用程式类型
auth
authpriv
cron
daemon
kern
lpr
mail
mark
news
security(即auth)
syslog
user
uucp
local0~local7(使用者自订类型)
*(所有的类型)
记录等级(紧急程度,往下递增,愈往下,记录的资讯愈少)
debug
info
notice
warning
warn(即warning)
err
error(即err)
crit
alert
emerg
panic(即emerg)
none(全不记录)
储存位置