You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have cases where I need to call Rollbar directly in my express code without relying on the middleware error handler. Which means I don't have access to the request object by default. So what I do is create a top-level middleware function that adds the request object to the Rollbar payload as the first order of business.
However when I do this, none of the scrubFields options are respected.
The text was updated successfully, but these errors were encountered:
The transform function in the Rollbar config runs after the scrubber. Data added or modified there needs to be safe, or redacted as needed by the user function.
To send the request object and have it redacted by the scrubber, it should be passed as an argument to Rollbar.error().
Rollbar.error(err,request)
This works if:
The request object is the first object or array argument. For example, if you pass a custom data object, put the request first.
The object must have at least one of these keys present: 'headers', 'protocol', 'url', 'method', 'body', 'route'
I have cases where I need to call Rollbar directly in my express code without relying on the middleware error handler. Which means I don't have access to the request object by default. So what I do is create a top-level middleware function that adds the request object to the Rollbar payload as the first order of business.
However when I do this, none of the scrubFields options are respected.
The text was updated successfully, but these errors were encountered: