Git Product home page Git Product logo

airbrake-java's Introduction

Airbrake Java

This is the notifier jar for integrating apps with Airbrake with Java Applications. Sign up for a Free or Paid account.

When an uncaught exception occurs, Airbrake will POST the relevant data to the Airbrake server specified in your environment.

The easy way to use airbrake is configuriong log4j appender. Otherwise if you don't use log4j you can use airbrake notifier directly with a very simple API.

Setting up with Maven

<project>
	<dependencies>
		<dependency>
  		<groupId>io.airbrake</groupId>
  		<artifactId>airbrake-java</artifactId>
  		<version>2.2.6</version>
		</dependency>
	</dependencies>
</project>

Without Maven

you need to add these libraries to your classpath

Log4j

log4j.rootLogger=INFO, stdout, airbrake

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d,%p] [%c{1}.%M:%L] %m%n

log4j.appender.airbrake=airbrake.AirbrakeAppender	
log4j.appender.airbrake.api_key=YOUR_AIRBRAKE_API_KEY
#log4j.appender.airbrake.env=development
#log4j.appender.airbrake.env=production
log4j.appender.airbrake.env=test
log4j.appender.airbrake.enabled=true
#log4j.appender.airbrake.url=http://api.airbrake.io/notifier_api/v2/notices

or in XML format:

<appender name="AIRBRAKE" class="airbrake.AirbrakeAppender">
	<param name="api_key" value="YOUR_AIRBRAKE_API_KEY"/>
	<param name="env" value="test"/>
	<param name="enabled" value="true"/>
<!-- <param name="url" value="http://api.airbrake.io/notifier_api/v2/notices" /> -->
</appender>

<root>
	<appender-ref ref="AIRBRAKE"/>
</root>

Directly

try {
	doSomethingThatThrowAnException();
}
catch(Throwable t) {
	AirbrakeNotice notice = new AirbrakeNoticeBuilder(YOUR_AIRBRAKE_API_KEY, t, "env").newNotice();
	AirbrakeNotifier notifier = new AirbrakeNotifier();
	notifier.notify(notice);
}

if you need to specifiy a different url to send notice you can create new notifier with this url:

try {
	doSomethingThatThrowAnException();
}
catch(Throwable t) {
	AirbrakeNotice notice = new AirbrakeNoticeBuilder(YOUR_AIRBRAKE_API_KEY, t, "env").newNotice();
	AirbrakeNotifier notifier = new AirbrakeNotifier("http://api.airbrake.io/notifier_api/v2/notices");
	notifier.notify(notice);
}

Support

For help with using Airbrake and this notifier visit our support site.

For SSL verification see the Resources.

For any issues, please post then in our Issues.

airbrake-java's People

Contributors

lucamarrocco avatar benarent avatar thenoseman avatar drubin avatar

Watchers

Pieter Eerlings avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.