Chapter 11: Logging
Original slides from Dr. James Walden at Northern Kentucky University.
syslogd
daemon.
cat
,
grep
, head
, and tail
can parse them. vim
& less
can transparently read compressed files!
/var/log
/var/log/syslog
/var/adm
File | Program | Freq | Contents |
---|---|---|---|
acpid | acpid | - | power related events |
boot.log | rc scripts | monthly | system startup scripts |
cron | cron | weekly | cron execution and errors |
cups | CUPS | weekly | printing related messages |
dmesg | kernel | - | kernel message buffer |
faillog | login | weekly | unsuccessful login attempts |
/etc/httpd | httpd | daily | Apache HTTP server logs |
lastlog | login | - | last login time per user |
mail | mailers | weekly | mail facility messages |
File | Program | Freq | Contents |
---|---|---|---|
messages | various | weekly | main system log |
samba/* | smbd | weekly | Samba file sharing |
secure | sshd | monthly | private authorization messages |
sulog | su | - | successes and failures |
syslog | various | weekly | main system logfile |
warn | various | weekly | warning and error messages |
syslog
has three parts:
syslogd
: logging daemon and its config file /etc/syslog.conf
openlog
: library routines that submit messages to syslogd
logger
: user-level command to submit log entries from shell
/var/log/maillog
Facility | Programs that use it |
---|---|
auth | authorization commands |
cron | cron |
daemon | system daemons |
ftp | ftpd |
kern | kernel |
lpr | line printer spooling |
sendmail | |
syslog | syslogd |
user | user processes |
Level | Meaning |
---|---|
emerg | panic situations |
alert | urgent situations |
crit | critical conditions |
err | other error conditions |
warning | warning messages |
notice | might merit investigation |
info | information messages |
debug | for debugging only |
Action | Meaning |
---|---|
filename | append message to local file |
@ hostname | forward to syslogd on hostname |
@ ipaddress | forward to syslogd at ipaddress |
| fifoname | write to named pipe |
user₁,user₂,… | write to screens of listed users |
* | write to screens of all users |
# emergencies: tell everyone who is logged in *.emerg * # warnings: store them in message log *.warning /var/log/messages # kernel: store them in local log kern.info /var/log/kern.log # send to network logger auth.info @netloghost
/etc/logrotate.conf
that specifies
how to manage groups of logfiles:
/etc/logrotate.d/*
Modified: 2015-10-06T13:08 User: Guest Check: HTML CSSEdit History Source |
Apply to CSU |
Contact CSU |
Disclaimer |
Equal Opportunity Colorado State University, Fort Collins, CO 80523 USA © 2015 Colorado State University |