Filtering Sensitive Data

Honeybadger allows you to inspect and filter all data that is sent to our servers at the time of an error using a Honeybadger.beforeNotify handler.

For example, to filter the URL of the current page when it contains a sensative param name:

Honeybadger.beforeNotify(function(notice) {
  if (/creditCard/.test(notice.url)) {
    notice.url = '[FILTERED]';
  }
});

The following notice properties are available in beforeNotify handlers:

  • stack - The stack trace
  • name - The exception class name
  • message - The error message
  • url - The current url
  • projectRoot - The root url
  • environment - Name of the environment. example: "production"
  • component - Similar to a rails controller name. example: "users"
  • action - Similar to a rails action name. example: "create"
  • fingerprint - A unique fingerprint, used to customize grouping of errors in Honeybadger.
  • context - The context object.
  • params - An object of request parameters.
  • cookies - An object of cookie key/values. May also be sent as a string in the document.cookie "foo=bar;bar=baz" format.