awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
hynek avatar

hynek/structlog

0
View on GitHub↗
4,835 stars·278 forks·Python·20 viewswww.structlog.org↗

Structlog

structlog is a structured logging library for Python that treats log entries as dictionaries instead of strings. This data-centric approach enables machine-readable output and precise data analysis by generating log entries as key-value pairs. It functions as both a standalone logging framework and a compatibility layer that adds structured capabilities to the Python standard library logging module.

The library features a processor-pipeline architecture that passes log dictionaries through a sequence of functions to modify events or add metadata before final rendering. It includes a contextual logging utility for binding key-value metadata to loggers, ensuring traceability across execution boundaries and threads. For high-volume environments, it provides an asynchronous logging framework with awaitable methods to prevent blocking the event loop.

The project covers a broad observability surface, including multi-format rendering for JSON and colorized console output, as well as log volume throttling and severity level filtering. It supports routing processed log data to external services, system journals, and network sockets. Additionally, it includes utilities for automated logging verification to validate that applications emit expected log entries and metadata during testing.

Features

  • Structured Log Capture - Treats log events as dictionaries and captures parameters as key-value pairs for precise querying and serialization.
  • Dictionary-Based Event Representation - Treats log entries as mutable dictionaries instead of strings to enable precise, machine-readable processing throughout the pipeline.
  • Standard Library Adapters - Provides compatibility layers that wrap standard library logging interfaces to inject structured capabilities into existing code.
  • Persistent Log Context - Provides mechanisms to attach predefined key-value pairs to loggers that are automatically included in all subsequent log entries.
  • Multi-Format Renderers - Converts structured log data into various formats including JSON and colorized text for both machine and human consumption.
  • Pipeline Architectures - Utilizes a pipeline architecture that passes log dictionaries through a sequence of independent functions to modify events.
  • Asynchronous Logging - Provides a logging system with awaitable methods to prevent blocking the event loop in high-volume asynchronous environments.
  • Contextual Logging - Provides utilities for binding key-value metadata to loggers to maintain traceability across execution boundaries.
  • Context Attachments - Attaches key-value pairs to a logger so all subsequent entries automatically include the same metadata.
  • Log Processing Pipelines - Passes log dictionaries through a processor pipeline to automatically enrich events with timestamps and call stacks.
  • Structured Logging - Creates machine-readable log entries as key-value pairs to enable precise filtering and automated data analysis.
  • Structured Logging Frameworks - Implements a logging framework that treats log entries as dictionaries for machine-readable output and precise analysis.
  • Log Formatters - Converts structured application events into JSON and logfmt for ingestion by centralized monitoring systems.
  • Console Log Formatting - Formats Python log output as colorized, human-readable text to simplify troubleshooting during active development.
  • Log Target Wrappers - Acts as a wrapper for standard library loggers to add structured capabilities while maintaining compatibility.
  • Console Log Formatters - Transforms structured log data into colorized, human-friendly console output for local development debugging.
  • Asynchronous Metadata Propagation - Passes metadata to background worker threads to maintain traceability across asynchronous execution boundaries.
  • Deferred Log Rendering - Implements a strategy that keeps logs in a structured format until final rendering to optimize processing and flexibility.
  • Thread-Local Context Management - Maintains global state across applications using thread-local storage to ensure log consistency without explicit parameter passing.
  • Severity Level Filtering - Controls which messages are emitted by filtering them based on predefined severity levels.
  • Centralized Logging Systems - Routes structured log data to external services and system journals for unified monitoring in distributed environments.
  • Global Log Contexts - Maintains application-wide shared data using local storage variables to ensure consistent logs across different components.
  • Log Event Filtering - Provides logic to determine whether a log event should be processed or discarded based on content criteria.
  • Log Frequency Throttling - Implements mechanisms to limit the rate of log emission to prevent system flooding during high-volume events.
  • Pluggable Logging Backends - Supports directing processed log data to interchangeable output destinations by decoupling event generation from delivery.
  • Log Message Assertions - Includes utilities to assert that specific log keys and metadata were emitted during automated test execution.
  • Logging - Structured logging framework.
  • Developer Tools - Structured logging for Python.
  • Development Utilities - Structured logging for Python applications.
  • Logging and Output - Structured logging for production-ready applications.

