What is rlg?
rlg, the RustLogs project, is a free, open-source structured logging library for Rust. fire() pushes a record into a ring buffer and returns; a background thread formats it in one of 14 formats and writes it to os_log on macOS, journald on Linux or standard output. See the features.
Is it faster than tracing?
On the calling thread it costs about the same: 598 ns against 591 ns for one record in a published CI run, and 947 ns against 1,117 ns with three attributes. The difference is that rlg has not formatted the record or written it yet, so your thread never waits on I/O. The performance page has the full table.
Can I keep my log and tracing calls?
Yes. rlg::init() installs rlg behind the log facade and as the tracing subscriber, so existing log::info! and tracing::info! calls are written through rlg. See the migration guide.
Where do my records go?
To os_log on macOS and journald on Linux, and to standard output elsewhere, including Windows, or on Linux when journald is not running. Set RLG_FALLBACK_STDOUT=1 to send them to standard output. See native sinks.
Can a crash lose records?
Yes. Records wait in memory until the background thread writes them, so records still in the buffer when the process is killed are lost. Dropping the FlushGuard returned by rlg::init() writes them out.
Does it work on Windows?
rlg builds on Windows, which CI checks, and writes to standard output there. There is no native Windows Event Log sink. Prebuilt rlg, rlg-report and rlg-mcp binaries are published for Windows.
Does it support spans?
No. rlg records events with attributes. If you analyse hierarchical spans, keep tracing; rlg's tracing support bridges events, not span context.
Can an AI agent read my logs?
Yes, through the rlg-mcp server, which gives MCP clients tools to tail, filter and summarise log files, over stdio or HTTP. See logs for AI agents.
Is the API stable?
No. rlg is at 0.0.x, so any release may break your build, and it has one maintainer. Breaking changes are marked in the CHANGELOG, and cargo-semver-checks runs on pull requests that change the crates.
What does it cost, and under which licence?
Nothing. rlg is free software under the Apache License 2.0 or the MIT licence, at your option.