Module Syslog


module Syslog: sig .. end
Syslog Interface
Author(s): Markus Mottl


Options for opening syslog



type opt =
| PID (*Include PID with each message*)
| CONS (*Write directly to system console if there is an error while sending to system logger*)
| ODELAY (*Delay opening of the connection until syslog is called*)
| NDELAY (*No delay opening connection to syslog daemon*)
| NOWAIT (*Do not wait for child processes while logging message*)
| PERROR (*Print to stderr as well*)

Types of syslog messages (facilities)



type fac =
| KERN (*Kernel messages*)
| USER (*Generic user-level message (default)*)
| MAIL (*Mail subsystem*)
| DAEMON (*System daemons without separate facility value*)
| AUTH (*Security/authorization messages (DEPRECATED, use AUTHPRIV)*)
| SYSLOG (*Messages generated internally by syslogd*)
| LPR (*Line printer subsystem*)
| NEWS (*USENET news subsystem*)
| UUCP (*UUCP subsystem*)
| CRON (*Clock daemon (cron and at)*)
| AUTHPRIV (*Security/authorization messages (private)*)
| FTP (*FTP daemon*)
| LOCAL0
| LOCAL1
| LOCAL2
| LOCAL3
| LOCAL4
| LOCAL5
| LOCAL6
| LOCAL7 (*LOCAL0-7 reserved for local use*)

Types of and functions for logging levels



type lev =
| EMERG (*System is unusable*)
| ALERT (*Action must be taken immediately*)
| CRIT (*Critical condition*)
| ERR (*Error conditions*)
| WARNING (*Warning conditions*)
| NOTICE (*Normal, but significant, condition*)
| INFO (*Informational message*)
| DEBUG (*Debug-level message*)
val all_levs : lev array
val all_str_levs : string array
val compare_lev : lev -> lev -> int
val string_of_lev : lev -> string
val lev_of_string : string -> lev
val setlogmask : ?levs:lev list ->
?from_lev:lev -> ?to_lev:lev -> unit -> unit
val openlog : ?id:string -> ?opt:opt list -> ?fac:fac -> unit -> unit
val syslog : ?fac:fac -> ?lev:lev -> string -> unit
val esyslog : ?fac:fac -> ?lev:lev -> string -> unit
val syslog_printf : ?fac:fac ->
?lev:lev -> ('a, unit, string, unit) Pervasives.format4 -> 'a
val esyslog_printf : ?fac:fac ->
?lev:lev -> ('a, unit, string, unit) Pervasives.format4 -> 'a
val closelog : unit -> unit
closelog () closes the connection to the syslog daemon.