Message_templates_lwt.ConfigurationLwt configuration builder
Lwt configuration - fluent API for async logger setup
Sink configuration type
type t = {min_level : Message_templates.Level.t;sinks : sink_config list;enrichers : (Message_templates.Log_event.t ->
Message_templates.Log_event.t)
list;filters : Message_templates.Filter.t list;context_properties : (string * Yojson.Safe.t) list;}Configuration type
val create : unit -> tCreate a new configuration with default minimum level (Information)
val minimum_level : Message_templates.Level.t -> t -> tSet minimum level for the logger
val write_to_file :
?min_level:Message_templates.Level.t ->
?rolling:Lwt_file_sink.rolling_interval ->
?output_template:string ->
string ->
t ->
tAdd an Lwt file sink with optional minimum level override. Note: The sink is created lazily on first use to avoid Lwt.t in config
val write_to_console :
?min_level:Message_templates.Level.t ->
?colors:bool ->
?stderr_threshold:Message_templates.Level.t ->
?output_template:string ->
unit ->
t ->
tAdd an Lwt console sink with optional minimum level override
val write_to : ?min_level:Message_templates.Level.t -> sink_config -> t -> tAdd a custom Lwt sink function with optional minimum level override. If both the sink_fn has a min_level and one is provided here, the more restrictive (higher) level is used.
val enrich_with :
(Message_templates.Log_event.t -> Message_templates.Log_event.t) ->
t ->
tAdd an enricher function
val filter_by : Message_templates.Filter.t -> t -> tAdd a filter
val filter_by_min_level : Message_templates.Level.t -> t -> tAdd minimum level filter
val create_logger : t -> Lwt_logger.tCreate the Lwt logger from configuration