Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /leozw_logs-interceptor-python /examples /fastapi_integration.py
| from fastapi import FastAPI | |
| from logs_interceptor import init, logger | |
| from logs_interceptor.integrations import FastAPIMiddleware | |
| init( | |
| { | |
| "transport": { | |
| "url": "http://localhost:3100/loki/api/v1/push", | |
| "tenantId": "my-tenant", | |
| "compression": "brotli", | |
| }, | |
| "appName": "my-api", | |
| "interceptConsole": True, | |
| "deadLetterQueue": {"enabled": True, "type": "file"}, | |
| } | |
| ) | |
| app = FastAPI() | |
| app.add_middleware(FastAPIMiddleware, logger=logger) | |
| def ping() -> dict[str, str]: | |
| logger.info("ping called") | |
| return {"message": "pong"} | |
Xet Storage Details
- Size:
- 628 Bytes
- Xet hash:
- 6b28632e67c1f01105b0699a661694830ebde00512f7891ead1c2ff64af4bab5
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.