|
|
|
@ -18,11 +18,11 @@
|
|
|
|
|
|
|
|
|
|
package com.fr.third.org.jboss.logging; |
|
|
|
|
|
|
|
|
|
import org.apache.logging.log4j.LogManager; |
|
|
|
|
import org.apache.logging.log4j.LoggingException; |
|
|
|
|
import org.apache.logging.log4j.message.MessageFormatMessageFactory; |
|
|
|
|
import org.apache.logging.log4j.message.StringFormattedMessage; |
|
|
|
|
import org.apache.logging.log4j.spi.AbstractLogger; |
|
|
|
|
import com.fr.third.apache.logging.log4j.LogManager; |
|
|
|
|
import com.fr.third.apache.logging.log4j.LoggingException; |
|
|
|
|
import com.fr.third.apache.logging.log4j.message.MessageFormatMessageFactory; |
|
|
|
|
import com.fr.third.apache.logging.log4j.message.StringFormattedMessage; |
|
|
|
|
import com.fr.third.apache.logging.log4j.spi.AbstractLogger; |
|
|
|
|
|
|
|
|
|
final class Log4j2Logger extends Logger { |
|
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ final class Log4j2Logger extends Logger {
|
|
|
|
|
|
|
|
|
|
Log4j2Logger(final String name) { |
|
|
|
|
super(name); |
|
|
|
|
org.apache.logging.log4j.Logger logger = LogManager.getLogger(name); |
|
|
|
|
com.fr.third.apache.logging.log4j.Logger logger = LogManager.getLogger(name); |
|
|
|
|
if (!(logger instanceof AbstractLogger)) { |
|
|
|
|
throw new LoggingException("The logger for [" + name + "] does not extend AbstractLogger. Actual logger: " + logger.getClass().getName()); |
|
|
|
|
} |
|
|
|
@ -48,7 +48,7 @@ final class Log4j2Logger extends Logger {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { |
|
|
|
|
final org.apache.logging.log4j.Level translatedLevel = Log4j2Logger.translate(level); |
|
|
|
|
final com.fr.third.apache.logging.log4j.Level translatedLevel = Log4j2Logger.translate(level); |
|
|
|
|
if (this.logger.isEnabled(translatedLevel)) { |
|
|
|
|
try { |
|
|
|
|
this.logger.logMessage(loggerClassName, translatedLevel, null, |
|
|
|
@ -60,7 +60,7 @@ final class Log4j2Logger extends Logger {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { |
|
|
|
|
final org.apache.logging.log4j.Level translatedLevel = Log4j2Logger.translate(level); |
|
|
|
|
final com.fr.third.apache.logging.log4j.Level translatedLevel = Log4j2Logger.translate(level); |
|
|
|
|
if (this.logger.isEnabled(translatedLevel)) { |
|
|
|
|
try { |
|
|
|
|
this.logger.logMessage(loggerClassName, translatedLevel, null, new StringFormattedMessage(format, parameters), thrown); |
|
|
|
@ -68,17 +68,17 @@ final class Log4j2Logger extends Logger {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static org.apache.logging.log4j.Level translate(final Level level) { |
|
|
|
|
private static com.fr.third.apache.logging.log4j.Level translate(final Level level) { |
|
|
|
|
if (level != null) { |
|
|
|
|
switch (level) { |
|
|
|
|
case FATAL: return org.apache.logging.log4j.Level.FATAL; |
|
|
|
|
case ERROR: return org.apache.logging.log4j.Level.ERROR; |
|
|
|
|
case WARN: return org.apache.logging.log4j.Level.WARN; |
|
|
|
|
case INFO: return org.apache.logging.log4j.Level.INFO; |
|
|
|
|
case DEBUG: return org.apache.logging.log4j.Level.DEBUG; |
|
|
|
|
case TRACE: return org.apache.logging.log4j.Level.TRACE; |
|
|
|
|
case FATAL: return com.fr.third.apache.logging.log4j.Level.FATAL; |
|
|
|
|
case ERROR: return com.fr.third.apache.logging.log4j.Level.ERROR; |
|
|
|
|
case WARN: return com.fr.third.apache.logging.log4j.Level.WARN; |
|
|
|
|
case INFO: return com.fr.third.apache.logging.log4j.Level.INFO; |
|
|
|
|
case DEBUG: return com.fr.third.apache.logging.log4j.Level.DEBUG; |
|
|
|
|
case TRACE: return com.fr.third.apache.logging.log4j.Level.TRACE; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return org.apache.logging.log4j.Level.ALL; |
|
|
|
|
return com.fr.third.apache.logging.log4j.Level.ALL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|