package core_unix

  1. Overview
  2. Docs
Unix-specific portions of Core

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.1.tar.gz
md5=9370dca36f518fcea046d2752e3de22b
sha512=c4e8ce9d5885ac8fa8d554a97e1857f3a1c933e0eb5dfd4fe874412b9d09e6d0a2973b644733855553f33f5c859719228f0e6aaf3a2b7eb5befb46fc513750de

doc/core_unix.syslog/Syslog/index.html

Module SyslogSource

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.

Sourcemodule Open_option : sig ... end
Sourcemodule Facility : sig ... end

Types of messages

Sourcemodule Level : sig ... end
Sourceval 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

Sourceval 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.

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

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

Sourceval 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.

Sourceval closelog : unit -> unit

closelog () closes the connection to the syslog daemon.

OCaml

Innovation. Community. Security.