Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 612 Bytes

File metadata and controls

21 lines (17 loc) · 612 Bytes

FastAPI Custom Exception Handlers And Logs

This repository demonstrate a way to override FastAPI default exception handlers and logs with your own

Features

  • Add milliseconds time measurements to the requests' logs.
  • Custom HTTPException handler.
  • Custom Request Validation handler - with extra details on the client input data.
  • Custom Unhandled exception handler - with extra details on the error reason.

Setup

poetry install

Start

poetry run uvicorn main:app --reload

Medium Post

https://medium.com/@roy-pstr/fastapi-server-errors-and-logs-take-back-control-696405437983