Prometheus_unix.Logging
Report metrics for messages logged.
val init :
?default_level:Logs.level ->
?levels:(string * Logs.level) list ->
?formatter:Stdlib.Format.formatter ->
unit ->
unit
Initialise the Logs library with a reporter that reports prometheus metrics too. The reporter is configured to log to stderr and the log messages include a timestamp and the event's source.
A server will typically use the following code to initialise logging:
let () = Prometheus_app.Logging.init ()
Or:
let () =
Prometheus_unix.Logging.init ()
~default_level:Logs.Debug
~levels:[
"cohttp.lwt.io", Logs.Info;
]