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

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

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          jgibbs8357 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.

          Show
          jgibbs8357 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.

            People

            • Assignee:
              Unassigned
              Reporter:
              sergeyk Sergey Kadaner
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: