Skip to content

Commit e27d70e

Browse files
committed
Log GeoIP lookup requests
1 parent 9ec1c6a commit e27d70e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/geoip/src/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ async def health(response: Response) -> HealthResponse:
5757
@app.post("/v1/lookup", response_model=LookupResponse)
5858
async def lookup(payload: LookupRequest) -> LookupResponse:
5959
try:
60+
logger.info("getting info for %s", payload.ip)
6061
return await asyncio.to_thread(app.state.geoip_manager.lookup, payload.ip)
6162
except RuntimeError as error:
6263
raise HTTPException(status_code=503, detail=str(error)) from error
@@ -70,4 +71,3 @@ async def lookup(payload: LookupRequest) -> LookupResponse:
7071
if __name__ == "__main__":
7172
settings = Settings.from_env()
7273
uvicorn.run("src.main:app", host="0.0.0.0", port=settings.port)
73-

0 commit comments

Comments
 (0)