Log more verbosely and on higher level from circuit breaker
@@ -9,6 +9,7 @@ import java.util.logging.Logger;
import static java.util.Objects.requireNonNull;
import static java.util.logging.Level.FINE;
+import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;
/**
@@ -60,10 +61,13 @@ public class GracePeriodCircuitBreaker implements FeedClient.CircuitBreaker {
public State state() {
long failingMillis = clock.getAsLong() - failingSinceMillis.get();
if (failingMillis > graceMillis && halfOpen.compareAndSet(false, true))
- log.log(FINE, "Circuit breaker is now half-open");
+ log.log(INFO, "Circuit breaker is now half-open, as no requests have succeeded for the " +
+ "last " + failingMillis + "ms. The server will be pinged to see if it recovers, " +
+ "but this client will give up if no successes are observed within " + doomMillis + "ms");
if (failingMillis > doomMillis && open.compareAndSet(false, true))
- log.log(WARNING, "Circuit breaker is now open");
+ log.log(WARNING, "Circuit breaker is now open, after " + doomMillis + "ms of failing request, " +
+ "and this client will give up and abort its remaining feed operations.");
return open.get() ? State.OPEN : halfOpen.get() ? State.HALF_OPEN : State.CLOSED;
}
