user2835943
user2835943

Reputation: 39

spring integration wire-tap and logging-channel-adapter logging issue

I am trying to add wire-tap to intercept the channel but it is not using my logback configuration but instead it uses org.apache.commons.logging.impl.Jdk14Logger. How do tell LoggingHandler.messageLogger to use lmy logback configuration?

<int:channel id="testChannel">
    <int:interceptors>
        <int:wire-tap channel="loggerChannel"/>
    </int:interceptors>
</int:channel>

<int:logging-channel-adapter id="loggerChannel" level="DEBUG"/>

My logback has following configurayion defined

<logger name="org.springframework" level="DEBUG"/>
<logger name="org.springframework.integration" level="DEBUG"/>
<logger name="org.springframework.integration.handler.LoggingHandler" level="DEBUG"/>


<root level="DEBUG">
    <appender-ref ref="STDOUT"/>
    <appender-ref ref="ROLLING"/>
</root>

Upvotes: 2

Views: 5740

Answers (1)

Gary Russell
Gary Russell

Reputation: 174554

For historical reasons, Spring uses commons-logging internally; you can wire in logback using slf4j.

See the note in the Spring Reference.

Here's another howto.

Essentially you need to exclude commons-logging from spring deps and add jcl-over-slf4j.

Upvotes: 3

Related Questions