Logback Appender for Airbrake
Built on the top of the official airbrake.io library adding Logback Appender
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="true" scanPeriod="30 seconds">
<appender name="AIRBRAKE" class="net.anthavio.airbrake.AirbrakeLogbackAppender">
<apiKey>YOUR_AIRBRAKE_API_KEY</apiKey>
<env>test</env>
<enabled>true</enabled>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<root>
<level value="info" />
<appender-ref ref="AIRBRAKE" />
</root>
</configuration>
Additionaly to airbrake.io library functionality, airbrake-logback also can send simple one line error messages without stacktraces. Source code line, where error was logged, is still captured and sent to Airbrake.
Configure it setting <notify>ALL</notify> in logback.xml Possible values are ALL, EXCEPTIONS, OFF
<appender name="AIRBRAKE" class="net.anthavio.airbrake.AirbrakeLogbackAppender">
<apiKey>YOUR_AIRBRAKE_API_KEY</apiKey>
<env>test</env>
<notify>ALL</notify>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
Java code
Logger logger = LoggerFactory.getLogger(getClass());
logger.error("I'm going to Airbrake! Exact line will be there too");