cortexkit-log
Logging format, filtering, redaction, rotation, and retention for CortexKit modules, with a synchronous tracing layer.
Add to Cargo.toml:
[]
= "0.3.6"
With a Crates policy, own crates retain their existing logger
names and dependencies are labelled <module_id>.dep.<crate>. Rust crate-name
underscores become hyphens, so hyper_util is logged as
<module_id>.dep.hyper-util. Dependencies default to WARN or the module's own
resolved level, whichever is lower. A CK_LOG directive such as
<module_id>.dep.hyper-util=debug can raise one dependency's level.
Use Crates::ceiling to set a maximum for a dependency after CK_LOG; an OFF
ceiling drops that crate entirely. Ceilings are useful for transports whose
verbose logs may contain credentials or connection secrets.
use ;
let crates = new
.own
.ceiling;
let config = in_dir;
let _ = init_with_crates;
For a caller-composed subscriber, use layer(config)?.0.with_crates(policy);
the same method works on layer_with_stderr_copy(config)?.0. Under the default
store-paths feature, init_from_env_with_crates(policy) applies the same
policy to environment-based initialization.
Do not use an outer filter_fn to enforce CK_LOG; the layer already does
that, and its per-event checks mean an outer filter cannot bypass the policy.
A filter's own predicate can still suppress events. See the crate
documentation for initialization and log-segment retention APIs.