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.
<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:
- url: The Rollbar API url. Default: https://api.rollbar.com/api/1/item/
- apiKey: The rollbar API key. Mandatory.
- environment: Environment. i.e. production, test, development. Mandatory.
Any MDC values with keys that do not start with RollbarFilter.REQUEST_PREFIX
will be added as custom parameters to
the Rollbar item request.
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
Inline:
<appender name="ROLLBAR" class="com.tapstream.rollbar.RollbarAppender">
<apiKey>my-key</apiKey>
<environment>my-app</environment>
<serverIp>1.2.3.4</serverIp>
<serverName>my-machine</serverName>
</appender>
Environment variables:
<appender name="ROLLBAR" class="com.tapstream.rollbar.RollbarAppender">
<apiKey>${ROLLBAR_API_KEY}</apiKey>
<environment>my-app</environment>
<serverIp>${HOST_LOCAL_IP}</serverIp>
<serverName>${HOST_LOCAL}</serverName>
</appender>
If environment variable (serverIp or serverName) is not defined, old implementation will be used.
This library has been inspired by: