fix(api): add req id to logs (#60191)

This commit is contained in:
Mrugesh Mohapatra
2025-05-06 22:20:31 +05:30
committed by GitHub
parent 008e35d851
commit d0e63c60ca
+3 -1
View File
@@ -24,6 +24,7 @@ const serializersPretty = {
const serializersDefault = {
req: (req: FastifyRequest) => {
const id = req.id || 'ID not found';
const method = req.method || 'METHOD not found';
const url = req.url || 'URL not found';
const xForwardedFor = Array.isArray(req.headers['x-forwarded-for'])
@@ -45,7 +46,8 @@ const serializersDefault = {
REQ_IP: ip,
REQ_USER_AGENT: userAgent,
REQ_COUNTRY: country,
REQ_QUERY: query
REQ_QUERY: query,
REQ_ID: id
};
},
res: (reply: FastifyReply) => {