spring-integration - Spring集成窃听和日志记录 channel 适配器日志记录问题

标签 spring-integration

我正在尝试添加窃听来拦截 channel ,但它没有使用我的 logback 配置,而是使用 org.apache.commons.logging.impl.Jdk14Logger。 如何告诉 LoggingHandler.messageLogger 使用 lmy logback 配置?

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

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

我的 logback 定义了以下配置

<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>

最佳答案

由于历史原因,Spring内部使用commons-logging;您可以使用 slf4j 连接 logback。

请参阅note in the Spring Reference .

这是another howto .

本质上,您需要从 spring deps 中排除 commons-logging 并添加 jcl-over-slf4j

关于spring-integration - Spring集成窃听和日志记录 channel 适配器日志记录问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28860477/

相关文章:

java - Spring集成分离器的事务边界

java - 如何在spring集成TCP Server中等待数据

spring-integration - 如何使消息流的任意部分(伪)具有事务性?

json - 有没有办法默认使用 Spring Integration 进行 JSON 序列化?

java - 在 Spring Integration 中使用 Transformer 轮询 HTTP 服务(出站网关)和进程

error-handling - Spring 集成 : How to send response packet to client in case of exception using error-channel?

java - 每次应用程序重新启动时 Spring Integration 都会加载文件

java - 收件人列表路由器 Spring 集成

spring - 判断spring integration中一个循环工作流的结束(inbound-channel => service-activator)

spring-integration - 在 spring-integration 或 xd 中编码密码