Details
Description
NPE when logging in Java EE/OSGi environment.
In some cases the ClassLoader ( https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getClassLoader() ) will be null for a Class.
With the changes introduced in
https://issues.apache.org/jira/browse/LOG4J2-1457 logging with %xEx can cause a NullPointerExeception when trying to resolve the stack.
Since it's not a common occurrence in most environments I suggest the ThrowableProxy swallow the NPE in the same way it swallows SecurityExeception and other classloading exceptions to avoid extra branching for all environments.