Skip to content

Commit 41a73f5

Browse files
committed
fixing @timestamp tz to utc
1 parent 40dfa72 commit 41a73f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fastapi_elasticsearch_middleware/elasticsearch_middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async def intercept_send(response):
9393
start_time = time.time()
9494

9595
log_data = {
96-
"@timestamp": datetime.now().replace(tzinfo=timezone.utc).strftime("%Y-%m-%dT%H:%M:%S"),
96+
"@timestamp": datetime.now(tz=timezone.utc).strftime("%Y-%m-%dT%H:%M:%S"),
9797
"environment": self.environment,
9898
"method": request.method,
9999
"path": request.url.path,

0 commit comments

Comments
 (0)