[Bug 174] New: Handling of unknown priorities is different ( throwing an IllegalStateException ) than in log4j (defaulting to Priority. DEBUG)

http://bugzilla.slf4j.org/show_bug.cgi?id=174 Summary: Handling of unknown priorities is different (throwing an IllegalStateException ) than in log4j (defaulting to Priority.DEBUG) Product: SLF4J Version: 1.5.x Platform: PC OS/Version: Windows XP Status: NEW Severity: normal Priority: P1 Component: log4j-over-slf4j AssignedTo: slf4j-dev@qos.ch ReportedBy: torsten@springide.org 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". -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=174 Torsten <torsten@springide.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major Summary|Handling of unknown |Handling of unknown (custom) |priorities is different |priorities is different than |(throwing an |in log4j (throwing an |IllegalStateException ) than|IllegalStateException than |in log4j (defaulting to |using the effective level of |Priority.DEBUG) |the given Priority / Level / | |Category) -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=174 Mats Henrikson <mats@zakalwe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mats@zakalwe.com --- Comment #1 from Mats Henrikson <mats@zakalwe.com> 2010-11-05 04:37:25 --- This causes slf4j to be incompatible with the jboss.logging package in the JBoss application server v4. Bug 81 on the logback project shows this too, but was logged on the wrong project: http://bugzilla.qos.ch/show_bug.cgi?id=81 Both of these bugs have no comments and have been open for a significant amount of time... -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=174 --- Comment #2 from Mats Henrikson <mats@zakalwe.com> 2010-11-10 02:04:33 --- Created an attachment (id=72) --> (http://bugzilla.slf4j.org/attachment.cgi?id=72) Turns any unknown log4j Category into DEBUG. Adding a very simple patch that turns any unknown log4j Category into DEBUG. -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@pixie.qos.ch