Configuration Reference
Configuration options for rollbar-php
All of the following options can be passed as keys in the $config
array.
| Your project access token. |
| Path to the directory where agent relay log files should be written. Should not include final slash. Only used when handler is Default: |
| If the branch option is not set, we will attempt to call out to git to discover the branch name via the php Default: |
| The SDK will automatically detect what Git branch you are running. This is assuming that you use Git branches in your deployment process. This configuration option requires Default: |
| Deprecated (endpoint instead). Default: |
| The Git branch you are running. Default: |
| Track user's email address. Pursuant to General Data Protection Regulation (GDPR) (EU) 2016/679 this option is set to Default: |
| Track user's IP address. Default: |
| Track user's username. Pursuant to General Data Protection Regulation (GDPR) (EU) 2016/679 this option is set to Default: |
| Record full stacktraces for PHP errors. Default: |
| Function called before sending payload to Rollbar, return true to stop the error from being sent to Rollbar. Default: Parameters:
Example::
|
| The currently-deployed version of your code/application (e.g. a Git SHA). Should be a string. Default: empty string |
| An array of key/value pairs which will be merged with the custom data in the final payload of all items sent to Rollbar. This allows for custom data to be added globally to all payloads. Any key in this array which is also present in the custom data passed to a log/debug/error/... call will have the value of the latter. |
| Allows creating dynamic custom data on runtime during error reporting. The callable taking two parameters Default: null |
| A fully qualified name of your custom truncation strategy class. It has to inherit from Default: |
| The path to the SSL certificate used when communicating with Rollbar API through the CURL sender. default: |
| Enable or disable Rollbar in your project. This can be changed at runtime with If this is |
| The API URL to post to. Note: the URL must end with a trailing slash. Default: |
| Environment name, e.g. Default: |
| Associative array mapping error numbers to sample rates. Sample rates are ratio out of 1, e.g. 0 is "never report", 1 is "always report", and 0.1 is "report 10% of the time". Sampling is done on a per-error basis. Default: empty array, meaning all errors are reported. Example usage:
|
| Associative array mapping exception classes to sample rates. Sample rates are ratio out of 1, e.g. 0 is "never report", 1 is "always report", and 0.1 is "report 10% of the time". Sampling is done on a per-exception basis. It also respects class inheritance meaning if Exception is at 1.0 then ExceptionSublcass is also at 1.0, unless explicitly configured otherwise. If ExceptionSubclass is set to 0.5, but Exception is at 1.0 then Exception and all its' subclasses run at 1.0, except for ExceptionSubclass and its' subclasses which run at 0.5. Names of exception classes should NOT be prefixed with additional Default: empty array, meaning all exceptions are reported. Example usage:
|
| Either an Default: |
| The port on which the fluentd instance is listening on. If you use a unix socket this setting is ignored. Default: |
| The tag of your fluentd filter and match sections. It can be any string, please consult the fluentd documentation for valid tags. Default: |
| Either Default: |
| Server hostname. Default: |
| A bitmask that includes all of the error levels to report. E.g. (E_ERROR | E_WARNING) to only report E_ERROR and E_WARNING errors. This will be used in combination with Default: |
| A boolean that indicates you wish to gather code context for instances of PHP Errors. This can take a while because it requires reading the file from disk, so it's off by default. Default: |
include_exception_code_context | A boolean that indicates you wish to gather code context for instances of PHP Exceptions. This can take a while because it requires reading the file from disk, so it's off by default. Default: |
| Include the raw request body from php://input in payloads. Default: |
| Boolean that determines whether backtraces include arguments passed to stack frames. Default: |
| Log the payload body to the configured If this is Default: |
| Use this configuration option to override the default logger used by Note: if you're overriding the logger keep in mind the actual log method is invoked at the Default: an instance of |
| The minimum level of occurrences that will be reported to Rolllbar. Default: |
| An associative array containing data about the currently-logged in user. Required: |
| A function reference (string, etc. - anything that call_user_func() can handle) returning an array like the one for 'person'. Example usage:
|
| Send data via a proxy server. E.g. Using a local proxy with no authentication
E.g. Using a local proxy with basic authentication
Default: No proxy |
| The SDK can be configured to raise exceptions passed to logging methods after reporting to Rollbar. Thanks to this users can make the code below swallow exceptions in production, but throw them in test and dev environments:
Default: |
| Sets whether errors suppressed with '@' should be reported or not Default: |
| Path to your project's root dir |
| An array of field names to scrub out of the entire payload excluding the top level Note: watch out to not overlap scrub fields with the keys of the Rollbar API request format. For example, scrubbing for field Default: |
| Array of fields that you do NOT want to be scrubbed even if they match entries in scrub_fields. Entries should be provided in associative array dot notation, i.e. |
| Request timeout for posting to rollbar, in seconds. Default: |
| Should the SDK actually perform HTTP requests to Rollbar API. This is useful if you are trying to run Rollbar in dry run mode for development or tests. If this is Default: |
| Sets whether to respect current Default: |
| Should backtrace be include with string messages reported to Rollbar Default: |
| The class to be used to transform the payload before it gets prepared for sending to Rollbar API. It has to implement For a detailed example, check out our examples repository. |
| This configuration option controls the verbosity of the internal logs of the SDK. Acceptable values are the levels outlined by The Syslog Protocol and PSR-3 plus
Default: |
| Use this configuration option to override the default logger used by Default: an instance of |
| Maximum depth for serialization of payloads. If set to Default: |
| Maximum number of items sent in a single app request/response cycle. Currently there is no "unlimited" option, set a high value for this number if you want to allow all occurrences to be sent. PHP network activity will block the main app thread so the default limit is low for this setting. Default: |
For more information on rollbar-php, please see the docs here.
Updated 6 months ago