I use compile \'org.springframework.retry:spring-retry:1.2.2.RELEASE\'
with Spring Boot 1.5.9.RELEASE
.
Configured to retry my method and it work
Looking through the code the org.springframework.retry.support.RetryTemplate
performs the retry logic for retrying the operations. This template only logs simple things like:
o.s.retry.support.RetryTemplate : Retry: count=0
o.s.retry.support.RetryTemplate : Checking for rethrow: count=1
o.s.retry.support.RetryTemplate : Retry: count=1
o.s.retry.support.RetryTemplate : Checking for rethrow: count=2
o.s.retry.support.RetryTemplate : Retry: count=2
o.s.retry.support.RetryTemplate : Checking for rethrow: count=3
o.s.retry.support.RetryTemplate : Retry failed last attempt: count=3
If you want to log the specific exception you could catch the exception log it and rethrow. Unfortunately as far as i can see there is no way to log custom messages within the framework.
Another method would be to shadow the actual interceptor responsible for the invocation of your method like RetryOperationsInterceptor
, this is not advised however.