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\Honeybadger::new([ 'api_key' => 'Your project API key' ]);

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, // Personal authentication token (needed to synchronize checkins from this configuration file) 'personal_auth_token' => null, // The application environment 'environment_name' => 'production', // To disable exception reporting, set this to false (or an expression that returns false). 'report_data' => ! in_array(env('APP_ENV'), ['local', 'testing']), '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' => [ 'password', 'password_confirmation' ], ], // Application version 'version' => '', // System hostname 'hostname' => gethostname(), // Project root (/var/www) 'project_root' => '', 'handlers' => [ // Enable global exception handler 'exception' => true, // Enable global error handler 'error' => true, ], // Configure the underlying Guzzle client used 'client' => [ // Request timeout in seconds (default: 15s) 'timeout' => 15, // 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' => '', ], ], // Specify a custom endpoint 'endpoint' => '', // Exclude exceptions from being reported 'excluded_exceptions' => [], // Enable reporting deprecation warnings. 'capture_deprecations' => false, // Specify how failures to reach Honeybadger should be handled 'service_exception_handler' => function (\Honeybadger\Exceptions\ServiceException $e) { throw $e; }, // Define your checkins here and synchronize them to Honeybadger 'checkins' => [], ]

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.