---
title: Reducing noise
description: Learn how to ignore exceptions and reduce alert fatigue in your php applications.
url: https://docs.honeybadger.io/lib/php/errors/reducing-noise/
---

Sometimes there are errors that you would rather not send to Honeybadger because they are not actionable or are handled internally.

In Honeybadger, you can [ignore exceptions by type](https://docs.honeybadger.io/lib/php/errors/reducing-noise/#ignoring-exceptions-by-type) using the built-in `excluded_exceptions` configuration option, as well as the `$dontReport` option in [Laravel](https://docs.honeybadger.io/lib/php/errors/reducing-noise/#laravel). You can also disable error reporting in all or some environments.

## Ignoring exceptions by type

There may be some types of exceptions which you never want to report. To ignore them, use the `excluded_exceptions` [configuration option](https://docs.honeybadger.io/lib/php/reference/configuration/):

```php
[
    'excluded_exceptions' => [
      SomeException::class,
      AnotherException::class,
    ],
]
```

### Laravel

If you’re using [Laravel](https://docs.honeybadger.io/lib/php/integration/laravel/), Honeybadger respects the `$dontReport` property of Laravel’s [exception handler](https://laravel.com/docs/5.6/errors/#the-exception-handler) when automatically reporting exceptions during web requests. This means that any exceptions which are ignored by Laravel will also be ignored by Honeybadger. You may add other exception types to this array as needed:

app/Exceptions/Handler.php

```php
/**
 * A list of the exception types that should not be reported.
 *
 * @var array
 */
protected $dontReport = [
    \Illuminate\Auth\AuthenticationException::class,
    \Illuminate\Auth\Access\AuthorizationException::class,
    \Symfony\Component\HttpKernel\Exception\HttpException::class,
    \Illuminate\Database\Eloquent\ModelNotFoundException::class,
    \Illuminate\Validation\ValidationException::class,
];
```

Keep in mind that Honeybadger will still report exceptions on this list if they are reported *outside* of Laravel’s exception handler, such as when [reporting handled exceptions](https://docs.honeybadger.io/lib/php/errors/reporting-errors#reporting-handled-exceptions/).

## Ignoring exceptions programmatically

You can use the `beforeNotify` callback to ignore exceptions programmatically. This callback is called before an exception is sent to Honeybadger. If the callback returns `false`, the exception will not be reported.

For example, you can ignore exceptions based on the exception message:

```php
$honeybadger->beforeNotify(function (&$notice) {
    if (strpos($notice['error']['message'], 'Ignore this exception') !== false) {
        return false;
    }
});
```

Or, you may modify the fingerprint of the exception to group it with other similar exceptions:

```php
$honeybadger->beforeNotify(function (&$notice) {
    $notice['error']['fingerprint'] = 'MyFingerprint';
});
```

**Note**: You can register multiple `beforeNotify` callbacks. If any of them return `false`, the exception will not be reported.

### Notice properties

The `$notice` parameter is an associative array that contains the following keys:

* `breadcrumbs`

  * `enabled`: Indicates if breadcrumbs are enabled, fetched from the configuration

  * `trail`: The breadcrumb trail converted to an array of associative arrays, each containing:

    * `message`: The message of the breadcrumb
    * `category`: The category of the breadcrumb
    * `metadata`: An associative array of metadata for the breadcrumb
    * `timestamp`: The timestamp of the breadcrumb

* `error`

  * `class`: The type of the exception.
  * `message`: The exception message.
  * `backtrace`: The backtrace of the exception.
  * `causes`: The previous exceptions in the backtrace.
  * `fingerprint`: A grouping identifier for the error, if provided.
  * `tags`: Tags associated with the error, wrapped in an array.

* `request`

  * `cgi_data`: CGI data from the environment, or an empty object if not available.
  * `params`: Request parameters, or an empty object if not available.
  * `session`: Session data, or an empty object if not available.
  * `url`: The request URL.
  * `context`: Context data or an empty object if not available.
  * `component`: The component name, either from additional parameters or context.
  * `action`: The action name, either from additional parameters or context.

* `server`

  * `pid`: The process ID.
  * `version`: The application version.
  * `hostname`: The hostname of the server.
  * `project_root`: The root directory of the project.
  * `environment_name`: The name of the environment.

## Disabling error reporting

You can disable error reporting completely by setting the `report_data` config option to false. For example, the default Laravel config has this as:

```php
'report_data' => ! in_array(env('APP_ENV'), ['local', 'testing']),
```

This means exceptions won’t be reported to Honeybadger in `local` and `testing` environments. If you want to change that, you can easily add or remove environments or set `report_data` to `true`.

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
