SOAP クライアントに Apache CXF 3.1 を使用しています。私の意図は、すべての着信および発信 SOAP メッセージを log4j2 でログファイルに記録することです。これは私の現在の設定です:
SOAP クライアントは、JaxWsProxyFactoryBean
.
コンテンツを含むorg.apache.cxf.Logger
ディレクトリにファイルを配置しましたsrc/META-INF/cxf
org.apache.cxf.common.logging.Log4jLogger
cxf.xml:
<bean id="loggingFeature" class="org.apache.cxf.feature.LoggingFeature">
<property name="prettyLogging" value="true" />
</bean>
<cxf:bus>
<cxf:features>
<ref bean="loggingFeature" />
</cxf:features>
</cxf:bus>
log4j2.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Appenders>
<Console name="CONSOLE" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level [%t] %logger{36} - %msg%n"/>
</Console>
<File name="LOG_FILE" fileName="all.log" immediateFlush="false" append="true">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level [%t] %logger{36} - %msg%n"/>
</File>
</Appenders>
<Loggers>
<Root level="DEBUG">
<AppenderRef ref="CONSOLE"/>
<AppenderRef ref="LOG_FILE"/>
</Root>
<Logger name="org.apache.cxf" level="INFO">
<AppenderRef ref="LOG_FILE" />
</Logger>
</Loggers>
</Configuration>
ただし、ファイルに CXF ログ メッセージが表示されません。ここで何が欠けていますか?