Skip to main content

An awesome logger for FastAPI.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapirichlogger-0.1.4.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

fastapirichlogger-0.1.4-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file fastapirichlogger-0.1.4.tar.gz.

File metadata

  • Download URL: fastapirichlogger-0.1.4.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.14

File hashes

Hashes for fastapirichlogger-0.1.4.tar.gz
Algorithm Hash digest
SHA256 4f4d1d76c2736d011361f433111b0e81769edec7ae20c01c71da70f41ad77520
MD5 e8a3d8982cc25739cd090e19a64899be
BLAKE2b-256 350de8cc27761857c95ce179f28c837e3d2007af4277c739157f3d56dcb464e8

See more details on using hashes here.

File details

Details for the file fastapirichlogger-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapirichlogger-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 792c50633e8ea9b0027b5f3934e565677343cf7926410f0afb8064e0cfaa11a3
MD5 1306d4293fd0957140300b0be878b77c
BLAKE2b-256 42aa5f148a20d0b0f3eb849a8963f065691b83810aff3e7c87bb56007e2b0e89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page