Skip to content

Commit

Permalink
Docs(http-logger): updae docs for picking properties you want to log
Browse files Browse the repository at this point in the history
  • Loading branch information
ThulinaWickramasinghe committed May 10, 2024
1 parent 31db152 commit 99194c6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/http-logger/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ app.use(httpLogger({
}));

// or
import { pick, omit} from 'loadash';

app.use(httpLogger({
whitelists: ["/public/*"],
loggable: ({headers, body} => {
loggable: ( (req) => {
// Pick the properties you want to log
return {
headers,
body
headers: pick(req.headers, ['x-user-email', 'user-agent']),
payload: omit(req.body, ['password', 'new_password', 'old_password'])
}
}),
}));
Expand Down

0 comments on commit 99194c6

Please sign in to comment.