[
https://issues.jboss.org/browse/JBAS-9257?page=com.atlassian.jira.plugin....
]
Theo Cleminson commented on JBAS-9257:
--------------------------------------
The same problem is experienced on JBoss7.0.2.Final.
Neither setting Level.OFF, or null on the log4j works.
Setting null gives:
-->Unhandled java.lang.NullPointerException: java.lang.NullPointerException. Status
code [500]: java.lang.NullPointerException
at org.jboss.logmanager.log4j.LevelMapping.getLevelFor(LevelMapping.java:65)
[jboss-logmanager-log4j-1.0.0.GA.jar:1.0.0.GA]
at org.jboss.logmanager.log4j.BridgeLogger.setPriority(BridgeLogger.java:199)
[jboss-logmanager-log4j-1.0.0.GA.jar:1.0.0.GA]
at org.jboss.logmanager.log4j.BridgeLogger.setLevel(BridgeLogger.java:194)
[jboss-logmanager-log4j-1.0.0.GA.jar:1.0.0.GA]
Setting Level.OFF results in DEBUG.
BridgeLogger implementation of Logger does not support Level.OFF or
null as parameter values for setLevel method
----------------------------------------------------------------------------------------------------------------
Key: JBAS-9257
URL:
https://issues.jboss.org/browse/JBAS-9257
Project: Legacy JBoss Application Server 6
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Logging
Affects Versions: 6.0.0.M2
Reporter: Antonio Montanana
Assignee: David Lloyd
Labels: jboss
Deploying our application on the JBoss 6.0.0 application server we encounter the
following NullPointerException (NPE) also logged in the
log\server.log file:
2011-03-17 12:52:18,269 ERROR
[filenet_error.engine.com.filenet.engine.tasks.TaskManager]
(TaskManager$RootTask_RootTask_ScheduledPoolExecutor_9)
TaskManager$RootTask:RootTask running with error , with message null:
java.lang.NullPointerException
at org.jboss.logmanager.log4j.LevelMapping.getLevelFor(LevelMapping.java:65)
[:6.0.0.Final]
at org.jboss.logmanager.log4j.BridgeLogger.setPriority(BridgeLogger.java:199)
[:6.0.0.Final]
at org.jboss.logmanager.log4j.BridgeLogger.setLevel(BridgeLogger.java:194)
[:6.0.0.Final]
at com.filenet.engine.util.Logger.removeTraceLoggerLevel(Logger.java:377)
...
The com.filenet.engine.util.Logger.removeTraceLoggerLevel method executes the following
two lines of code:
org.apache.log4j.Logger traceLogger = getLog4JTraceLogger(subsystem, traceFlag);
traceLogger.setLevel(null);
Note the setLevel method is passing in a null parameter value (supported by
org.apache.log4j.Logger.setLevel) to remove the specified logging level. We've
verified that the JBoss LevelMapping.getLevelFor method throws the NPE as a result of the
null parameter value passed into setLevel (changing the parameter value to another level
(e.g. Level.DEBUG) eliminates the exception). The setLevel(null) code executed with no
exceptions in JBoss 5.1.0 and earlier versions of the server and is supported by
org.apache.log4j.Logger.setLevel.
It appears that the logging mechanism has changed significantly in JBoss 6.0, there is
now a BridgeLogger class that extends the
org.apache.log4j.Logger class providing the implementation of the setLevel method. That
implementation appears to have omitted
support for "null" as a parameter value and causes the NPE. Further testing
indicates that the Level.OFF value is also not supported either - leaving no way to remove
the logging level.
We would like to see support for "null" and Level.OFF added to the BridgeLogger
extension of Logger.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira