fastapi-utils icon indicating copy to clipboard operation
fastapi-utils copied to clipboard

Timing middleware: add support for alternate message formatters

Open cahna opened this issue 5 years ago • 1 comments

Hi, and thanks for the great library of utils! I needed support for structured log messages to avoid writing custom parser logic in my app's log aggregation service (Datadog). If you are interested in including such support, this PR is how I implemented that. Backwards-compatible changes:

  • Add support for an optional message_formatter argument to add_timing_middleware()
  • Test coverage for new feature
  • Documentation for new feature
  • Fix CONTRIBUTING.md to reference make docs-live

cahna avatar Dec 09 '20 19:12 cahna

This is exactly what I need, I hope it gets merged soon :) @dmontagu

julyvee avatar Dec 11 '23 15:12 julyvee