Configure org.apache.log4j.ConsoleAppender with custom classloader

江枫思渺然 提交于 2019-11-29 06:42:59
Sola Yang

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

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!