Hi team,
I think there is something wrong with Log4j1.x bridge level handling when
migrating from log4j1.x to log4j2.x.
Issue: In my config file, log level is set to "Error", but with log4j1.x
bridge log level is getting calculated as DEBUG. I think this is since in
log4j1.x from FATAL to DEBUG level integer value decreases as shown below but
in log4j2.x from FATAL to DEBUG integer value increases as shown below.
I think there is some issue in getEffectiveLevel(). Please let me know if you
have any idea on this.
Config
Log4j1.x
Log4j2.x
Level integer value
/**
* The <code>OFF</code> has the highest possible rank and is
* intended to turn off logging.
*/
public static final int OFF_INT = Integer.MAX_VALUE;
/**
* The <code>FATAL</code> level designates very severe error
* events that will presumably lead the application to abort.
*/
public static final int FATAL_INT = 50000;
/**
* The <code>ERROR</code> level designates error events that
* might still allow the application to continue running.
*/
public static final int ERROR_INT = 40000;
/**
* The <code>WARN</code> level designates potentially harmful situations.
*/
public static final int WARN_INT = 30000;
/**
* The <code>INFO</code> level designates informational messages
* that highlight the progress of the application at coarse-grained
* level.
*/
public static final int INFO_INT = 20000;
/**
* The <code>DEBUG</code> Level designates fine-grained
* informational events that are most useful to debug an
* application.
*/
public static final int DEBUG_INT = 10000;
//public final static int FINE_INT = DEBUG_INT;
/**
* The <code>ALL</code> has the lowest possible rank and is intended to
* turn on all logging.
*/
public static final int ALL_INT = Integer.MIN_VALUE;
* OFF(0) //No events will be logged.
* FATAL(100) //A severe error that will prevent the application from
continuing.
* ERROR(200) //An error in the application, possibly recoverable.
* WARN(300) //An event that might possible lead to an error.
* INFO(400) //An event for informational purposes.
* DEBUG(500) //A general debugging event.
* TRACE(600) //A fine-grained debug message, typically capturing the flow
through the application.
* ALL(Integer.MAX_VALUE) //All events should be logged.
*
* Typically, configuring a level in a filter or on a logger will cause
logging
* events of that level and those that are more specific to pass through
the filter.
* A special level, ALL, is guaranteed to capture all levels when used in
logging
* configurations.
*
* FATAL is defined in class StandardLevel.
*/