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

Commit

Permalink
update to log4j2 2.0-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Seifert committed Feb 17, 2014
1 parent 1401257 commit 9f5b494
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,28 +153,22 @@ public static Enumeration getCurrentCategories() {
}

public final Level getEffectiveLevel() {
final org.apache.logging.log4j.Level level = logger.getLevel();

if (level==org.apache.logging.log4j.Level.TRACE) {
return Level.TRACE;
}
if (level==org.apache.logging.log4j.Level.DEBUG) {
return Level.DEBUG;
}
if (level==org.apache.logging.log4j.Level.INFO) {
return Level.INFO;
}
if (level==org.apache.logging.log4j.Level.WARN) {
return Level.WARN;
}
if (level==org.apache.logging.log4j.Level.ERROR) {
return Level.ERROR;
}
if (level==org.apache.logging.log4j.Level.FATAL) {
return Level.FATAL;
}
// fallback
return Level.ERROR;
switch (logger.getLevel().getStandardLevel()) {
case TRACE:
return Level.TRACE;
case DEBUG:
return Level.DEBUG;
case INFO:
return Level.INFO;
case WARN:
return Level.WARN;
case ERROR:
return Level.ERROR;
case FATAL:
return Level.FATAL;
default:
return Level.OFF;
}
}

public final Priority getChainedPriority() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void doConfigure(final InputStream inputStream, final LoggerRepository hi
* @param configURL The configuration URL
* @param hierarchy The hierarchy
*/
public void doConfigure(final java.net.URL configURL, final LoggerRepository hierarchy) {}
public void doConfigure(final URL configURL, final LoggerRepository hierarchy) {}

/**
* Read configuration options from configuration file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,27 +536,28 @@ public void run() {
@Override
public void append(LogEvent pEvent) {
org.apache.log4j.Level level = null;
if (pEvent.getLevel()==Level.TRACE) {
level = org.apache.log4j.Level.TRACE;
}
else if (pEvent.getLevel()==Level.DEBUG) {
level = org.apache.log4j.Level.DEBUG;
}
else if (pEvent.getLevel()==Level.INFO) {
level = org.apache.log4j.Level.INFO;
}
else if (pEvent.getLevel()==Level.WARN) {
level = org.apache.log4j.Level.WARN;
}
else if (pEvent.getLevel()==Level.ERROR) {
level = org.apache.log4j.Level.ERROR;
}
else if (pEvent.getLevel()==Level.FATAL) {
level = org.apache.log4j.Level.FATAL;
}
else {
// fallback
level = org.apache.log4j.Level.ERROR;
switch (pEvent.getLevel().getStandardLevel()) {
case TRACE:
level = org.apache.log4j.Level.TRACE;
break;
case DEBUG:
level = org.apache.log4j.Level.DEBUG;
break;
case INFO:
level = org.apache.log4j.Level.INFO;
break;
case WARN:
level = org.apache.log4j.Level.WARN;
break;
case ERROR:
level = org.apache.log4j.Level.ERROR;
break;
case FATAL:
level = org.apache.log4j.Level.FATAL;
break;
default:
level = org.apache.log4j.Level.OFF;
break;
}
ThrowableInformation throwableInformation = null;
if (pEvent.getThrown() != null) {
Expand Down

0 comments on commit 9f5b494

Please sign in to comment.