Linux-Magazin: Syslog

Syslog-Beispiel in C
  #include <syslog.h>

  void main()
  {
    int counter = 10;

    openlog("freax.c", LOG_CONS | LOG_PID, LOG_LOCAL3);

    syslog (LOG_DEBUG, "Der Counter steht auf %d.", counter);

    counter++;

    openlog("froax.c", LOG_CONS | LOG_PID, LOG_NEWS);

    syslog (LOG_NOTICE, "Und jetzt steht er auf %d.", counter);

    closelog();

  }