Upgrading tracing-subscriber 0.2 to 0.3
Breaking0.2.25 → 0.3.23Breaking15Security2Platform5Deprecated1New36Changed22Fixed27Other17
SecurityLogging user input may result in poisoning logs with ANSI escape sequencesGHSA-xwfj-jgwm-7wp5 · CVE-2025-58160 ↗
BreakingUpgrade verdict
14 breaking changes and 5 platform requirement changes and 2 security fixes.
In plain terms
- Implementations of the Layer trait must rename the new_span method to on_new_span.
- Timestamps are now formatted with the time crate instead of chrono.
- RUST_LOG-based filtering stops working unless the env-filter feature is turned on.
- chrono-based timestamp formatting is gone; use the time crate instead.
Must act Top 5 of 22 that need code or config changes
Requires Rust 1.65.0 from 0.3.20 (none stated before).
What you must change
Breaking14
Renames
Layer::new_span to Layer::on_new_span.Layer::new_spanLayer::on_new_spanReplaces the
chrono crate with the time crate for timestamp formatting to resolve RUSTSEC-2020-0159.chronotimeRemoves
json and env-filter from default features; they must now be enabled explicitly.jsonenv-filterRUST_LOGRemoves the
chrono feature flag and the APIs for formatting timestamps with the chrono crate.chronoRemoves APIs that were deprecated in the v0.2.x release series.
Removes the
Layer impl for Arc<L: Layer<S>> and Arc<dyn Layer<S> + ...>.LayerArcChanges
FormatEvent::format_event and FormatFields::format_fields to take a Writer type instead of &mut dyn fmt::Write.FormatEvent::format_eventFormatFields::format_fieldsWriterAdds a lifetime parameter to the
MakeWriter trait signature.MakeWriterRemoves the deprecated
CurrentSpan type.CurrentSpanRemoves the deprecated
SpanRef::parents iterator, replaced by SpanRef::scope.SpanRef::parentsSpanRef::scopeRemoves the deprecated
Context::scope iterator, replaced by Context::span_scope and Context::event_scope.Context::scopeContext::span_scopeContext::event_scopeRemoves
fmt::Layer::on_event, renamed to fmt::Layer::fmt_event.fmt::Layer::on_eventfmt::Layer::fmt_eventRemoves support for some APIs on #![no_std] targets by disabling the std feature flag.
stdRemoves the deprecated
LayerBuilder type.LayerBuilderSecurity2
Logging user input may result in poisoning logs with ANSI escape sequences
Updates
thread-local to v1.1.4, fixing warnings for security advisory RUSTSEC-2022-0006.thread-localPlatform5
Increased minimum supported Rust version (MSRV) to 1.63.0+.
Increases the minimum supported Rust version to 1.50+ when the ansi feature flag is enabled.
ansiUpdates the minimum supported Rust version (MSRV) to 1.49.0.
Bumps the minimum supported Rust version (MSRV) to 1.63.
Bump MSRV to 1.63 ().
Deprecations to plan for
Deprecated1
Deprecates Pretty::with_source_location in favor of the more general Format, SubscriberBuilder, and Layer methods.
Pretty::with_source_locationFormatSubscriberBuilderLayer