Skip to content

Commit

Permalink
log request body
Browse files Browse the repository at this point in the history
  • Loading branch information
sspenst committed Mar 22, 2024
1 parent 9d430c0 commit 99366c1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/withAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ export default function withAuth(
}

try {
// dynamically import newrelic
const newrelic = process.env.NODE_ENV === 'test' ? undefined : await import('newrelic');

if (!isLocal()) {
newrelic?.addCustomAttribute && newrelic.addCustomAttribute('request.body', req.body);
}

const reqUser = await getUserFromToken(token, req);

if (reqUser === null) {
Expand Down

0 comments on commit 99366c1

Please sign in to comment.