Skip to content

Logback appender for integration with the Rollbar service.

License

Notifications You must be signed in to change notification settings

ahaid/rollbar-logback

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • 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.

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

Docker Support

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.

Acknowledgements

This library has been inspired by:

About

Logback appender for integration with the Rollbar service.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%