Syslog - log events & errors from a remote device

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 20:44, 30 June 2006 by Ramuk (Talk | contribs)

Jump to: navigation, search

This article Originally by stevemac. at Linkstationwiki.org

Contents

Setup syslog for remote logging

OK, this is not so advanced, but thought it might be useful to someone.

I just got a new router & it has the ability to log events & errors on a remote syslog.

So I poked around & got my LS to log the routers events; here's what I did.


Edit /etc/syslog.conf

Tell syslog to save local1 events to /var/log/local1.log. local1 is the facility at which my router outputs, your device might be level0 through to level7

Edit /etc/syslog.conf | Use TAB not spaces between WHAT_TO_LOG and WHERE_TO_LOG:

----------------------- /etc/syslog.conf ----------------------- 
local1.*					/var/log/router.log
*.info;cron.none;user.none;local1.none	/var/log/messages
cron.*					/var/log/cron
user.info					/var/log/linkstation.log
*.emerg					*
---------------------------------------------------------------- 


Edit /etc/init.d/syslog | Only change the part SYSLOGD="-m 0"

Edit /etc/init.d/syslog.

So that syslog starts with -r remote loging switched on when the Linkstation is rebooted

----------------------- /etc/init.d/syslog --------------------- 
... 
... 
SYSLOGD="-r -m 0" 
... 
... 
---------------------------------------------------------------- 


Restart syslog.

root@LINKSTATION:/etc/init.d# ./syslog restart 

Job done, now all local1 events go to the file /var/log/router.log


More info - for fine tuning etc...

More info - for fine tuning etc can be found here and here