#mdc #log #logging

log-mdc

A mapped diagnostic context (MDC) for use with the log crate

1 unstable release

Uses old Rust 2015

0.1.0 Oct 4, 2016

#3 in #mdc

Download history 35508/week @ 2023-11-07 35655/week @ 2023-11-14 29907/week @ 2023-11-21 35314/week @ 2023-11-28 37245/week @ 2023-12-05 33634/week @ 2023-12-12 25589/week @ 2023-12-19 16717/week @ 2023-12-26 26562/week @ 2024-01-02 29117/week @ 2024-01-09 30526/week @ 2024-01-16 32272/week @ 2024-01-23 37587/week @ 2024-01-30 38536/week @ 2024-02-06 37501/week @ 2024-02-13 32783/week @ 2024-02-20

152,077 downloads per month
Used in 23 crates (6 directly)

MIT/Apache

7KB
100 lines

rust-log-mdc

A mapped diagnostic context (MDC) for use with the log crate.

An MDC is a thread local map of strings used to make relevant information from a system available in its log messages. Logging crates such as log4rs will retrieve values from the MDC for output.

For example, a web server may process many requests simultaneously on different threads. Generating an ID for each request and storing it in the MDC makes it easy to partition log messages on a per-request basis.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

No runtime deps