我正在使用JBoss EAP 7.我正在使用自己的log4j2而不是Jboss日志记录。 所以我将它们放在Jboss-deployment-structure.xml文件中。Jboss EAP 7日志记录格式
<deployment>
<exclude-subsystems>
<subsystem name="logging" />
</exclude-subsystems>
<!--
Prevent that the server add automatically dependencies -->
<!-- Exclude all logging dependencies so we can use log4j2 -->
<exclusions>
<module name="org.apache.commons.logging" />
<module name="org.apache.log4j" />
<module name="org.jboss.logging" />
<module name="org.jboss.logging.jul-to-slf4j-stub" />
<module name="org.jboss.logmanager" />
<module name="org.jboss.logmanager.log4j" />
<module name="org.slf4j" />
<module name="org.slf4j.impl" />
</exclusions>
</deployment>
在我的log4j2.xml文件中,我提到了如下的模式布局。
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%p|%d|%c|%m|%n" />
</Console>
但是,当我启动应用程序intially有一个类加载中日志打印正确如下。
DEBUG|2017-08-08 13:20:26,993|Default.com.test.StartClass|deleting directory: C:\eclipse\workspace\WEB-INF\templates
但是当JBoss服务器开始装载它的子系统,它被添加stdout和添加一些其他的东西我盈实际模式的更新版本。
13:39:06,997 INFO [stdout] (ServerService Thread Pool -- 87) INFO|2017-08-08 13:39:06,997|Default.com.test.AppXmlUnmarshaller|Unmarshalling took 342 milliseconds.
我不排除子系统后,为什么不采取这种模式布局。 请帮我解决这个问题。
在此先感谢。