Star history

Star history chart for hynek/structlogStar history chart for hynek/structlog

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Projects sharing features with Structlog

These projects share indexed features with Structlog. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • sirupsen/logrussirupsen avatar

    sirupsen/logrus

    25,736View on GitHub↗

    Logrus is a structured logging library for Go that produces machine-readable output using key-value pairs and JSON formatting. It serves as a pluggable logging framework providing a thread-safe event logger with configurable mutex locking to manage concurrent writes across multiple goroutines. The project distinguishes itself through a pluggable hook system that routes log entries to external services or custom destinations. It also features a contextual logger capable of attaching persistent metadata and request-scoped fields to entries to improve traceability. The framework covers broad ob

    Gogologginglogrus
    View on GitHub↗25,736
  • charmbracelet/logcharmbracelet avatar

    charmbracelet/log

    3,121View on GitHub↗

    This is a structured logging library designed to produce logs using key-value pairs, severity levels, and machine-readable formats. It provides a toolkit for creating logs that are consistent for both human review and machine parsing. The project is distinguished by its focus on terminal visualization, using a styling system to apply colors and prefixes to log entries for improved readability in consoles. It also includes a specialized adapter to convert standard library log calls into structured events by inferring severity levels from message prefixes. The library manages metadata through

    Gogolanglogging
    View on GitHub↗3,121
  • nlog/nlogNLog avatar

    NLog/NLog

    6,542View on GitHub↗

    NLog is an open-source logging framework for .NET that functions as a structured logging library and log routing engine. It captures log events with named parameters as searchable data rather than plain text and directs these messages to various output destinations based on severity and source. The framework is designed as an extensible platform, supporting custom targets, layout renderers, and filters that can be loaded from external assemblies or defined in code. It features a dynamic configuration system that allows logging targets, rules, and layouts to be updated via XML or programmatic

    C#aotaot-compatiblec-sharp
    View on GitHub↗6,542
  • winstonjs/winstonwinstonjs avatar

    winstonjs/winston

    24,478View on GitHub↗

    Winston is a versatile logging library for Node.js designed to record system events and metadata. It functions as a multi-transport log manager that routes data to various destinations and a structured log formatter that transforms entries into JSON or plain text. The project is distinguished by its pluggable transport architecture, which decouples the logging interface from delivery mechanisms. This allows for the creation of custom transport extensions and the use of hierarchical logger instances to inherit configurations while attaching persistent metadata to downstream messages. The libr

    JavaScript
    View on GitHub↗24,478
Compare all 30 related projects→

Frequently asked questions

What does hynek/structlog do?

structlog is a structured logging library for Python that treats log entries as dictionaries instead of strings. This data-centric approach enables machine-readable output and precise data analysis by generating log entries as key-value pairs. It functions as both a standalone logging framework and a compatibility layer that adds structured capabilities to the Python standard library logging module.

What are the main features of hynek/structlog?

The main features of hynek/structlog are: Structured Log Capture, Dictionary-Based Event Representation, Standard Library Adapters, Persistent Log Context, Multi-Format Renderers, Pipeline Architectures, Asynchronous Logging, Contextual Logging.

Which projects share features with hynek/structlog?

Projects with overlapping indexed features include: sirupsen/logrus — Logrus is a structured logging library for Go that produces machine-readable output using key-value pairs and JSON… charmbracelet/log — This is a structured logging library designed to produce logs using key-value pairs, severity levels, and… nlog/nlog — NLog is an open-source logging framework for .NET that functions as a structured logging library and log routing… winstonjs/winston — Winston is a versatile logging library for Node.js designed to record system events and metadata. It functions as a… pinojs/pino — Pino is a high-performance logging library for Node.js applications designed to minimize overhead and prevent blocking… delgan/loguru — Loguru is a Python logging library and thread-safe framework designed for recording system events and diagnostic…