Module Syslog
Send log messages via the Unix Syslog interface.
Syslog is great for system daemons that log free-form human readable status messages or other debugging output, but not so great for archiving structured data. Access to read Syslog's messages may also be restricted. syslogd's logs are also not necessarily kept forever. For application level logging consider Core_extended.Std.Logger instead.
module Open_option : sig ... endmodule Facility : sig ... endTypes of messages
module Level : sig ... endval setlogmask : ?allowed_levels:Level.t list -> ?from_level:Level.t -> ?to_level:Level.t -> unit -> unitAll levels in
allowed_levelswill be allowed, and additionally all ranging fromfrom_leveltoto_level(inclusive).
Logging functions
val openlog : ?id:string -> ?options:Open_option.t list -> ?facility:Facility.t -> unit -> unitopenlog ~id ~options ~facility ()opens a connection to the system logger (possibly delayed) using prefixed identifierid,options, andfacility.WARNING: this function leaks the
idargument, if provided. There is no way around that if syslog is called in a multi-threaded environment! Therefore it shouldn't be called too often. What for, anyway?Calling
openlogbeforesyslogis optional. If you forget, syslog will do it for you with the defaults.
val syslog : ?facility:Facility.t -> ?level:Level.t -> string -> unitsyslog ~facility ~level messagelogsmessageusing syslog withfacilityatlevel.
val syslogf : ?facility:Facility.t -> ?level:Level.t -> ('a, unit, string, unit) Syslog__.Import.format4 -> 'asyslog_printfacts likesyslog, but allowsprintf-style specification of the message.