DEV.co
Open-Source Observability · slog-rs

slog

slog is a mature, battle-tested Rust logging library focused on structured, contextual, and composable logging. It offers a modular ecosystem with feature crates for different output formats and backends, though the maintainers recommend evaluating tracing as an alternative, especially for async-heavy workloads.

Source: GitHub — github.com/slog-rs/slog
1.7k
GitHub stars
100
Forks
Rust
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryslog-rs/slog
Ownerslog-rs
Primary languageRust
LicenseApache-2.0 — OSI-approved
Stars1.7k
Forks100
Open issues56
Latest releasev2.8.2 (2025-10-11)
Last updated2026-06-01
Sourcehttps://github.com/slog-rs/slog

What slog is

slog provides a core logging abstraction in Rust with pluggable drains (backends) for flexibility. It supports hierarchical loggers, structured key-value logging, and contextual chaining. The ecosystem includes optional crates for async logging, JSON output, syslog integration, and terminal formatting. Minimum supported Rust version is 1.61+.

Quickstart

Get the slog source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/slog-rs/slog.gitcd slog# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Structured logging in synchronous Rust applications

slog excels in traditional, non-async Rust services where you need hierarchical context propagation, key-value structured logging, and stable, proven APIs without rapid breaking changes.

Custom logging backends and integrations

The drain-based architecture makes it straightforward to build custom logging outputs or integrate with specialized backends; the ecosystem already includes syslog, JSON, and terminal formatters as examples.

Projects valuing API stability and mature code

slog has been in production use since 2016 with a stable feature set. If you prioritize a battle-tested, non-experimental logging solution over cutting-edge async debugging, slog is a reliable choice.

Implementation considerations

  • Steep learning curve: understand drain composability, context chains, and initialization patterns before deploying; review examples and wiki documentation thoroughly.
  • Modular by nature: core crate is minimal; you will likely need slog-term, slog-async, or custom drains to achieve production-ready logging—plan crate selection upfront.
  • Minimum Rust version 1.61+; ensure your MSRV policy aligns with this baseline.
  • Performance is reported as very good, but formal benchmarks vs. tracing or std log are not provided; validate latency and throughput for your workload.
  • Community support available via Gitter chat; however, documentation gaps are acknowledged in the README; expect to read code and examples to fill gaps.

When to avoid it — and what to weigh

  • Heavy async/await and real-time async debugging required — The official README explicitly recommends evaluating tracing for async workloads. slog's async support exists (via slog-async) but tracing has more mature async instrumentation and larger community support for debugging async code.
  • You need a single, zero-configuration logging solution — slog is modular and composable by design; this requires understanding drains and chains. If you want immediate, minimal-config logging out of the box, sloggers (a third-party wrapper) or tracing may be faster onboarding.
  • Large, active development team and frequent updates expected — slog has one original maintainer (Dawid Ciężarkiewicz) with potential shared ownership. Updates are stable but infrequent. Tracing benefits from Tokio/larger ecosystem backing and more frequent improvements.
  • Production debugging at scale with distributed tracing — tracing has better integration with observability platforms and distributed tracing standards. slog is output-only; it does not natively provide span-based tracing or correlation for microservices.

License & commercial use

Licensed under Apache License 2.0 (Apache-2.0), a permissive OSI-approved license.

Apache-2.0 is a permissive license permitting commercial use, modification, and distribution, provided copyright notices and license text are retained. No known restrictions on commercial use. However, the README notes that cargo-crev verification is recommended to assess trustworthiness of this and all dependencies.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceModerate
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No known critical vulnerabilities disclosed in the data. As a logging library, slog does not perform cryptography, network operations, or authentication itself. Security posture depends on drain implementations and user code serializing sensitive data. Follow best practices: avoid logging passwords, API keys, or PII; use structured fields to redact or filter sensitive values. Verify dependencies (especially third-party drains) via cargo-crev as recommended in README.

Alternatives to consider

tracing (Tokio ecosystem)

Explicitly recommended in slog README as the modern go-to for Rust logging/tracing. Better async support, distributed tracing integration, larger community, and more frequent updates. Preferred for async-heavy microservices and observability tooling.

log (Rust standard facade)

Minimal, zero-config facade for logging. Lacks structured logging, contextual chaining, and composability. Suitable only for simple projects or when you want to delegate logging to downstream crates.

env_logger

Built on log facade, provides easy environment-variable-based filtering and terminal output. No structured logging or advanced composition. Good for quick prototypes or CLI tools; insufficient for complex production services.

Software development agency

Build on slog with DEV.co software developers

slog is a proven, stable choice for structured logging in synchronous Rust applications. Review the README, explore the ecosystem crates, and join the Gitter community to discuss fit for your use case. Consider tracing if async/distributed tracing is critical.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

slog FAQ

Should we adopt slog or tracing?
slog is mature and stable; tracing is the modern recommendation for new projects, especially those using async/await heavily. Review the README's comparison: stick with slog if you value stability, don't need async instrumentation, or have existing slog usage; otherwise, consider tracing.
How do I configure slog without writing boilerplate?
Use sloggers, a third-party convenience wrapper that provides pre-built configurations for common scenarios. Alternatively, learn drain composition in slog core; the wiki has examples. Direct drain usage offers more control but requires more setup.
What is the performance impact of slog?
README states 'performance is very good,' but no formal benchmarks are provided in the data. For latency-critical code, measure with your own workload using slog-async and your target drain. Consider comparing with tracing or log if performance is a top concern.
Is slog safe to use in production?
Yes. slog has been battle-tested in many important projects since 2016 and has a stable API. Risks are low for sync code; for async code, review slog-async implementation and consider tracing as a lower-risk alternative.

Software developers & web developers for hire

DEV.co helps companies turn open-source tools like slog into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source observability stack.

Evaluate slog for your Rust project

slog is a proven, stable choice for structured logging in synchronous Rust applications. Review the README, explore the ecosystem crates, and join the Gitter community to discuss fit for your use case. Consider tracing if async/distributed tracing is critical.