英文:
Spring integration - Gateway - Retry logging
问题
我在sftpOutboundGateway上应用了重试策略。我想在日志中查看重试发生的情况。如何启用这个功能?在application.yml文件中是否有相关属性?
英文:
I have a retry advice applied on a sftpOutboundGateway. I want to see in the logs whenever retries happen. how do I enable that ? is there some property in application.yml ?
答案1
得分: 1
我猜您正在使用Spring Boot,因为您提到了application.yml
。确实,Spring Boot允许我们在配置属性中配置日志类别。以下是Spring Retry的配置示例:
logging.level.org.springframework.retry: debug
使用此配置,您将看到来自RetryTemplate
的一些活动信息:
- 重试:次数=
- 检查是否重新抛出:次数=
- 重试失败的最后一次尝试:次数=
请参阅Spring Boot文档:https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.logging.log-levels
英文:
Since you talk about an application.yml
, I just guess that you use Spring Boot. Indeed Spring Boot allows us to configure logging categories in that configuration properties. And here is the one for Spring Retry:
logging.level.org.springframework.retry:debug
With that you'll see some activities from the RetryTemplate
:
Retry: count=
Checking for rethrow: count=
Retry failed last attempt: count=
See Spring Boot docs: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.logging.log-levels
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论