{"categories":[{"label":"Monitoring","url":"https://skillfed.io/packages/category/system-monitoring/4"}],"enrichment":{"capability":"A logging handler that sends Python log messages to Grafana Loki in JSON format, with support for custom labels, batch publishing, and compression.","skillfed_tags":["logging","grafana-loki","log-aggregation"],"use_cases":["Centralize application logs from multiple Python services into a single Loki instance for unified querying and monitoring.","Add structured metadata (user IDs, trace IDs, request codes) to logs for filtering and correlation in Grafana dashboards.","Replace file-based logging with cloud-native log aggregation in containerized or serverless deployments.","Batch and compress logs before sending to reduce network bandwidth and Loki ingestion costs.","Integrate loguru-based applications with Loki without rewriting logging code."],"what_it_does":"loki-logger-handler is a Python logging handler that bridges the standard logging module (and optionally loguru) to Grafana Loki, a log aggregation system. It formats log messages as JSON, attaches custom labels for filtering and querying, and sends them to a Loki server in batches, optionally compressed. The handler automatically includes log metadata like timestamps, process IDs, thread IDs, and function names; you can also attach custom fields via logging extras, which become searchable keys in the JSON payload.\n\nThe package supports both Python's built-in logging and the loguru library, with separate formatters for each. It includes options for basic authentication, custom headers, configurable timeouts, and Loki 3.0 structured metadata. Logs are buffered and flushed either when the buffer fills or after a timeout, reducing network overhead. The handler runs as a background thread, so it does not block your application.","worth_installing":"Yes, if you are already running Grafana Loki and need a straightforward Python logging integration. The package has no runtime dependencies, low install friction, and a permissive license. However, note that maintenance is aging (last update 2025-05-26, last commit 2026-01-09); if you require active support or plan to use Loki 3.0 structured metadata in production, verify compatibility first or be prepared to maintain a fork."},"id":"loki-logger-handler","links":{"html":"https://skillfed.io/packages/loki-logger-handler","md":"https://skillfed.io/packages/loki-logger-handler.md","pypi":"https://pypi.org/project/loki-logger-handler/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2025-05-26","license_spdx":null,"license_treatment":"permissive","name":"loki-logger-handler","python_support":"supports_current","summary":"Handler designed for transmitting logs to Grafana Loki in JSON format."},"popularity":{"monthly_downloads":122742,"position":11936,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.1.2"}
