Repository Detail

PyLogShield

PyLogShield extends Python's standard logging module with a production and security layer for applications that handle sensitive data. It automatically masks PII, credentials, and API keys in log output, adds rate limiting to prevent log flooding, supports async emission for high-throughput services, and outputs structured JSON for log aggregation pipelines. A CLI viewer is included for inspecting and filtering logs locally without additional tooling.

PyLogShield security logging library logo

Client-friendly summary

Python logging library with production-grade security features: sensitive data masking, rate limiting, log rotation, async logging, JSON formatting, and a CLI log viewer.

Business use case: Production Python applications that handle sensitive data — PII, credentials, API keys — and need audit-ready logs. Particularly useful in regulated industries where log security is a compliance requirement.

Technical summary: Extends Python's standard logging module with a security-first layer. Implements regex-based sensitive data scrubbing, token bucket rate limiting, rotating file handlers, structured JSON output, and async emission for high-throughput services.

Key Features

  • Sensitive data masking (PII, API keys, credentials)
  • Rate limiting to prevent log flooding
  • Automatic log rotation
  • Async logging for high-throughput services
  • JSON structured output for log aggregation pipelines
  • CLI log viewer for local inspection