Configure org.apache.log4j.ConsoleAppender with custom classloader

前端 未结 2 609
灰色年华
灰色年华 2020-12-17 22:13

I have a java class which creates a custom classloader based on javassist class loader on start up and then run the real program class. I\'m getting the following error:

相关标签:
2条回答
  • 2020-12-17 22:50

    Add log4j.ignoreTCL in maven tomcat plugin configuration as shown in below

    <plugin>
       <groupId>org.apache.tomcat.maven</groupId>
       <artifactId>tomcat7-maven-plugin</artifactId>
       <version>2.1</version>
       <configuration>
          <port>${local.server.port}</port>
          <update>true</update>
          <systemProperties>
             <log4j.configurationFile>${user.dir}\conf\log4j2.xml</log4j.configurationFile>
             <log4j.ignoreTCL>true</log4j.ignoreTCL>
             <java.util.logging.manager>org.apache.logging.log4j.jul.LogManager</java.util.logging.manager>
          </systemProperties>
          <contextReloadable>true</contextReloadable>
       </configuration>
    </plugin>
    
    0 讨论(0)
  • 2020-12-17 22:55

    Please try to set -Dlog4j.ignoreTCL=true, hope it helps. a simular issue about log4j

    0 讨论(0)
提交回复
热议问题