pub fn init<S: AsRef<str>>(
url: S,
max_log_level: LevelFilter,
) -> Result<(), SetLoggerError>
Expand description
Configure the log
facade to log to loki.
This function initialize the logger with no defaults static labels.
To use them, you may want to use init_with_labels
.
ยงExample
Usage:
use log::LevelFilter;
loki_logger::init(
"http://loki:3100/loki/api/v1/push",
log::LevelFilter::Info,
).unwrap();
log::info!("Logged into Loki !");