env_logger
Environment-variable-configured logging backend for Rust's log crate
Repository Health
Technical Analysis
env_logger is the de-facto default backend for Rust’s log facade, letting you control log levels and per-module filtering entirely through the RUST_LOG environment variable rather than code changes or config files. It writes human-readable, optionally colored output to stderr (or stdout) and supports fine-grained filters like RUST_LOG=my_crate=debug,other_crate=warn.
The project is a Cargo workspace that also publishes env_filter as a separate crate — the underlying filter-parsing engine env_logger builds on — so other logging backends can reuse the same RUST_LOG-style filter syntax without depending on env_logger’s full formatting/writer stack.
What You Get
- A ready-to-use
log::Logimplementation activated with a singleenv_logger::init()call RUST_LOG-style filter syntax supporting per-module and per-level granularity (e.g.my_crate=debug,hyper=warn)- Configurable output target (stderr/stdout), timestamp formats, and color support via a
BuilderAPI - A separate
env_filtercrate exposing just the filter-string parsing logic for reuse by other logging backends - Custom formatter support for fully overriding how each log record is rendered
Common Use Cases
- Adding basic, zero-config logging output to a CLI tool or service with a single
env_logger::init()call - Selectively enabling debug-level logs for one dependency while keeping others at warn/error during troubleshooting
- Building a custom logging backend that wants to reuse env_logger’s
RUST_LOGfilter parser (env_filter) without its formatter/writer - Testing binaries where log verbosity needs to be toggled per test run via environment variables rather than recompiling
Under The Hood
Architecture - the repo is a Cargo workspace with the top-level env_logger package as the umbrella crate (src/lib.rs, src/logger.rs, plus src/fmt for output formatting and src/writer for the stderr/stdout output target) and crates/env_filter as a workspace member providing the standalone RUST_LOG filter-parsing engine that env_logger depends on internally, letting other logging backends adopt the same filter syntax independently. Tech Stack - pure Rust, built on the log crate’s facade pattern (implementing its Log trait), with optional humantime/color-output dependencies gated behind Cargo features, and a workspace-wide Clippy lint configuration ([workspace.lints.clippy]) enforcing a large, curated set of lint rules across both crates. Code Quality - the tests/ directory targets specific historical correctness issues (log-in-log.rs, log_tls_dtors.rs, init-twice-retains-filter.rs, regexp_filter.rs), showing regression coverage for real bugs rather than only happy-path tests, and the workspace enforces a strict shared lint policy (unreachable_pub, unsafe_op_in_unsafe_fn, etc.) across all member crates. API Design - the common path is a single env_logger::init() call with zero required configuration, while a Builder escape hatch exposes format, filter, and target customization for more advanced setups — keeping the learning curve close to zero for the default case while still supporting deep customization.
Used by 14 apps in this directory
ClickHouse
Databases · Analytics · Data Engineering
Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.
CubeSandbox
Developer Tools · Security · AI Agents
Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.
highlight.io
Developer Tools · Analytics · Monitoring
Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.
Hoppscotch
Developer Tools
A lightweight, offline-capable API development ecosystem for testing HTTP, GraphQL, WebSocket, MQTT, and SSE endpoints across web, desktop, and CLI.
Jan
AI Assistants
Run LLMs 100% locally with full privacy, or connect to cloud AI — your machine, your data, your control.
Meetily
Productivity · AI Assistants
Privacy-first AI meeting assistant that transcribes and summarizes your meetings entirely on your local machine — no cloud, no data leakage.
Memgraph
Databases · AI Development
High-performance in-memory graph database for AI context and real-time analytics
MicroBin
File Storage
A self-contained, encrypted paste bin and file-sharing app in Rust with animal-name URLs, burn-after-read, and one-command Docker deployment.
Murr
Databases
A RocksDB-based NVMe/S3 cache purpose-built for AI inference workloads — a faster Redis replacement optimized for batch, low-latency, zero-copy reads and writes between data pipelines and inference apps.