Registry / logging / structured-logger

structured-logger

JSON →
library1.0.5rscratesunverified

A logging implementation for the log crate that logs structured values synchronously or asynchronously as JSON, CBOR, or other formats to files, stderr, stdout, or other destinations.

# Cargo.toml [dependencies] structured-logger = "1.0.5"
INSTALL
IMPORT
SIG · STRUCTURED-LOGGER
S
structured-logger
loggingrustv1.0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Builder
use structured_logger::Builder;

Initializes a structured logger that outputs JSON to stdout.

use structured_logger::Builder; fn main() { Builder::new() .with_target_writer("stdout", structured_logger::writer::JsonWriter::new(std::io::stdout())) .init(); log::info!("Hello, world!"); }
Debug
Known issues
gotchaRequires the `log` crate to be in scope; feature flags may be needed for async writers.
fix
Add `log` as a dependency and enable the `async` feature if using asynchronous logging.
affects: >=1.0.0
Upgrade
Version history
1.0.5latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
27
Amazon
1
Resources
structured-logger — cargo add structured-logger · libregistry