Open ivansantosz opened 5 years ago
I know it's not the perfect way, but I use the following code to solve this problem.
app.use(async (ctx, next) => {
ctx.req.body = ctx.request.body;
await next();
});
app.use(
logger({
serializers: {
err: pino.stdSerializers.err,
req: (req) => {
req.body = req.raw.body;
return req;
},
res: pino.stdSerializers.res,
},
}),
);
Right now it only pass
ctx.req
down to pino http.Things like
ctx.request.body
are left out.Was that intentional?