{"id":48,"date":"2008-07-25T18:35:34","date_gmt":"2008-07-25T18:35:34","guid":{"rendered":"https:\/\/fir3netwp.gmsrrpobkbd.com\/2008\/07\/25\/syslog-quick-guide\/"},"modified":"2021-07-31T16:07:22","modified_gmt":"2021-07-31T16:07:22","slug":"syslog-quick-guide","status":"publish","type":"post","link":"https:\/\/www.fir3net.com\/UNIX\/General\/syslog-quick-guide.html","title":{"rendered":"UNIX – Syslog – Quick Guide"},"content":{"rendered":"

Here’s a quick overview of Syslog, there’s much more to it and you can find tons more information in the links at the bottom of the page.<\/p>\n

Syslog stands for the Sys<\/strong>tem Log<\/strong> protocol. It allows for the sending and receiving of event messages and alerts across an IP network. Operating on either UDP or TCP on port 514, logs\/events are sent to the syslog server\/daemon, from the syslog client.<\/p>\n

In order to configure the Syslog server you will need to configure the \/etc\/syslog.conf in order to tell the daemon what to do with the logs, i.e display it to the terminal, write it to a file etc etc.<\/p>\n

With in the file there are 2 columns, the first being the log message received and the second being the action to take. Keeping in mind that you need to tab the space in between otherwise “she just wont work captain”<\/p>\n

#\u00a0 \/etc\/syslog.conf\u00a0\u00a0\u00a0\u00a0 Configuration file for syslogd.\r\n #\r\n #\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 For more information see syslog.conf(5)\r\n #\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 manpage.<\/pre>\n

#
\n# First some standard logfiles.\u00a0 Log by facility.<\/p>\n

auth,authpriv.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/var\/log\/auth.log
\nlocal4.*;local2.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -\/var\/log\/syslog
\nnews.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/var\/log\/news\/news.log
\ncron.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/var\/log\/cron.log
\ndaemon.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -\/var\/log\/daemon.log
\nkern.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -\/var\/log\/kern.log
\nlpr.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -\/var\/log\/lpr.log
\nmail.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -\/var\/log\/mail.log
\nuser.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -\/var\/log\/user.log
\nuucp.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/var\/log\/uucp.log
\nlocal2.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/var\/log\/local2.log
\nlocal4.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/var\/log\/local4.log<\/p>\n

# Logs all but locals to \/var\/log\/messages
\n*.*;local2,local4.none\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/var\/log\/messages<\/p>\n

# Emergencies are sent to everybody logged in.
\n*.emerg\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 *<\/p>\n

This conf file allows be to have local4 and local2 go through to their own log files along with being copied to one log file.<\/p>\n

There’s also some combos you can use,<\/p>\n