{"id":51514794,"url":"https://github.com/jamesgober/log-io","last_synced_at":"2026-07-08T10:01:53.868Z","repository":{"id":358752365,"uuid":"1242932051","full_name":"jamesgober/log-io","owner":"jamesgober","description":"Structured logging pipeline for Rust. Zero-allocation fast path, JSON / logfmt / human-readable outputs, context propagation, per-module filtering, async-safe sinks.","archived":false,"fork":false,"pushed_at":"2026-05-18T23:56:10.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T00:50:40.460Z","etag":null,"topics":["async","logging","reps","rust","structured-logging"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesgober.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-18T22:33:36.000Z","updated_at":"2026-05-18T23:56:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jamesgober/log-io","commit_stats":null,"previous_names":["jamesgober/log-io"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jamesgober/log-io","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesgober%2Flog-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesgober%2Flog-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesgober%2Flog-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesgober%2Flog-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesgober","download_url":"https://codeload.github.com/jamesgober/log-io/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesgober%2Flog-io/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35260671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","logging","reps","rust","structured-logging"],"created_at":"2026-07-08T10:01:53.194Z","updated_at":"2026-07-08T10:01:53.862Z","avatar_url":"https://github.com/jamesgober.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n    \u003cimg width=\"99\" alt=\"Rust logo\" src=\"https://raw.githubusercontent.com/jamesgober/rust-collection/72baabd71f00e14aa9184efcb16fa3deddda3a0a/assets/rust-logo.svg\"\u003e\n    \u003cbr\u003e\n    \u003cstrong\u003elog-io\u003c/strong\u003e\n    \u003cbr\u003e\n    \u003csup\u003e\u003csub\u003eSTRUCTURED LOGGING IO PIPELINE FOR RUST\u003c/sub\u003e\u003c/sup\u003e\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://crates.io/crates/log-io\"\u003e\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/log-io.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/log-io\"\u003e\u003cimg alt=\"downloads\" src=\"https://img.shields.io/crates/d/log-io.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.rs/log-io\"\u003e\u003cimg alt=\"docs.rs\" src=\"https://docs.rs/log-io/badge.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/jamesgober/log-io/actions/workflows/ci.yml\"\u003e\u003cimg alt=\"CI\" src=\"https://github.com/jamesgober/log-io/actions/workflows/ci.yml/badge.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/rust-lang/rfcs/blob/master/text/2495-min-rust-version.md\" title=\"MSRV\"\u003e\u003cimg alt=\"MSRV\" src=\"https://img.shields.io/badge/MSRV-1.75%2B-blue\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    Structured log records flow through one pipeline: zero-allocation fast path, multiple output formats, context propagation.\n\u003c/p\u003e\n\n---\n\n## Overview\n\n`log-io` is a structured logging pipeline for Rust. It is not a wrapper\naround `log` or `tracing`. A record flows through three composable\nstages: filter, format, sink. The fast path is allocation-free; the\ndata model is `no_std`-compatible; the crate has zero runtime\ndependencies.\n\n## Install\n\n```toml\n[dependencies]\nlog-io = \"1\"\n```\n\n## Quick start\n\n```rust\nuse log_io::{Level, Logger};\n\nlet logger = Logger::builder()\n    .level(Level::Info)\n    .stdout_json()\n    .build();\n\nlog_io::info!(logger, \"server started\", port = 8080_u32);\nlog_io::warn!(logger, \"slow request\", path = \"/api/users\", ms = 412_u64);\n```\n\n## Features\n\n- **Three output formats**: JSON (line-delimited), logfmt\n  (`key=value`), human-readable (timestamp + aligned level column).\n- **Per-target filtering**: `info, app::auth=debug, hyper=off` style\n  directives, prefix-matched on `::` and `.` boundaries.\n- **Thread-local context**: stash `trace_id` / `request_id` once at\n  the request boundary; every downstream record carries them.\n- **Per-logger default fields**: attach service / version / region\n  once at builder time; every record carries them.\n- **Multi-sink fan-out**: human format on stderr for developer eyes\n  and JSON to a file for ingest, served from one logger.\n- **Source location capture**: macros attach `file!()`, `line!()`,\n  and `module_path!()` to every record.\n- **Zero runtime dependencies**: depends only on `core` and `std`.\n- **`no_std`-compatible data model**: the `Record` / `Format` layer\n  compiles without `std` and can be wired to embedded\n  `core::fmt::Write` destinations.\n- **`#![forbid(unsafe_code)]`** crate-wide.\n\n## Performance\n\n| Workload                            | ns / record |\n|-------------------------------------|------------:|\n| JSON, 5 fields, formatter only      | ~131        |\n| logfmt, 5 fields, formatter only    | ~159        |\n| human, 5 fields, formatter only     | ~210        |\n| Pipeline, 3 fields, JSON + writer   | ~59         |\n| Pipeline, filtered out below thresh | ~1          |\n\nSingle-thread throughput is ~15 M records/sec to a discarding writer;\nscales to ~28 M at four threads. See [`BENCH.md`](BENCH.md) for the\nfull methodology.\n\n## Documentation\n\n- [`docs/API.md`](docs/API.md) - complete API reference with examples.\n- [`REPS.md`](REPS.md) - formal project specification.\n- [`BENCH.md`](BENCH.md) - benchmark methodology and numbers.\n- [docs.rs/log-io](https://docs.rs/log-io) - generated rustdoc.\n\n## Examples\n\nThe [`examples/`](examples) directory contains runnable demos:\n\n| Example          | Topic                                                 |\n|------------------|-------------------------------------------------------|\n| `basic`          | Minimal usage with the human format.                  |\n| `json`           | JSON output to stdout using macros.                   |\n| `context`        | Thread-local trace / request ID propagation.          |\n| `filter`         | Directive-style per-target filtering.                 |\n| `file_sink`      | Writing records to a file.                            |\n| `multi_sink`     | Fanning out one record to several destinations.       |\n| `custom_format`  | Implementing the `Format` trait yourself.             |\n| `custom_sink`    | Implementing the `Sink` trait yourself.               |\n| `default_fields` | Service-level fields attached once at builder time.   |\n\nRun any of them with `cargo run --example \u003cname\u003e`.\n\n## License\n\nLicensed under the Apache License, Version 2.0. See [`LICENSE`](LICENSE)\nfor the full text.\n\n\n\u003c!--\n:: COPYRIGHT\n=============================================== --\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003ch2\u003e\u003c/h2\u003e\n  \u003csup\u003eCOPYRIGHT \u003csmall\u003e\u0026copy;\u003c/small\u003e 2025 \u003cstrong\u003eJAMES GOBER.\u003c/strong\u003e\u003c/sup\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesgober%2Flog-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesgober%2Flog-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesgober%2Flog-io/lists"}