env_logger (Rust)

Simple, configurable logging backend for Rust's log crate that reads the RUST_LOG environment variable to set log levels per module. The de facto standard for CLI tools and simple applications. Zero-config startup: RUST_LOG=debug cargo run enables debug logging. Formats output to stderr with timestamps and module path.

Evaluated Mar 06, 2026 (0d ago) v0.11+
Homepage ↗ Repo ↗ Developer Tools rust logging log environment stderr cli debug
⚙ Agent Friendliness
70
/ 100
Can an agent use this?
🔒 Security
95
/ 100
Is it safe for agents?
⚡ Reliability
89
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
90
Error Messages
85
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
92
Secret Handling
82

Logs may contain sensitive data if not carefully managed. RUST_LOG may expose debug info — ensure production RUST_LOG is appropriately restricted.

⚡ Reliability

Uptime/SLA
92
Version Stability
88
Breaking Changes
85
Error Recovery
90
AF Security Reliability

Best When

Building Rust CLI tools or simple services that need easy log level control via environment variable.

Avoid When

Building production services needing structured logging, distributed tracing, or log aggregation — use tracing instead.

Use Cases

  • Add zero-config debug logging to Rust CLI tools and libraries with RUST_LOG environment variable control
  • Configure per-module log levels for Rust applications: RUST_LOG=myapp=debug,hyper=warn sets different levels per crate
  • Quick prototype logging before switching to tracing or structured logging in production
  • View library debug output from third-party crates that use the log crate
  • Configure custom log formatting and output styling for CLI applications

Not For

  • Structured JSON logging for production services — use tracing + tracing-subscriber with JSON formatter
  • Async-aware distributed tracing — use tokio's tracing ecosystem for spans, context propagation, and OpenTelemetry
  • Log aggregation or shipping — env_logger writes to stderr only; use a log exporter for centralized logging

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Library — no auth needed.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Open source library.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Call env_logger::init() only once — calling it twice panics with 'attempted to set a logger after the logging system was already initialized'; use try_init() for safe initialization
  • RUST_LOG invalid syntax is silently ignored — typos in RUST_LOG filter strings cause all logging to be disabled without error messages
  • env_logger writes to stderr by default — output goes to stderr, not stdout; redirect appropriately when capturing logs
  • env_logger does not support structured logging (JSON) — log output is human-readable text; switch to tracing for machine-parseable logs
  • Log calls in non-main threads are synchronous and blocking — env_logger is not async-aware; heavy logging may cause performance issues in async code
  • RUST_LOG=target[span{field=value}] filtering syntax requires understanding the tracing_subscriber format — env_logger uses a simpler target=level format only

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for env_logger (Rust).

$99

Scores are editorial opinions as of 2026-03-06.

5228
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered