Closed 1340145680 closed 3 months ago
@mcollina
Please provide a minimal reproducible example. Doing so will help us diagnose your issue. It should be the bare minimum code needed to trigger the issue, and easily runnable without any changes or extra code.
You may use a GitHub repository to host the code if it is too much to fit in a code block (or two).
Sorry, I got the middleware mixed up.
error code
app.use(logger); //pino logger app.use(express.json()); app.use(express.urlencoded({ extended: false }));
correct code
app.use(express.json()); app.use(express.urlencoded({ extended: false })); app.use(logger); //pino logger
The logger must be parsed after the body middleware of the incoming request.
The base framework I use is express
I modified my code according to the Add log request body example
I get the following data on my console, where the raw data type is IncomingMessage
There is indeed body in raw
But I can't get it according to the docs