我们正在尝试使用 logback 和以下配置记录 Axis2 SOAP 日志消息:
<!-- Axis client appender -->
<appender name="AxisLogging" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>INFO</level>
<OnMatch>ACCEPT</OnMatch>
<OnMismatch>NEUTRAL</OnMismatch>
</filter>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>DEBUG</level>
<OnMatch>ACCEPT</OnMatch>
<OnMismatch>NEUTRAL</OnMismatch>
</filter>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>TRACE</level>
<OnMatch>ACCEPT</OnMatch>
<OnMismatch>DENY</OnMismatch>
</filter>
<File>log/axis-client.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>log/axis-client.%i.log</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>5</MaxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>100MB</MaxFileSize>
</triggeringPolicy>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>[%date{yyyy-MM-dd HH:mm:ss.SSS zZ}] %-5level [%mdc{requestsite}] [%mdc{session.id}] "%thread" %msg %ex%n</Pattern>
</layout>
</encoder>
</appender>
<logger name="httpclient.wire.content">
<appender-ref ref="AxisLogging"/>
</logger>
长请求和响应 XML 的日志消息被截断为 4000 个字符,并通过多个日志行传播。有没有办法配置 logback 以在一个日志行中记录整个 XML?
谢谢!