Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.7.13
-
None
Description
Currently log4j-over-slf4j classes inheritance do not resemble log4j inheritance, e.g. appenders like RollingFileAppeder not implementing Appender.
This leads to Errors thrown from any code trying to programmatically configure log4j, like in velocity (see below). What makes things worse is that the calling code often expects exceptions and handles, but it does not expect errors.
Please see error thrown out of velocity initializer:
Caused by: java.lang.IncompatibleClassChangeError: Implementing class at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:89) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.apache.velocity.runtime.log.Log4JLogChute.initAppender(Log4JLogChute.java:118) at org.apache.velocity.runtime.log.Log4JLogChute.init(Log4JLogChute.java:85) at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:157) at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:269) at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:871) at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:262) at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:93)