SuperAPI AI Directory

logging

General & other

View repository

Updated 10-15 16:49

About this skill

Logging

Use this skill when adding or standardizing logs across a Litestar app.

Workflow

  1. Configure logging_config at app creation.
  2. Define environment-specific log levels/handlers.
  3. Add request correlation IDs and consistent event fields.
  4. Keep sensitive payloads and secrets out of logs.

Pattern

from litestar import Litestar
from litestar.logging import LoggingConfig

app = Litestar( route_handlers=[], logging_config=LoggingConfig(), )


## Logging Checklist

- Use structured logs in production.
- Include operation name, request ID, and status.
- Avoid duplicate logging between middleware and handlers.
- Reserve stack traces for actionable failure points.

## Litestar References

- https://docs.litestar.dev/latest/usage/logging.html