package core_unix

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
include module type of struct include Syslog end
module Open_option = Syslog.Open_option
module Facility = Syslog.Facility

Types of messages

module Level = Syslog.Level
val setlogmask : ?allowed_levels:Level.t list -> ?from_level:Level.t -> ?to_level:Level.t -> unit -> unit

All levels in allowed_levels will be allowed, and additionally all ranging from from_level to to_level (inclusive).

Logging functions

val openlog : ?id:string -> ?options:Open_option.t list -> ?facility:Facility.t -> unit -> unit

openlog ~id ~options ~facility () opens a connection to the system logger (possibly delayed) using prefixed identifier id, options, and facility.

WARNING: this function leaks the id argument, 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 openlog before syslog is optional. If you forget, syslog will do it for you with the defaults.

val syslog : ?facility:Facility.t -> ?level:Level.t -> string -> unit

syslog ~facility ~level message logs message using syslog with facility at level.

val syslogf : ?facility:Facility.t -> ?level:Level.t -> ('a, unit, string, string, string, unit) CamlinternalFormatBasics.format6 -> 'a

syslog_printf acts like syslog, but allows printf-style specification of the message.

val closelog : unit -> unit

closelog () closes the connection to the syslog daemon.

OCaml

Innovation. Community. Security.