# rust-lang/log

Logging implementation for Rust

Repository: https://github.com/rust-lang/log
Canonical: https://ross.abutalabs.com/products/rust-lang-log
Homepage: https://docs.rs/log
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: rust-library, logging
Last push: 2026-08-22T11:43:35+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 87, longevity 100
- inputs: {"age_days": 4281, "days_push": 11, "days_rel": 11, "gap_med": 31, "n_releases_24m": 12}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2544, forks 287 (observed 2026-08-28T04:06:59.536855+00:00)

## What it is
The `log` crate is a lightweight logging facade for Rust that provides a single logging API abstracting over actual logging implementations. Libraries emit log messages via macros like `error!`, `warn!`, `info!`, `debug!`, and `trace!`, while executables choose a compatible logger implementation to produce output.

## Use cases
- add logging to a Rust library without forcing a logger implementation
- emit structured log messages with levels and targets in Rust code
- swap logging backends like env_logger or log4rs without changing library code
- filter log output by level in Rust applications
- add key-value structured logging to Rust services

## When to choose
- you are writing a Rust library that needs logging without a hard dependency on a specific logger
- you want the de facto standard logging API for the Rust ecosystem
- you need near-zero overhead when no logger is installed

## When to avoid
- you need a ready-made logger with output formatting - pair this crate with an implementation like env_logger or log4rs
- you are not writing Rust code

## Facets
- artifact type: library
- maturity: stable
- function: logging
- domain: developer-tools, backend
- platform: cross-platform, rust
- tags: logging-facade, rust-crate, structured-logging

## Member repositories
- rust-lang/log (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:59.536855+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:25:04.875378+00:00, confidence not recorded.
  - readme: https://github.com/rust-lang/log (fetched 2026-08-28T04:06:59.536855+00:00, sha 66a78f5f6dfc)
  - homepage: https://docs.rs/log (fetched 2026-08-29T10:07:07.867163+00:00, sha f855151dd811)
  - site_page: https://docs.rs/about/badges (fetched 2026-08-29T10:07:07.876988+00:00, sha 6588cac258af)
  - site_page: https://docs.rs/about/builds (fetched 2026-08-29T10:07:07.879235+00:00, sha 811231ca4680)
  - site_page: https://docs.rs/ (fetched 2026-08-29T10:07:07.869852+00:00, sha 9097c140fbda)
  - site_page: https://docs.rs/crate/log/latest (fetched 2026-08-29T10:07:07.871666+00:00, sha e889ccab13c0)
  - site_page: https://docs.rs/crate/log/latest/features (fetched 2026-08-29T10:07:07.873463+00:00, sha 724c93a23f0f)
  - site_page: https://docs.rs/about (fetched 2026-08-29T10:07:07.875007+00:00, sha 29ab7986fbf5)
  - site_page: https://docs.rs/about/metadata (fetched 2026-08-29T10:07:07.881259+00:00, sha 0dcdccb2b2b2)
  - site_page: https://docs.rs/about/redirections (fetched 2026-08-29T10:07:07.882931+00:00, sha 1b1efd93105f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
