Skip to content

roy-pstr/fastapi-custom-exception-handlers-and-logs

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages