-
Bug
-
Resolution: Done
-
Major
-
2.1.0.Alpha5
-
- See PR unit test
When log message is null, RegexFilter.isLoggable() throws NullPointerException.
It often results in unexpected outcomes. For example, assuming you have a filter-spec with "not(match(xxx))" to suppress some messages in your logger configuration:
<subsystem xmlns="urn:jboss:domain:logging:3.0"> <console-handler name="CONSOLE"> <level name="INFO"/> <filter-spec value="not(match("SOME_MESSAGE"))"/> <formatter> <named-formatter name="COLOR-PATTERN"/> </formatter> </console-handler>
and an application has a code like this:
try { ... } catch (Exception e) { logger.error(e.getMessage(), e); }
"e.getMessage()" could be null. But you want to log the stacktrace 'e' anyway.
In this case, NullPointerException is thrown from RegexFilter and reaches to LoggerNode and disappears. ConsoleHandler cannot publish the log at all.
I think 'null' message should simply return 'false' in RegexFilter.isLoggable().
- is incorporated by
-
JBEAP-14319 [GSS](7.2.0) Amend NullPointerException in RegexFilter.isLoggable()
- Closed
-
JBEAP-14320 [GSS](7.1.z) LOGMGR-191 - Amend NullPointerException in RegexFilter.isLoggable()
- Closed
-
WFCORE-3687 Upgrade org.jboss.logmanager:jboss-logmanager from 2.0.9.Final to 2.1.0.Final
- Resolved