Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

airbrake/log4javabrake

Repository files navigation

⚠️ This project has been archived ⚠️

Since log4j V1 is EOL this repository has been archived. We recomend you use log4javabrake2 instead.


Pre-archive README contents

log4j appender for javabrake

Build Status

Installation

Gradle:

compile 'io.airbrake:log4javabrake:0.1.5'

Maven:

<dependency>
  <groupId>io.airbrake</groupId>
  <artifactId>log4javabrake</artifactId>
  <version>0.1.5</version>
</dependency>

Ivy:

<dependency org='io.airbrake' name='log4javabrake' rev='0.1.5'>
  <artifact name='log4javabrake' ext='pom'></artifact>
</dependency>

Configuration

Using config:

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=io.airbrake.log4javabrake.AirbrakeAppender
log4j.appender.airbrake.projectId=12345
log4j.appender.airbrake.projectKey=FIXME
log4j.appender.airbrake.env=production

Using Java:

import org.apache.log4j.Logger;
import io.airbrake.log4javabrake.AirbrakeAppender;

int projectId = 12345;
String projectKey = "FIXME";
Logger.getRootLogger().addAppender(new AirbrakeAppender(projectId, projectKey));