Configuration Reference

This is the configuration reference table for the pyrollbar SDK. The source code itself can be found on the Github repository.

access_tokenAccess token from your Rollbar project
agent.log_fileIf handler is agent, the path to the log file. Filename must end in .rollbar

Default: `log.rollbar
branchName of the checked-out branch.

Default: None
code_versionA string describing the current code revision/version (i.e. a git sha). Max 40 characters.

Default: None
enabledControls whether or not Rollbar will report any data

Default: True
endpointURL items are posted to.

environmentEnvironment name. Any string up to 255 chars is OK. For best results, use production for your production environment.
exception_level_filtersList of tuples in the form (class, level) where class is an Exception class you want to always filter to the respective level. Any subclasses of the given class will also be matched.

Valid levels: 'critical', 'error', 'warning', 'info', 'debug' and 'ignored'.

Use 'ignored' if you want an Exception (sub)class to never be reported to Rollbar.

Any exceptions not found in this configuration setting will default to 'error'.

Django example (and Django default):

python from django.http import Http404 ROLLBAR = { ... 'exception_level_filters': [ (Http404, 'warning') ] }

In a Pyramid ini file, define each tuple as an individual whitespace delimited line, for example:

rollbar.exception_level_filters = pyramid.exceptions.ConfigurationError critical #...
handlerThe method for reporting rollbar items to

One of:

- default -- uses default handler (thread for sync reporting and async for async reporting)
- blocking -- runs in main thread
- thread -- spawns a new thread
- async -- uses default (httpx) async handler to send the payload
- agent -- writes messages to a log file for consumption by rollbar-agent
- httpx -- uses the HTTPX async library to send the payload
- tornado -- uses the Tornado async library to send the payload
- gae -- uses the Google AppEngineFetch library to send the payload
- twisted -- uses the Twisted event-driven networking library to send the payload

Default: default
localsConfiguration for collecting local variables. A dictionary:
If True, variable values will be collected for stack traces. Default True.
If True, non-built-in objects will be serialized into just their class name. If False repr(obj) will be used for serialization. Default True.
Dictionary of configuration describing the max size to repr() for each type.
maxdict: Default 10
maxarray: Default 10
maxlist: Default 10
maxtuple: Default 10
maxset: Default 10
maxfrozenset: Default 10
maxdeque: Default 10
maxstring: Default 100
maxlong: Default 40
maxother: Default 100
A list of type objects, (e.g. type(my_class_instance) or MyClass) that will be serialized using
repr(). Default []
If True, variable argument values will be scrubbed. Default True.
rootAbsolute path to the root of your application, not including the final /.
scrub_fieldsList of sensitive field names to scrub out of request params and locals. Values will be replaced with asterisks. If overriding, make sure to list all fields you want to scrub, not just fields you want to add to the default. Param names are converted to lowercase before comparing against the scrub list.

Default: ['pw', 'passwd', 'password', 'secret', 'confirm_password', 'confirmPassword', 'password_confirmation', 'passwordConfirmation', 'access_token', 'accessToken', 'auth', 'authentication', 'authorization']
timeoutTimeout for any HTTP requests made to the Rollbar API (in seconds).

Default: 3
allow_logging_basic_configWhen True, logging.basicConfig() will be called to set up the logging system. Set to False to skip this call. If using Flask, you'll want to set to False. If using Pyramid or Django, True should be fine.

Default: True
url_fieldsList of fields treated as URLs and scrubbed.

Default ['url', 'link', 'href']
verify_httpsIf True, network requests will fail unless encountering a valid certificate. Default True.
shortener_keysA list of key prefixes (as tuple) to apply our shortener transform to. Added to built-in list:

[ ('request', 'POST'), ('request', 'json'), ('body', 'request', 'POST'), ('body', 'request', 'json') ]

If locals.enabled is True, extra keys are also automatically added:

[ ('body', 'trace', 'frames', '*', 'code'), ('body', 'trace', 'frames', '*', 'args', '*'), ('body', 'trace', 'frames', '*', 'kwargs', '*'), ('body', 'trace', 'frames', '*', 'locals', '*') ]
suppress_reinit_warningIf True, suppresses the warning normally shown when rollbar.init() is called multiple times.

Default: False.
capture_ipIf equal to True, we will attempt to capture the full client IP address from a request.

If equal to the string anonymize, we will capture the client IP address, but then semi-anonymize it by masking out the least significant bits.

If equal to False, we will not capture the client IP address from a request.

Default: True
capture_emailIf set to True, we will attempt to enrich person data with an email address if available.

Default: False
capture_usernameIf set to True, we will attempt to enrich person data with a username if available.

Default: False
log_all_rate_limited_itemsRollbar will log a warning if you have crossed your limit for logged items.

Default: True
http_proxyThe HTTP proxy host and optional port e.g. ''. This should not include the URL scheme. If set all reports to the Rollbar service will be sent through the proxy.

Default: None
http_proxy_userThe basic auth user to use with the HTTP proxy.

Default: None
http_proxy_passwordThe basic auth password to use with the HTTP proxy. Basic auth will only work if both http_proxy_user and http_proxy_password are present.

Default: None
include_request_bodySet to True to add the raw HTTP request body to the error report. Currently, works with Django, Starlette, and FastAPI.

Default: False
request_pool_connectionsIf not None, used by requests to set the number of urllib3 connection pools to cache.

Default: None
request_pool_maxsizeIf not None, used by requests to set the maximum number of connections to save in the pool.

Default: None
request_max_retriesIf not None, used by requests to set the maximum number of retries each connection should attempt.

Default: None

Help / Support

If you run into any issues, please email us at [email protected]

For bug reports, please open an issue on GitHub.