Closed ScottChapman closed 8 years ago
You could simply add user
to the requestWhitelist
. When it doesn't exist, nothing will get logged out on the whitelisted req
object.
If you specifically want only the sessionID
of user
and nothing else, you could additionally provide a requestFilter
property to the logger options. The body of your requestFilter
function would be something like this:
function(req, propName) {
if (propName === 'user') {
return {sessionID: req[propName].sessionID};
}
}
Closing due to inactivity. I think I've answered the question.
I have some req that come in with session information, and would like to be able to display that. But the value doesn't always exist.
Specifically, when my users are logged in there is a session token I want to display: req.user.sessionID
But the value doesn't always exist...
How would I express that in the msg?