#How to use Structured logging in Log crate?

2 messages · Page 1 of 1 (latest)

atomic kite
#

Log crate describes KV feature that allows to associated structure data with log event. Following this example (https://github.com/rust-lang/log?tab=readme-ov-file#structured-logging) and using env_logger implementation, seems like provided KVs are ignored in the output. Does this feature require specific implementation to work?

info!(name=node_name.as_str(); "Starting application: {}", &local_addr);

output

[2025-03-08T19:34:36Z INFO gossipgrid] Starting application: 127.0.0.1:4109

GitHub

Logging implementation for Rust. Contribute to rust-lang/log development by creating an account on GitHub.

valid goblet