Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29735

Replacing log4j with log4j-over-slf4j break code that use log4j

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Critical Critical
    • core
    • jenkins-1.622

      In the jenkins-1.622 log4j was suddenly replaced by log4j-over-slf4j without any warning or even mention in the release notes.

      log4j-over-slf4j jar has only partial implementation of log4j classes and interfaces. Many are absent or have an empty implementation.
      That breaks plugins that use log4j.

      I got the following errors:

      java.lang.NoSuchMethodError: org.apache.log4j.WriterAppender.<init>(Lorg/apache/log4j/Layout;Ljava/io/OutputStream;)V

      java.lang.NoSuchMethodError: org.apache.log4j.Logger.removeAppender(Lorg/apache/log4j/Appender;)V

      It is possible to work around by using <pluginFirstClassLoader>true</pluginFirstClassLoader> , but that solution can potentially lead to classloading issues.

          [JENKINS-29735] Replacing log4j with log4j-over-slf4j break code that use log4j

          Jack Gibbons added a comment -

          Hi,

          I'm running into the same issue using log4j in a custom plugin on 1.642.3. Is there any fix for this? I tried using <pluginFirstClassLoader>true</pluginFirstClassLoader> in the maven-hpi plugin, but that didn't help.

          Jack Gibbons added a comment - Hi, I'm running into the same issue using log4j in a custom plugin on 1.642.3. Is there any fix for this? I tried using <pluginFirstClassLoader>true</pluginFirstClassLoader> in the maven-hpi plugin, but that didn't help.

          Mark Waite added a comment -

          We don't plan to make any change that will enable greater use of Apache Log4j 2 in Jenkins at this time.

          Mark Waite added a comment - We don't plan to make any change that will enable greater use of Apache Log4j 2 in Jenkins at this time.

            Unassigned Unassigned
            sergeyk Sergey Kadaner
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: