Saturday, January 3, 2009

LINUX SYSLOG

command cat /etc/syslog.conf

# 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

Example:

cat /var/log/boot.log

Jan 3 21:08:44 localhost network: Bringing up interface eth0: succeeded
Jan 3 21:09:50 localhost network: Bringing up interface ppp0: failed
Jan 3 21:09:54 localhost cups: cupsd startup succeeded
Jan 3 21:09:54 localhost sshd: succeeded
Jan 3 21:09:55 localhost xinetd: xinetd startup succeeded
Jan 3 21:09:55 localhost sendmail: sendmail startup succeeded
Jan 3 21:09:55 localhost sendmail: sm-client startup succeeded
Jan 3 21:09:56 localhost gpm: gpm startup succeeded
Jan 3 21:09:56 localhost crond: crond startup succeeded
Jan 3 21:09:56 localhost xfs: xfs startup succeeded

-----------------

Activating Changes to the syslog Configuration File

folow commands to restart service syslog

for the new version Fedora: service rsyslog restart

for the old version of Fedora: service syslog restart

for the version of Ubuntu / Debain systems: /etc/init.d/sysklogd restart

----------------

How to View New Log Entries as They Happen

New log we will see folow command: tail -f /var/log/boot.log, more /var/log/boot.log

----------------

No comments:

Post a Comment