Operating System - HP-UX
1837116 Members
2332 Online
110112 Solutions
New Discussion

Re: Channels, Locals in syslog

 
Ragni Singh
Super Advisor

Channels, Locals in syslog

hey everyone, can someone please explain how the channels locals0 -locals7 work please. I have set it up to where each individual logfile goes to a individual local. Can I have multiple logs go to one local. Any input will be greatly appreciated. Also let me know if you may need may information.
1 REPLY 1
jean-yves poch
Advisor

Re: Channels, Locals in syslog


local0-7 is a facility for administrator (i.a a script) or
for a soft, for logging informations.

notice, warning, crtical is used by OS.


1) configuring the syslog.conf

- create the log file with the command touch :
i.e : touch /var/adm/mylog.log

- add lines in /etc/syslog.conf
i.e :
cp /etc/syslog.conf /etc/syslog.conf.orig
echo "local3.err /var/adm/mylog.log" >> /etc/syslog.conf

- refresh the syslog daemon
kill -HUP `ps -ef | grep syslogd | grep -v grep | awk '{print $2}'`

(it's crazy, but that's cool for a copy&paste)

2) test the syslog

logger -p local3.err "I am today very nice"
or
logger -p local3.err -t LOCAL3 "I am today very nice"
verify with :
tail /var/adm/mylog.log

Jean-Yves
pitstop