log4j: log4j:ERROR Attempted to append to closed appender named [stdout]

元气小坏坏 提交于 2019-12-05 02:52:11

I got this message when my log4j.xml contained, due to a copy-and-dont-edit, two loggers (aka categories) with the same name linked to the same appender.

In my case, I've two log4j.properties available to the Log4J: one via placing it in classpath and other being loaded programmatically (using PropertyConfigurator.configure(..)).

And in the two files, I've ConsoleAppender registered with same name stdout and used for same category twice (one in each properties file). Removing config or the properties file solved my issue.

In my case, I used 2 logger elements on same package name caught into this error. removing one of them solved the problem.

<logger name="org.activiti.engine" additivity="false">
    <level value="error" />
    <appender-ref ref="LOGFILE" />
  </logger>
  <logger name="org.activiti.engine" additivity="false">
    <level value="debug" />
    <appender-ref ref="activitiBPMLog" />
  </logger>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!