# Cysharp/ZLogger

Zero Allocation Text/Structured Logger for .NET with StringInterpolation and Source Generator, built on top of a Microsoft.Extensions.Logging.

Repository: https://github.com/Cysharp/ZLogger
Canonical: https://ross.abutalabs.com/products/zlogger
Language: C#
License: MIT
License Family: permissive
Last push: 2026-07-08T03:26:07+00:00

## Health v2 (maintenance only)
Score: 75/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 91, release rhythm 40, longevity 100
- inputs: {"age_days": 2353, "days_push": 56, "days_rel": 604, "gap_med": 23.0, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1763, forks 127 (observed 2026-08-28T04:05:32.939661+00:00)

## What it is
ZLogger is a zero-allocation text and structured logging library for .NET and Unity, built on top of Microsoft.Extensions.Logging. It uses C# 10 interpolated string handlers and source generators to format logs directly in UTF8, avoiding boxing and encoding overhead for maximum performance.

## Use cases
- fast structured logging for ASP.NET Core apps
- zero-allocation logging in high-throughput .NET services
- cloud-native console logging for containers
- efficient file logging without per-write flush overhead
- logging in Unity games with Microsoft.Extensions.Logging
- output structured JSON logs via System.Text.Json

## When to choose
- you need the fastest possible logging with minimal allocations in .NET
- your app already uses Microsoft.Extensions.Logging and you want to avoid bridge overhead
- you want both text and structured (JSON) log output with the same API
- you run .NET 8+ or Unity and want interpolated-string-based logging

## When to avoid
- you need a logger with a large ecosystem of third-party sinks and integrations
- your target runtime is older than .NET 8 and you need the latest performance features
- you prefer configuration-driven logging APIs over interpolated string syntax

## Facets
- artifact type: library
- maturity: active
- function: logging, serialization
- domain: developer-tools, backend, performance
- platform: dotnet, cross-platform
- tags: zero-allocation, structured-logging, microsoft-extensions-logging, source-generator, unity, utf8, high-performance

## Member repositories
- Cysharp/ZLogger (main) score 75

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:32.939661+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-30T03:26:44.555903+00:00, confidence not recorded.
  - readme: https://github.com/Cysharp/ZLogger (fetched 2026-08-28T04:05:32.939661+00:00, sha ccdeaa29d349)
- Data as of 2026-08-30T08:39:29.467469+00:00.
