Structured Logging using Slog in Rust

Slog is a structured logging library for rust-lang. Structured logging is a concept that puts events over messages, events are logged with associated key-value data, not plain string messages. This helps in: processing log files for analytics searching and debugging (example: search log statements for particular user or request) Basic Logging with Slog Lets create a simple logger: #[macro_use] extern crate slog; extern crate chrono; fn main() { let drain = slog::Discard; let root_logger = slog::Logger::root(drain, o!...

August 3, 2020 · 3 min · wilspi