Syslog

1,148 views

Published on

Published in: Technology
  • Be the first to comment

Syslog

  1. 1. Syslogagain4you@gmail.com<br />
  2. 2. Syslog<br />Standardfor logging program messages<br />Generating log from both kernel and app<br />Storing log into files, named pipes, remote hosts and specific users<br />Both of them<br />printk/klog for kernel event<br />syslogd for app event<br />
  3. 3. Syslog usage<br />Java App 1<br />Java App 2<br />Music<br />Video Player<br />Multimedia FW<br />JVM<br />Kernel<br />- Critical Message<br />- Warning<br />- Information<br />- *(Everything)<br />- Critical Message<br />- Warning<br />- Information<br />
  4. 4. Syslog configuration<br />Syslogd default conf file<br />/etc/syslog.conf<br />Selector + Action<br />Sector: Facility + Priority<br />Action: Write destination<br />
  5. 5. Syslog configuration – con’d<br />Priority (/usr/include/sys/syslog.h)<br />emerg<br />alert<br />crit<br />err<br />warning<br />notice<br />Info<br />debug<br />
  6. 6. Syslog configuration – con’d<br />Predefined facility (/usr/include/sys/syslog.h)<br />kern<br />mail<br />deamon<br />auth<br />news<br />ftp<br />user0~user7<br />
  7. 7. Syslogd<br />Restart syslog daemon<br />sudo /etc/init.d/sysklogdrestart<br />/etc/init.d/sysklogd status<br />
  8. 8. Example<br />Modify syslog.conf<br />User level code <br />
  9. 9. Example – con’d<br />Log message<br />
  10. 10. Extension<br />Syslog configuration<br />local3.err<br />local3.*<br />local3.3 (error)<br />local3.err; local3.crit<br />*.debug<br />
  11. 11. printk<br />
  12. 12. Tip<br />
  13. 13. Utility<br />logrotate<br />Circular logging, compress and remove<br />Send email using crontab<br />logger<br />Command line syslog tool<br />logger -p local0.err 'this message is sent using command line'<br />
  14. 14. Remote logging<br />Modify syslogd script on receiver<br />SYSLOGD="${SYSLOGD} -m 0 -r“<br />Modify syslog.conf on sender<br />local0.* @your.host.name<br />

×