/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
/* zy+ 01/17/00
   This program is designed for testing the openlog(), syslog(), setlogmask()
   and closelog() generated from syslog.h
*/


#include        <syslog.h>

int main() {
  /* function of openlog() initializes the log file
     string of "this_is_a_test_log" will precede every message
     logging option of LOG_PID puts process ID in message 
                       LOG_CONS forces writing messages to the console
     facility of LOG_USER indicates that the generator is a random user process. 
  */
  openlog("this_is_a_test_log", LOG_PID|LOG_CONS, LOG_USER);
  

  /* setlogmask() sets levels of all messages to LOG_ERR or lower */
  setlogmask(LOG_UPTO(LOG_ERR));

  /*
    syslog() sends messages of "just a test", "re...1", "re...2" and "re...3"
    onto system log with level LOG_INFO 
    Note:
    levels of LOG_EMERG & LOG_LOCAL0 will generate a broadcast to every user
  */
  syslog( LOG_LOCAL1, "just a test", "recursive calling 1", "recursive calling 2", "recursive calling 3");
  
  closelog();
}
