Skip to main content

FastAPIRichLogger

Description

FastAPIRichLogger is a robust and visually appealing logging system for FastAPI applications. Utilizing the power of the rich library, it enhances the standard logging capabilities with color-coded log levels, detailed request-response data, and a user-friendly format that improves both readability and debugging.

Installation

Install FastAPIRichLogger with pip:

pip install fastapirichlogger

Usage

To use FastAPIRichLogger in your FastAPI application, follow these steps:

  1. Import FastAPIRichLogger:

    from fastapirichlogger import FastAPIRichLogger
    
  2. Add Middleware to FastAPI:

    app = FastAPI()
    app.add_middleware(FastAPIRichLogger)
    

Features

  • Color-Coded Logging: Easily distinguish between different log levels thanks to color coding.
  • Request-Response Details: Logs include detailed information about HTTP requests and responses.
  • Execution Time Tracking: Monitor the time taken for each request to process.
  • Automatic Log ID Assignment: Each request gets a unique log identifier for easier tracking.

Example Images

Below are example images showing the FastAPIRichLogger in action:

  • Success Log Example: Success Log

  • Error Log Example: Error Log

Contributing

Contributions are what make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.md for more information.

Contact

Kevin Saltarelli - kevinqz@gmail.com

Project Link: https://github.com/kevinqz/fastapirichlogger

Release files for fastapirichlogger 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastapirichlogger 0.1.4
File Size Uploaded
fastapirichlogger-0.1.4.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastapirichlogger 0.1.4
File Interpreter ABI Platform
fastapirichlogger-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / fastapirichlogger-0.1.4.tar.gz

Download URL fastapirichlogger-0.1.4.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4f4d1d76c2736d011361f433111b0e81769edec7ae20c01c71da70f41ad77520
BLAKE2b-256 checksum
How to use checksums
350de8cc27761857c95ce179f28c837e3d2007af4277c739157f3d56dcb464e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.14

Release files / fastapirichlogger-0.1.4-py3-none-any.whl

Download URL fastapirichlogger-0.1.4-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
792c50633e8ea9b0027b5f3934e565677343cf7926410f0afb8064e0cfaa11a3
BLAKE2b-256 checksum
How to use checksums
42aa5f148a20d0b0f3eb849a8963f065691b83810aff3e7c87bb56007e2b0e89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.14

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page