package octez-libs

  1. Overview
  2. Docs

Configure the event-logging framework for UNIX-based applications.

The JSON-file-friendly definition of the configuration of the internal-events framework. It allows one to activate registered event sinks.

module Configuration : sig ... end
val env_var_name : string

This is the environment variable name that contains the a list of URIs on which events can be reported (see init).

val close : unit -> unit Lwt.t

Call close on all the sinks.

val make_with_defaults : ?verbosity:Tezos_event_logging.Internal_event.level -> ?enable_default_daily_logs_at:string -> ?daily_logs_section_prefixes: (string * Tezos_event_logging.Internal_event.level) list -> ?log_cfg:Logs_simple_config.cfg -> unit -> Tezos_base.Internal_event_config.t

make_defaults ?verbosity ?enable_default_daily_logs_at ?daily_logs_section_prefixes ?internal_events creates internal event configuration using default values depending on parameters.

  • verbosity overrides the default level on stdout. Usually provided through -v instead of configuration.
  • If internal_events is provided, nothing is modified. Otherwise default values are used.
  • enable_default_daily_logs_at adds daily rotating sink at the given path with the following value: "file-descriptor-path:///<daily_logs_path>/daily.log ?create-dirs=true&daily-logs=7&section-prefix=info&format=pp"

This function handles TEZOS_LOG environment variables and rules provided through it. It also optionally accepts ?daily_logs_section_prefixes.

val init : ?config:Tezos_base.Internal_event_config.t -> unit -> unit Lwt.t

init ?config () initializes the internal-event sinks using either

  • "TEZOS_EVENTS_CONFIG" environment variable,
  • config, the value of configured sinks of command calling init, if provided,

Note that if config is provided,the environment variable TEZOS_LOG is ignored.

"TEZOS_EVENTS_CONFIG" is expected to be a (whitespace separated) list of URIs. If an URI does not have a scheme it is expected to be a path to a configuration JSON file (cf. Configuration.of_file), e.g.: export TEZOS_EVENTS_CONFIG="unix-files:///tmp/events-unix debug://", or export TEZOS_EVENTS_CONFIG="debug:// /path/to/config.json".

val enable_default_daily_logs_at : daily_logs_path:string -> unit Tezos_base.TzPervasives.Error_monad.tzresult Lwt.t

Adds a daily rotating sink at the given path with the following value: "file-descriptor-path:///<daily_logs_path>/daily.log ?create-dirs=true&daily-logs=7&section-prefix=info&format=pp"

OCaml

Innovation. Community. Security.