Description
If a RegexFilter is used as a context-wide filter,
then a call like
logger.isDebugEnabled()
leads to a Null-Pointer-Exception, because the RegexFilter is called with the message "null".
The stack-trace (2.0-beta5) is:
at org.apache.logging.log4j.core.filter.RegexFilter.filter(RegexFilter.java:60)
at org.apache.logging.log4j.core.filter.CompositeFilter.filter(CompositeFilter.java:176)
at org.apache.logging.log4j.core.Logger$PrivateConfig.filter(Logger.java:317)
at org.apache.logging.log4j.core.Logger.isEnabled(Logger.java:128)
at org.apache.logging.log4j.spi.AbstractLogger.isTraceEnabled(AbstractLogger.java:1129)
In the MarkerFilter is the code
return marker != null && ...
i.e. it is only necessary to change line 60 to
return msg != null && filter(msg.toString)
in RegexFilter (I do not know how to do this correctly...)
In line 77, this check is done; in line 66 and 72 the same problem may arise...
Greetings,
Gerald Kroisandt