Skip to content

structured_log

Structured logging for Dart and Flutter, inspired by Python's structlog.

A core library, an in-app log-viewer ecosystem, and — optionally — a self-hosted server. Everything below works entirely on its own, with no server involved at all; add structured_log_server only once you want those logs collected centrally, searchable, and shared across a team.

  1. Add structured_log.

    dependencies:
    structured_log: ^0.2.0
  2. Log.

    import 'package:structured_log/structured_log.dart';
    void main() {
    getLogger().info('user_login', context: {'user_id': 42});
    }
  3. Optionally, watch it live inside your own Flutter app — a headless core plus a ready-made Material/Fluent/Cupertino skin, entirely local, no network involved (full walkthrough: Embedding Guide).

Standalone — these never touch a network

Section titled “Standalone — these never touch a network”

structured_log

Structured JSON logging for Dart — context binding, correlation fields, processors, multi-sink routing. Zero dependencies beyond meta. Usage & API · pub.dev.

structured_log_flutter

A headless in-app log-viewer core for Flutter — a LogBuffer sink and a filterable LogViewerController, no design-system lock-in. Usage & API · pub.dev.

structured_log_material, structured_log_fluent, structured_log_cupertino

Three ready-to-use in-app log viewers on top of it — Material 3, Fluent UI, and Cupertino — each with search and filtering built in. Published on pub.dev.

The self-hosted service — opt in when you need it

Section titled “The self-hosted service — opt in when you need it”

structured_log_http

Ships log entries to structured_log_server over HTTP — batching, retry with backoff, a bounded buffer. Used in the quick start above. Usage & API. Not yet published.

structured_log_server

The self-hosted, multi-tenant server — ingests and stores your apps’ logs, lets you search and tail them live. SQLite or PostgreSQL.

structured_log_admin_client

The web app operators use day to day — dashboard, resource management, live log search, user management, audit log.

Details: Embedding Guide · User Guide · Administrator Guide · Developer Guide · Packages · Architecture