Fastapi Route Log
A FastAPI router for logging every request.
Installation
$ pip install fastapi_log
Dashboard testing
cd fastapi_route_log
uvicorn dev.main:app --reload
check the url: http://localhost:8000/fastapi_dashboard
Credential for Dashboard
Uername : admin
Password : 12345
Code Sample
from fastapi_log.log_request import LoggingRoute
app = FastAPI()
app.router.route_class = LoggingRoute
Example/Test
uvicorn example.main:app --reload
Sample Output
DASHBOARD
Output
{
"type": "request",
"uuid": "e024302b-f11b-4dbb-aadf-46a2ce702411",
"env": null,
"region": null,
"name": null,
"method": "POST",
"useragent": {
"family": "Firefox",
"major": 88,
"minor": 0,
"patch": "88.0",
"device": {
"family": "Other",
"brand": null,
"model": null,
"major": "0",
"minor": "0",
"patch": "0"
},
"os": {
"family": "Ubuntu",
"major": 0,
"minor": 0,
"patch": ""
}
},
"url": "/test",
"query": {},
"body": {
"name": "Prasanna",
"userName": "Karthick",
"age": "NULL",
"Degree": 0
},
"length": null,
"ts": "2021-05-16 22:50:41"
}
{
"type": "metrics",
"uuid": "e024302b-f11b-4dbb-aadf-46a2ce702411",
"env": null,
"region": null,
"name": null,
"method": "POST",
"status_code": 200,
"url": "/test",
"query": {},
"length": "65",
"latency": "0.15",
"ts": "2021-05-16 22:50:41"
}
INFO: 127.0.0.1:35984 - "POST /test HTTP/1.1" 200 OK
More Features are coming up - Keep waiting
Metadata
Release files for fastapi-log 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fastapi_log-0.0.3.tar.gz | 12.3 kB | Without provenance | Details |
Release files / fastapi_log-0.0.3.tar.gz
| Download URL | fastapi_log-0.0.3.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b58906ab26801935b2206f99daec5482f30d48dee6a31a260c4a8cf31952226e
|
|
BLAKE2b-256 checksum How to use checksums |
156fe87d9821a79a7f2ffeb0c6dde7ecc0c48f7f2f985be8ac735f346fba4903
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5
|
Security for fastapi-log 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.