litestar-logging

Installation
SKILL.md

Logging

Execution Workflow

  1. Choose the logging backend first: stdlib logging, picologging, Structlog, or a custom config subclass.
  2. Configure logging once at app setup with logging_config or the Structlog plugin.
  3. Use Litestar's non-blocking queue_listener handler unless a concrete reason requires otherwise.
  4. Decide when exceptions should be logged and which stack traces should be suppressed.
  5. Standardize request and app logger usage so fields, levels, and redaction rules stay consistent.
  6. Validate that logs remain actionable without leaking sensitive data.

Core Rules

  • Keep logging configuration centralized at app construction.
  • Prefer the built-in non-blocking queue_listener handler for async applications.
  • Treat exception logging policy as an explicit decision; Litestar does not log exceptions by default outside debug mode.
  • Use disable_stack_trace for expected exception types or status codes that should not spam traces.
  • Keep secrets, auth material, and sensitive request data out of logs.
  • Avoid duplicate logging across middleware, exception handlers, and business code.
Related skills

More from alti3/litestar-skills

Installs
22
GitHub Stars
5
First Seen
Mar 2, 2026