Off the calling thread
fire() checks the level and pushes the record into a 65,536-slot ring buffer. A background thread formats it and does the I/O.
How the engine worksOpen-source Rust library
rlg pushes each 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.
What it does
Each card opens its section on the features page.
fire() checks the level and pushes the record into a 65,536-slot ring buffer. A background thread formats it and does the I/O.
How the engine worksJSON, NDJSON, ECS, GELF, Logstash, OTLP, MCP, logfmt, CLF, CEF, ELF, W3C, Apache and Log4j XML, chosen per record.
See every formatRecords go to os_log on macOS and journald on Linux, and to standard output everywhere else.
Where records gorlg-redact scrubs card numbers, JWTs, bearer tokens, email and IPv4 addresses and AWS keys before a record is written.
What gets scrubbedrlg-otlp ships records over OTLP/HTTP to a local OpenTelemetry Collector, which forwards them to your backend.
How export worksrlg-mcp serves log files to MCP clients as four tools, with a triage prompt, over stdio or HTTP.
What agents can askCommand-line tools
Each installs with cargo install, or comes prebuilt in every GitHub release for macOS, Linux and Windows.
rlg-cli
Filters records by level, component or attribute and converts them into any of the 14 formats.
Filter and convertrlg-report
Summarises a log by level and component, ranks the most frequent messages and computes latency percentiles.
Summarise a logrlg-mcp
An MCP server that lets an AI agent tail, filter and summarise log files. Also published as a container image.
Connect an agentInstall
Initialise once, keep the guard, and fire records from anywhere. rlg needs Rust 1.88 or newer.
use rlg::log::Log;
use rlg::log_format::LogFormat;
fn main() {
// Dropping the guard flushes pending records.
let _guard = rlg::init().unwrap();
Log::info("User authenticated")
.component("auth-service")
.with("user_id", 42)
.format(LogFormat::JSON)
.fire();
}rlg runs its engine under Miri and Loom, fuzzes the inputs it parses, and signs what it releases.
rlg is at 0.0.x and has one maintainer: any release may break your build, and the security page lists what has and has not been checked.
In numbers
Counted from the rlg repository at version 0.0.15.
rlg, the RustLogs project, is a free, open-source structured logging library for Rust. You build a record with a level, a message, a component and typed attributes, then call fire(). fire() checks the level and pushes the record into a 65,536-slot ring buffer; a background thread formats it and writes it to the platform's log: os_log on macOS, journald on Linux, and standard output elsewhere. It is dual-licensed under Apache-2.0 or MIT.
Nine satellite crates, released at the same version as the engine: command-line tools to filter, convert and summarise logs, an MCP server that gives AI agents access to log files, an OpenTelemetry exporter, a redactor for secrets and personal data, access logs for tower services, test helpers and WebAssembly bindings. The features page covers each one.
When you log a few records a second, a background thread and a large buffer buy nothing a synchronous logger does not already give you. When spans are what you analyse, use tracing. When every record must survive a crash, remember that records wait in memory until the background thread writes them. The FAQ lists the other limits.
rlg is written by Sebastien Rousseau. The source, the issue tracker and every release are on GitHub; the crates are on crates.io. Read more on the about page.