Skip to content

Commit

Permalink
Fixes #234. Broken log4j 2.x integration with rc2.
Browse files Browse the repository at this point in the history
  • Loading branch information
emacarron committed Jul 5, 2014
1 parent 6f03a3c commit 28c6f04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0-rc1</version>
<version>2.0-rc2</version>
<optional>true</optional>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
import org.apache.logging.log4j.MarkerManager;
import org.apache.logging.log4j.message.SimpleMessage;
import org.apache.logging.log4j.spi.AbstractLogger;
import org.apache.logging.log4j.spi.AbstractLoggerWrapper;
import org.apache.logging.log4j.spi.ExtendedLoggerWrapper;

/**
* @author Eduardo Macarron
*/
public class Log4j2AbstractLoggerImpl implements Log {

private static Marker MARKER = MarkerManager.getMarker(LogFactory.MARKER);

private static final String FQCN = Log4j2Impl.class.getName();
private AbstractLoggerWrapper log;

private ExtendedLoggerWrapper log;

public Log4j2AbstractLoggerImpl(AbstractLogger abstractLogger) {
log = new AbstractLoggerWrapper(abstractLogger, abstractLogger.getName(), abstractLogger.getMessageFactory());
log = new ExtendedLoggerWrapper(abstractLogger, abstractLogger.getName(), abstractLogger.getMessageFactory());
}

public boolean isDebugEnabled() {
Expand All @@ -48,23 +48,23 @@ public boolean isTraceEnabled() {
}

public void error(String s, Throwable e) {
log.log(MARKER, FQCN, Level.ERROR, new SimpleMessage(s), e);
log.logIfEnabled(FQCN, Level.ERROR, MARKER, new SimpleMessage(s), e);
}

public void error(String s) {
log.log(MARKER, FQCN, Level.ERROR, new SimpleMessage(s), null);
log.logIfEnabled(FQCN, Level.ERROR, MARKER, new SimpleMessage(s), null);
}

public void debug(String s) {
log.log(MARKER, FQCN, Level.DEBUG, new SimpleMessage(s), null);
log.logIfEnabled(FQCN, Level.DEBUG, MARKER, new SimpleMessage(s), null);
}

public void trace(String s) {
log.log(MARKER, FQCN, Level.TRACE, new SimpleMessage(s), null);
log.logIfEnabled(FQCN, Level.TRACE, MARKER, new SimpleMessage(s), null);
}

public void warn(String s) {
log.log(MARKER, FQCN, Level.WARN, new SimpleMessage(s), null);
log.logIfEnabled(FQCN, Level.WARN, MARKER, new SimpleMessage(s), null);
}

}

0 comments on commit 28c6f04

Please sign in to comment.