Closed awwong1 closed 5 years ago
use bodyBlacklist
/ bodyWhitelist
for that. make sure your logger is after body-parser
@awwong1 It looks like your requestFilter
is returning an object instead of a value, as it is intended, which may be messing with your output. What if you tried the following:
const requestFilter = (req, propName) => {
if (propName === "body") {
const newBody = {
operationName: "NO-OP",
...((req || {})[propName] || {}),
};
delete newBody.variables;
return newBody[propName]
}
return req[propName];
};
Thanks for the reply, I've moved away from using express-winston. I'll close this issue due to the two provided solutions (I haven't verified)
I am having issues filtering out requests.
Dependencies
Verified this happening on Node v9.2.0 (stable) and Node v8.10.0 (lts).
Issue
Given the following configuration:
Expected Output
I expect my
req.body
to remove thevariables
property and have a default property set foroperationName
:Actual Output
Unforunately
req.body
keeps thevariables
property:Also
req.body
does not set a default value foroperationName
:Links