A versatile and extensible logging framework for Rust applications, supporting multiple dispatches, filters, and appenders.
Logforth is a versatile, extensible logging framework for Rust that enables developers to configure multiple dispatches, filters, and appenders to tailor logging setups precisely to their application's needs. It solves the problem of inflexible logging by providing modular components for routing log messages to different destinations, from simple console output to complex distributed tracing via OpenTelemetry. It acts as a backend for the standard `log` crate facade, ensuring compatibility with Rust's ecosystem.
Rust developers building applications that require flexible, production-grade logging configurations, such as microservices, distributed systems, or applications needing integration with observability platforms like OpenTelemetry.
Developers choose Logforth for its high modularity and extensibility, allowing them to compose custom logging pipelines from reusable components like appenders, layouts, and filters. Its unique selling point is the ability to configure multiple independent dispatches for fine-grained log routing, alongside built-in support for advanced features like diagnostic contexts (MDC) and seamless integration with tracing systems like Fastrace.
A versatile and extensible logging implementation.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Logforth's architecture allows composing logging pipelines from reusable components, with custom implementations possible via traits like Append and Layout, enabling tailored setups for complex applications.
Enables fine-grained log routing to different destinations based on criteria like severity, as shown in examples with separate stdout and stderr dispatches for flexible output control.
Includes built-in appenders for stdout, stderr, files, OpenTelemetry, syslog, journald, and async logging, covering many production needs without requiring custom code.
Supports JSON, logfmt, and Google Cloud Logging layouts out of the box, facilitating integration with modern monitoring and analysis tools for enhanced observability.
Provides MDC with static, thread-local, and task-local diagnostics, and integrates with Fastrace for tracing context in logs, improving debugability in distributed systems.
Setting up appenders like OpenTelemetry requires asynchronous runtime management and multiple steps, as evidenced by the lengthy code snippet, increasing initial setup time and complexity.
The project is still maturing with core APIs not stabilized, and separate crates might introduce breaking changes in minor updates, posing maintenance risks for long-term projects.
Modular crates for appenders, layouts, and diagnostics can lead to a larger dependency graph and potential version conflicts, complicating build and update processes.
While it supports OpenTelemetry and Google Cloud, direct appenders for other services like AWS CloudWatch are absent, requiring custom implementation and increasing development effort.