Hi Team,
Below is the code how i initialize woodlot in my application.
consider i imported all required libs..
//logger
app.use(woodlot({ streams: ['./log/quotes.log'], stdout: false, routes: { whitelist: ['/','/rest/v1/quotes'], strictChecking: false }, userAnalytics: { platform: true, country: true }, format: { type: 'json', options: { cookies: true, headers: true, spacing: 4, separator: ',' } } }));
and when i hit the endpoint with some text in request body, i am not getting anything in body{ } part.
(POST req to my endpoint, no headers, no auth, in Body, it's just a text type)
the response logged is:
{ "responseTime": "6ms", "method": "POST", "url": "/rest/v1/quotes", "ip": "::1", "body": {}, "params": {}, "query": {}, "httpVersion": "1.1", "statusCode": 200, "timeStamp": "15/Jul/2020:14:27:07 +0000", "contentType": "application/json; charset=utf-8", "contentLength": "56", "userAgent": "PostmanRuntime/7.26.1", "referrer": null, "userAnalytics": {}, "headers": { "content-type": "text/plain", "user-agent": "PostmanRuntime/7.26.1", "accept": "*/*", "postman-token": "94b2a128-84e3-496f-9b2b-f556960ffce7", "host": "localhost:3000", "accept-encoding": "gzip, deflate, br", "connection": "keep-alive", "content-length": "3" }, "cookies": {} },
and you can find body is empty..
but when i change body type to JSON, i am getting the data in body{ } part.
even i tried to change the 'type' field in 'format' section like:
type: 'text', or
type: 'text/html'
i am able to get the logs but body{ } is missing.
am i doing anything wrong ? How can i fix this ?