Crate slog_kickstarter
source · [−]Expand description
Slog Kickstarter. Easily sets up slog for structured logging.
- enables JSON logging if
RUST_LOG_JSON=1
(i.e. setRUST_LOG_JSON=1
for your deployment, or putENV RUST_LOG_JSON=1
into your Dockerfile) - inits and configures stdlogger, so crates using
info!()
from the (default) log-crate can log messages - allows to enable debugging for given modules (typically your own modules)
- sets default loglevel ‘Info’
- supports well-known
[RUST_LOG](https://crates.io/crates/env_logger)
Usage:
use slog_kickstarter::SlogKickstarter;
use slog_scope::set_global_logger;
use slog::o;
let root_logger = SlogKickstarter::new("service-name").init();
let _guard = set_global_logger(root_logger.new(o!("scope" => "global")));
Structs
the actual slog builder