Search:

PmWiki

pmwiki.org

edit SideBar

Main / Syslog

Messages are written to /var/log/syslog but there could be another log file in this folder specific to your application or daemon. To that other file could go std in/out/err re-directs.

https://linux.die.net/man/3/setlogmask

// set log mask and open log
//setlogmask (LOG_UPTO (SYSLOGLEVEL));
openlog (DAEMON_NAME,
         LOG_CONS | LOG_PID | LOG_NDELAY,
         LOG_USER);
syslog(LOG_NOTICE, "Starting Daemon");

Levels, decreasing importance, so LOG_UPTO logs everything at and below the given level:

  • LOG_EMERG
  • LOG_ALERT
  • LOG_CRIT
  • LOG_ERR
  • LOG_WARNING
  • LOG_NOTICE
  • LOG_INFO
  • LOG_DEBUG

Page last modified on November 09, 2023, at 11:58 AM