Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-368

log4j-over-slf4j inheritance must be similar to lo4j one

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.7.13
    • log4j-over-slf4j
    • 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)
      
      

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            tivv00 Vitalii Tymchyshyn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: