Open priyank-R opened 1 year ago
As a solution for now, I'm using the serializers
options available in pino-http to manually delete req.headers
and res.headers
from the log object.
logger({
logger: customPinoLogger,
autoLogging: true,
customProps: (req, res) => {
return {
user: req.user
? { _id: req.user?._id, name: req.user?.name, email: req.user?.email }
: undefined,
};
},
serializers: {
req (req) {
delete req['headers']
return req
},
res (res){
delete res?.['headers']
return res
}
}
}),
Currently, when I try to integrate pino-http on my express application with pino-elasticsearch, everything is being forwarded to elasticsearch. My elasticsearch object looks like this:
However, I just want to forward some of the properties, and ignore the rest. I want the object to look like this:
Currently, no option available to achieve this in
pino-elasticsearch
. We need something available toignore
option available inpino-pretty
.