There are several ways to configure Honeybadger. See Default Configuration for all the options that are available.

Creating a New Client

In any PHP app, you can configure a new Honeybadger client directly via its constructor function:

$honeybadger = Honeybadger::new([
    'api_key' => 'abc123'

Using Honeybadger this way is good for creating custom integrations or adding Honeybadger to frameworks which don't have an official integration yet.


In Laravel and Lumen apps, you should add your configuration to config/honeybadger.php instead.

Default Configuration

The default configuration options are shown below:

    // Honeybadger API Key
    'api_key' => null,

    'environment' => [
        // Environment keys to filter before the payload sent to Honeybadger (see Environment Whitelist)
        'filter' => [],

        // Additional environment keys to include (see Environment Whitelist)
        'include' => [],

    'request' => [
        // Request keys to filter before the payload sent to Honeybadger
        'filter' => [

    // Application version
    'version' => '',

    // System hostname
    'hostname' => gethostname(),

    // Project root (/var/www)
    'project_root' => '',

    // Application environment name
    'environment_name' => 'production',

    'handlers' => [
        // Enable global exception handler
        'exception' => true,

        // Enable global error handler
        'error' => true,
    'client' => [
        // Request timeout length (default: indefinite)
        'timeout' => 0,

        // Request proxy settings
        'proxy' => [
            // Use this proxy with 'http' (tcp://username:password@localhost:8125)
            'http'  => '',

            // Use this proxy with 'https' (tcp://username:password@localhost:8125)
            'https' => '',

    // Exclude exceptions from being reported
    'excluded_exceptions' => [],

Environment Whitelist

All keys beginning with HTTP_ are reported by default, as well as the following whitelisted keys:



If there is an error contacting Honeybadger a \Honeybadger\Exceptions\ServiceException::class will be thrown with a relevant exception message.