Skip to content

Commit 0a8a635

Browse files
author
Christian Hotz
authored
Merge pull request #28 from hydra-newmedia/capture-body-docs
add some docs to capture the body. closes #10
2 parents e57c372 + adb35dd commit 0a8a635

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,17 @@ server.route({
7272
},
7373
});
7474
```
75+
76+
## Capturing the request body
77+
78+
`hapi-sentry` currently does not capture the body for performance reasons. You can use the following snippet to capture the body in all sentry errors:
79+
80+
```js
81+
server.ext({
82+
type: 'onRequest',
83+
method(request, h) {
84+
request.payload && request.sentryScope.setExtra('payload', request.payload);
85+
return h.continue;
86+
},
87+
});
88+
```

0 commit comments

Comments
 (0)