FastAPI Logger: Enhance your FastAPI applications with comprehensive request logging.
Project description
FastAPI Logger is a powerful Python package designed to seamlessly integrate with FastAPI applications, providing advanced request logging capabilities. With FastAPI Logger, you can capture essential details about incoming requests, including sender IP, port, processing time, and more.
Features
- Request Details: Log sender IP, port, request URL, and processing time for each incoming request.
- Customizable Logging: Easily customize the logging behavior to include additional parameters or adapt it to your specific requirements.
- Integration with FastAPI: Integrate the logger seamlessly into your FastAPI application using the provided decorator.
- Efficient and Lightweight: FastAPI Logger is designed to be efficient and lightweight, ensuring minimal impact on the performance of your FastAPI application.
Installation
You can install FastAPI Logger using pip:
pip install fastapi-logger
Usage Getting started with FastAPI Logger is straightforward. Simply import the log_request decorator and apply it to your FastAPI endpoints:
from fastapi import FastAPI, Request
from fastapi_logger.logger import log_request
app = FastAPI()
@app.get("/example")
@log_request
def read_item(request: Request):
# Your endpoint logic here
return {"message": "Hello, World!"}
```
FastAPI Logger empowers you to gain valuable insights into your FastAPI application's traffic and performance effortlessly.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fastapi-logger-0.2.tar.gz
.
File metadata
- Download URL: fastapi-logger-0.2.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d99bdb83dc41ad038d4fadb882165aba862d7fd7035cb3896a10471194e7dfe4 |
|
MD5 | 6a65afe881d29f0e327cca8c20463ebf |
|
BLAKE2b-256 | 0c78cf7aeccd5245b957a1c6d77da18f812787c6fef11a4ba9b9501761407798 |
File details
Details for the file fastapi_logger-0.2-py3-none-any.whl
.
File metadata
- Download URL: fastapi_logger-0.2-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7bda8d4eb193f81c38dc66c0a770176a9a905add661c82d23bca665927b126a |
|
MD5 | 86b2ae1b26b1f3af0215ee2be3ccc332 |
|
BLAKE2b-256 | 0797c7896d09b318024a65d190300f45060c8f29a8d18e56c9afbe4a7a5b59de |