slog
Structured, extensible, composable logging for Rust
2.8.2
74M downloads/mo
#962 most downloaded on crates.io
slog-rs/slog
What this package is like to depend on
Last release 10 months ago
11 Oct 2025
Release timing varies
gaps range from 2 weeks to 2.8 years
Most releases are documented
notes for 33 of 48 stable releases
8 versions withdrawn
withdrawn after publishing
10 years old
70 releases · first in 2016
3 releases in the last 12 months
see the full history below
Release timeline
70 releases · Jun 2016 to Oct 2025Releases
latest 60 of 70-
2.8.211 Oct 2025Release notes
Open source →Fixed
- Fix use of
#operator in macros due to private field (issue #364)- Thanks to @Manishearth for identifying this.
- ci: Check the tests pass with
-Zminimal-versions
- Fix use of
-
2.8.109 Oct 2025 withdrawnRelease notes
Open source →This fixes an accidental breaking change in the v2.8.0 release, where the public API was changed from
erased_serde v0.4toerased_serde v0.3. This should not affect normal users of the API but could break drains supportingnested-values.I (@Techcable) apologize for this breakage and have yanked the 2.8.0 release due to this issue. I will try to setup
cargo-semver-checksin the CI to avoid this in the future.Fixed
- Restore compatibility with
erased-serdeversion0.3.- Compatibility with
erased-serdeversion0.4may be provided again in a future version, but will be done so in a backwards compatible way. - Thanks to @demurgos for recognizing and fixing this in PR #359
- Compatibility with
- Ensure compatibility with
-Zminimal-versionsflag by specifying minimal dependency versions (fixes #357)
- Restore compatibility with
-
2.8.005 Oct 2025 withdrawnRelease notes
Open source →This is the biggest slog release since 2.0. It fully preserves compatibility with prior releases.
Highlights
- Enables the
nested-valuesfeature by default. The next major release ofslog_json,slog_term, etc should also enable this feature by default. - Added
Logger::flushandDrain::flushmethods. - Improved support for logging errors
- Have
#log specifier transparently support&references to error - Implement
slog::ValueforBox<dyn std::error::Error>andanyhow::Error
- Have
- Define a
preludemodule for common imports - Upgraded to Rust 2018 and require Rust 1.61
- Deprecate the old
slog_log!macros in favor ofslog::log!
- Deprecate the old
- Many internal improvements & bug fixes
Changed
- Enables the
nested-valuesfeature by default. - Updated to Rust 2018
- NOTE: Old 2015 crates will still work because of excellent 2015/2018 compatibility
- Bump MSRV to 1.61
- This is already required for
erased-serde,syn,serde_core, and many other important crates in the rust ecosystem.
- This is already required for
- Update
erased-serdefrom v0.3 to v0.4 - Depend on
serde_corerather thanserdeto reduce compile times.
Added
- Added a
Logger::flushandDrain::flushmethods- Since this is a new method, not all drains implement it. Calling it on an unsupported drain will give an error
- Define a
preludemodule for common imports. Replaceuse slog::{Serde, Logger, info, debug, trace}withuse slog::prelude::* - Optionally implement Drain for
parking_lot::Mutex. This is noticeably faster thanstd::sync::Mutex, is smaller, and avoids poisoning.- This feature has a separate name per version to allow supporting multiple versions of
parking_lotat once. The current version (v0.12) has feature nameparking_lot_0_12
- This feature has a separate name per version to allow supporting multiple versions of
- Implement slog::Value for
dyn std::error::ErrorandBox<dyn std::error:Error(along with theSend/Syncversions). - Optionally implement slog::Value for
anyhow::Error(requiresanyhowfeature) - Add
ErrorRefwrapper to enable logging error references (PR #327)- The
#error formatter in macros was updated to automatically selectErrorValueorErrorRef(PR #328)
- The
- Add
emit_bytesmethod (PR #290)- Control formatting using
BytesKindenum
- Control formatting using
- Implement
Valueforstd::borrow::Cow
Deprecated
- Deprecate old prefixed macros like
slog_log. Rust 2018 macro paths likeslog::log!make these unnecessary.
Fixed
- Fix logging of references to errors (resolved by introduction of
ErrorRefin PR #327) - Take advantage of the fact that in 1.81
std::error::Errorhas been moved tocore. On this rust version, slog now supports the error trait without requiringstd. - Add
#[must_use]to most public types, includingslog::Logger,slog::OwnedKV, andslog::FnValue. - Give a descriptive error when the
nested-valuesfeature is unsupported. - Alias the
slog::Nevertype tostd::convert::Infallible, fixing issue #209. - doc: Fix typo in slog::Value docs (issue #335)
- Thank you to @larswirzenius for noticing this!
- doc: Fix "lazy continuation" in
slog::Loggerdoc- This mistake was caught by a new lint
#[warn(clippy::doc_lazy_continuation)]
- This mistake was caught by a new lint
- Fix some internal warnings
- Example: Avoid the new
#[warn(unexpected_cfgs)]lint. - The crate almost passes clippy::pedantic now, except for a few very verbose lints like
clippy::must-use-candidate - None of these changes should affect user crates
- Example: Avoid the new
- Stop requiring the
serde_derivecrate to implement thenested-valuesfeature. We depend on the newserde_coreinstead of even requiringserde. - The
nested-valuesfeature no longer requiresserde/std(was a mistake). - Always support 128-bit integers, even on the
wasm32-unknown-emscriptentarget. - Fix support for
feature="nothreads"- Internal refactoring to make different feature combos much easier (PR #301)
- Switch from Travis CI to Github Actions (fixes #294)
rustfmt --checknow run by default- Require
clippyto succeed without warnings - Require all feature combinations to pass tests.
- Make exception for
nested-valuesfeature on MSRV (1.49), becauseerased-serdedependency requiresedition="2021"(needs 1.56)
- Make exception for
- Fix
#format when not used as a last argument. - Fix duplicate
AsRef<str>implementations when usingdynamic-keysfeature. - Fix incorrect 'long' name for
slog::Level::Warning(fixes issue #282)
- Enables the
-
2.8.0-rc.107 Aug 2025 pre-releaseRelease notes
Open source →Final release waiting for more feedback on PR #346,
which would make nested-values a default feature. -
2.8.0-beta.205 Jan 2024 pre-releaseNothing published for this version
-
2.8.0-beta.110 Sep 2023 pre-releaseRelease notes
Open source →Update to Rust 2018
Enable Github ActionsSignificant internal refactoring and cleanup.
-
2.7.030 Nov 2020Release notes
Open source →Some minor improvements:
- Implement
HashforLevelandFilterLevel - Add #% for alternate display of the value part
- Implement
Eqfor dynamicKeys - Add
emit_errortoSerializer,#for serializing foreign errors, and
impl Value for std::io::Error
Retroactively tagged by Techcable
Release notes
Open source →- Implement
HashforLevelandFilterLevel - Add #% for alternate display of the value part
- Implement
Eqfor dynamicKeys - Add
emit_errortoSerializer,#for serializing foreign errors, andimpl Value for std::io::Error - Add
Serde(ifnested-valuesfeature is enabled) to optionally wrap a value that implements [serde::Serialize] so it's written to the log record as an object, rather than a primitive.
- Implement
-
2.5.222 Jul 2019 -
2.5.111 Jul 2019 withdrawn -
2.5.011 Jul 2019Release notes
Open source →- Added
FilterLevel::accepts - Added
as_str,as_short_strandDisplaytoFilterLevel
- Added
-
2.4.104 Oct 2018 -
2.4.029 Sep 2018Release notes
Open source →- Implement Value for 128 bit integers
- Add support 2018-style macro imports
- WARNING: This is a breaking change that we couldn't avoid. Users using
explicitly macro import (like
#[macro_use(slog_o)]) must add__slog_builtinto the import list.
- WARNING: This is a breaking change that we couldn't avoid. Users using
explicitly macro import (like
- Bump minimum supported Rust version to 1.26
-
2.3.328 Aug 2018 -
2.3.226 Jul 2018Release notes
Open source →- Revert broken changes:
- Make
?and%formatters inkv!more flexible - Export local inner macros to help with Rust 2018 testing
- Make
- Revert broken changes:
-
2.3.121 Jul 2018 withdrawnNothing published for this version
-
2.3.021 Jul 2018 withdrawnRelease notes
Open source →- Export local inner macros to help with Rust 2018 testing
- Stabilize
Record::new - Make
?and%formatters inkv!more flexible
-
2.2.328 Mar 2018 -
2.2.226 Mar 2018 -
2.2.125 Mar 2018 -
2.1.111 Dec 2017Nothing published for this version
-
2.1.011 Dec 2017Release notes
Open source →Added
- Support for nested-values through
emit_serde, behindnested-valuesfeature flag, disabled by default for backward compatibility. Note: Consider unstable for the time being. - Support for dynamic key (
Stringvs&'static str), behinddynamic-keysfeature flag, disabled by default for backward compatibility. Note: Consider unstable for the time being.
- Support for nested-values through
-
2.0.1215 Sep 2017 -
2.0.1114 Sep 2017 -
2.0.1009 Sep 2017 -
2.0.923 Aug 2017 -
2.0.823 Aug 2017Nothing published for this version
-
2.0.628 May 2017 -
2.0.516 May 2017 -
2.0.406 May 2017 -
2.0.306 May 2017 -
2.0.213 Apr 2017 -
2.0.112 Apr 2017Nothing published for this version
-
2.0.012 Apr 2017Release notes
Open source →Changed (since v1; bigger picture)
- Unified and simplified logging macros structure and ordering.
- Added logging Record
tags. - Refactored key-value pairs traits and structures and overall handling.
- It's now possible to
impl KV for MyStruct. kv!can be used to create on stack key-value list.KV-implementing data can appear on the key-value list directly.
- It's now possible to
- Support chaining of
OwnedKVLists. ExistingLoggercan be used as aDrainto allow custom handling logic for a part of the logging hierarchy. - Added associated
Oktype toDrain. - Support for
Drains unwind safety. - Refactored
Recordto optimize performance on async operations. slog-extrahas been renamed toslog-asyncsince that's the only functionality it contained.slog-streamis obsoleted and won't be used inslog v2at all. It was a wrong abstraction.Decoratorsfunctionality was moved toslog-term.slog-termprovides openDecoratortraits to allow multiple terminal / file writing backends.slog-termdefaultDecorators usetermcrate and should work correctly on all supported OSes.DrainExthas been removed and utility methods moved directly toDrainslog-stdlogutilizesslog-scopedirectly.- Support for "typed"
Loggers to allow squeezing last drops of performance possible, at the cost ofTinLogger<T>.
-
2.0.0-alpha224 Feb 2017 pre-release withdrawnNothing published for this version
-
2.0.0-alpha119 Feb 2017 pre-release withdrawnNothing published for this version
-
2.0.0-alpha.305 Mar 2017 pre-release withdrawnNothing published for this version
-
2.0.0-3.127 Mar 2017 pre-release -
2.0.0-3.026 Mar 2017 pre-releaseRelease notes
Open source →Changed
- Added support for own
KVandValueimplementations - Streamlined the formatting syntax for
log!and friends; BREAKING - Lazy values need explicit
FnValuewrapper; BREKING
Added
kv!macro
- Added support for own
-
2.0.0-2.220 Mar 2017 pre-release -
2.0.0-2.119 Mar 2017 pre-release -
2.0.0-2.012 Mar 2017 pre-releaseRelease notes
Open source →Changed
- Make
Logger::rootreturn "erased" version - Introduce
Logger::root_typedfor "non-erased"Loggercreation
- Make
-
2.0.0-1.005 Mar 2017 pre-releaseRelease notes
Open source →Fixed
fmt::DebugforMutexDrainError
Changed
- Parametrize
Loggerover theDrainit holds and introduce "erased" version - Enforcing
UnwindSafeDrains forLoggers - Refactored key-value pairs traits and structures
- Renamed some types
- Support chaining of
OwnedKVLists - Added associated
Oktype toDrain - Refactored
Recordto optimize performance on async operations - Minimal rustc version required:
1.15.0 DrainExthas been removed and utility methods moved directly toDrain
Added
- Macros to create
OwnedKVandBorrowedKV LoggerimplementsDrain
-
1.7.108 Nov 2017Nothing published for this version
-
1.7.008 Nov 2017Nothing published for this version
-
1.6.019 Oct 2017Nothing published for this version
-
1.5.208 Feb 2017Nothing published for this version
-
1.5.108 Feb 2017Nothing published for this version
-
1.5.006 Feb 2017Release notes
Open source →Changed
- Order of key-value pairs is now strictly defined
Added
LoggerimplementsDrain
Deprecated
- Creation of
OwnedKeyValueList
-
1.4.119 Jan 2017 -
1.4.028 Dec 2016 -
1.3.220 Nov 2016 -
1.3.120 Nov 2016 -
1.3.001 Nov 2016 -
1.2.128 Oct 2016 -
1.2.022 Oct 2016Release notes
Open source →Changed
- BREAKING:
Serializertakeskey : &'static strnow
Fixed
- Corner cases in
info!(...)and other macros
- BREAKING:
-
1.1.018 Oct 2016 -
1.0.110 Oct 2016 -
1.0.020 Sep 2016 -
1.0.0-alpha714 Sep 2016 pre-releaseNothing published for this version
-
1.0.0-alpha612 Sep 2016 pre-releaseNothing published for this version