Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 2.09 KB

File metadata and controls

70 lines (46 loc) · 2.09 KB

Rollbar Logback

Build Status

This is a fork of the ahaid's Rollbar Logback Appender created on July 27th, 2014 for use with the error aggregation service Rollbar. You will need a Rollbar account: sign up for an account here.

Logback

<appender name="ROLLBAR" class="com.tapstream.rollbar.RollbarAppender">
    <apiKey>[YOUR APIKEY HERE]</apiKey>
    <environment>local</environment>
</appender>

<root level="debug">
	<appender-ref ref="ROLLBAR"/>
</root>

Appender parameters:

Providing the API key externally

You can choose to set the API key by using an environment variable. This way your API key stays out of your code and your source control repository.

Create the environment variable ROLLBAR_LOGBACK_API_KEY and set its value to your API key. This value will override the value set in logback.xml (if set).

Custom MDC parameters

Any MDC values with keys that do not start with RollbarFilter.REQUEST_PREFIX will be added as custom parameters to the Rollbar item request.

Servlet Filter

Located at com.tapstream.rollbar.logback.RollbarFilter is a J2EE servlet filter that will populate the request portion of the Rollbar item from a ServletRequest. The filter will include:

  • Remote IP address
  • User agent
  • Method
  • URL
  • Query String
  • Headers
  • Parameters

Acknowledgements

This library has been inspired by: