@@ -1183,19 +1183,25 @@ private boolean shouldRetry() {
11831183 boolean shouldRetryBasedOnPolicy = this .policy != null ? this .shouldRetryBasedOnPolicy () : true ;
11841184 boolean shouldRetryBasedOnHandler = this .handler != null ? this .handler .handle (retryContext ) : true ;
11851185
1186- if (this .policy != null ) {
1187- logger .fine (() -> String .format ("shouldRetryBasedOnPolicy: %s" , shouldRetryBasedOnPolicy ));
1188- }
1186+ // Only log when not replaying, so only the current attempt is logged and not all previous attempts.
1187+ if (!this .context .getIsReplaying ()) {
1188+ if (this .policy != null ) {
1189+ logger .fine (() -> String .format ("shouldRetryBasedOnPolicy: %s" , shouldRetryBasedOnPolicy ));
1190+ }
11891191
1190- if (this .handler != null ) {
1191- logger .fine (() -> String .format ("shouldRetryBasedOnHandler: %s" , shouldRetryBasedOnHandler ));
1192+ if (this .handler != null ) {
1193+ logger .fine (() -> String .format ("shouldRetryBasedOnHandler: %s" , shouldRetryBasedOnHandler ));
1194+ }
11921195 }
11931196
11941197 return shouldRetryBasedOnPolicy && shouldRetryBasedOnHandler ;
11951198 }
11961199
11971200 private boolean shouldRetryBasedOnPolicy () {
1198- logger .fine (() -> String .format ("Retry Policy: %d retries out of total %d performed " , this .attemptNumber , this .policy .getMaxNumberOfAttempts ()));
1201+ // Only log when not replaying, so only the current attempt is logged and not all previous attempts.
1202+ if (!this .context .getIsReplaying ()) {
1203+ logger .fine (() -> String .format ("Retry Policy: %d retries out of total %d performed " , this .attemptNumber , this .policy .getMaxNumberOfAttempts ()));
1204+ }
11991205
12001206 if (this .attemptNumber >= this .policy .getMaxNumberOfAttempts ()) {
12011207 // Max number of attempts exceeded
0 commit comments