Difference between revisions of "Syslog - log events & errors from a remote device"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m
Line 56: Line 56:
  
 
More info - for fine tuning etc can be found [http://www.freebsddiary.org/syslogconf.php here] and [http://www.freebsd.org/cgi/man.cgi?query=syslog.conf&apropos=0&sektion=0&manpath=FreeBSD+3.1-RELEASE&format=html here]
 
More info - for fine tuning etc can be found [http://www.freebsddiary.org/syslogconf.php here] and [http://www.freebsd.org/cgi/man.cgi?query=syslog.conf&apropos=0&sektion=0&manpath=FreeBSD+3.1-RELEASE&format=html here]
 +
 +
 +
[[Category:General]]
 +
[[Category:Howto]]

Revision as of 07:38, 6 July 2006

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