Details
-
Bug
-
Resolution: Unresolved
-
None
-
1.5.x
-
None
-
Operating System: Windows XP
Platform: PC
-
major
-
P1
-
174
Description
Log4j silently converts an unknown Priority (given as int value or string) to the default of Priority.DEBUG (see default of switch-case in "Level.toLevel()").
If log4j-over-slf4j gets an unknown instance of Priority for it various "log()" methods then it throws an IllegalStateException (see default of switch-case in "Category.priorityToLevelInt()"):
Caused by: java.lang.IllegalStateException: Unknown Priority TRACE
at org.apache.log4j.Category.priorityToLevelInt(Category.java:316)
at org.apache.log4j.Category.log(Category.java:287)
Ok, now you're asking for the actual usecase for someone calling "Category.log()" with an invalid instance of Priority:
We have a legacy application which has it's own logging abstraction extending (a very old version of) log4j with it's own log levels. Unluckily, here someone defined a TRACE level with a different value for "Priority.TRACE_INT" than Log4js "Level.TRACE_INT".