fix(api): update logging (#60210)

This commit is contained in:
Mrugesh Mohapatra
2025-05-07 15:30:32 +05:30
committed by GitHub
parent 8e86fac378
commit 8a6fcd70db
2 changed files with 12 additions and 4 deletions

View File

@@ -19,6 +19,12 @@ const serializersPretty = {
REQ_METHOD: req.method,
REQ_URL: req.url
};
},
res: (res: FastifyReply) => {
return {
RES_STATUS_CODE: res.statusCode,
RES_ELAPSED_TIME: res.elapsedTime
};
}
};
@@ -50,10 +56,10 @@ const serializersDefault = {
REQ_ID: id
};
},
res: (reply: FastifyReply) => {
res: (res: FastifyReply) => {
return {
RES_STATUS_CODE: reply.statusCode,
RES_RESPONSE_TIME: reply.elapsedTime
RES_STATUS_CODE: res.statusCode,
RES_ELAPSED_TIME: res.elapsedTime
};
}
};