Syslog server for NaviServer 4.x
Release 1.0

This is NaviServer module that implements Syslog server




   ns_section    ns/server/$server/modules
   ns_param      nssyslogd        nssyslogd.so
   ns_param      nssyslogd2       nssyslogd.so

   # Local syslog server
   ns_section    ns/server/$server/module/nssyslogd
   ns_param	 proc		syslog::server

   # Syslog accepting logs from the network
   ns_section    ns/server/$server/module/nssyslogd2
   ns_param      address
   ns_param      port      	514
   ns_param	 proc		syslog::server
   ns_param	 globalmode	true
   ns_param	 threadmode	true

   proc       - Tcl proc to call on message receive
   threadmode - tells to use connection driver and queue
                syslog messages to connection threads for
                delivery, otherwise syslog uses socket callbacks
                mechanism which is sequential

   globalmode - in case of multiple syslog modules loaded, it tells to
                reuse the same configuration for log files, so 2 modules
                one for /dev/log another for remote UDP on port 514 can
                share the same log files and locks


    ns_syslogd create ?-maxbackup maxbackup? ?-maxlines maxlines? ?-rollfmt rollfmt? ?-map map? logname logfile
      create named syslog file

      maxbackup - how many log files to keep
      maxlines  - how many lines to keep in the buffer before flush to disk
      rollfmt   - format of log file using stftime formatting rules
      map       - list of facility[.severity] codes that apply to this
                  log, server will match them and write automatically. This
                  works only if no proc Tcl script is specified in the nsd.tcl
                  file for this driver

                  Format is: facility or facility.severity

                  where severity can be none or actual severity name, without
                        it all lines with given facility will be matched for all
                        severity codes, without facility, severity applies to all

                  -map { daemon mail.alert local6 local7.none .info }

    ns_syslogd write msg
      write to the named syslog file

    ns_syslogd list
      return list of all opened syslog files

    ns_syslogd stat logname
      return log statistics

    ns_syslogd flush logname
      flush given log

    ns_syslogd roll logname
      perform log rolling

    ns_syslogd send ?-host h? ?-facility f? ?-options o? -tag t? ?-facility f? message
      send message to the syslog daemon using system call

      host        - remote host ip address or /dev/log
      facility    - kernel, cron, authpriv, mail, local0, local1, daemon, local2,
                    news, local3, local4, local5, local6, syslog, local7, auth, uucp, lpr, user
      options     - list with any of { CONS NDELAY PERROR PID ODELAY NOWAIT }
      tag         - prepended to every message, and is typically the program name
      priority    - info, alert, emerg, err, notice, warning, error, crit, debug


     Vlad Seryakov vlad@crystalballinc.com