Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,22 @@ private void setState(ProviderState state) {
} else {
providerName = delegate.getMetadata().getName();
}
log.info("Provider {} transitioned from state {} to state {}", providerName, oldState, state);
logProviderStateTransition(providerName, oldState, state);
}
}

private void logProviderStateTransition(String providerName, ProviderState oldState, ProviderState newState) {
var logMessage = "Provider {} transitioned from state {} to state {}";
switch (newState) {
case ERROR:
log.error(logMessage, providerName, oldState, newState);
break;
case FATAL:
log.warn(logMessage, providerName, oldState, newState);
break;
default:
log.debug(logMessage, providerName, oldState, newState);
break;
Comment on lines +77 to +88

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major

Keep FATAL at least as severe as ERROR and preserve recovery visibility.

FATAL currently logs at WARN while ERROR logs at ERROR, so fatal provider failures can miss error-level alerts. Because this helper considers only newState, transitions such as ERROR -> READY are also downgraded to DEBUG, contrary to the prior review guidance to keep recovery from ERROR visible at INFO. Base the policy on both states, or confirm that this severity policy intentionally changed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/dev/openfeature/sdk/FeatureProviderStateManager.java` around
lines 77 - 88, Update logProviderStateTransition to base severity on both
oldState and newState: log FATAL transitions at least at ERROR level, keep
ERROR-level transitions at ERROR, and log recoveries from ERROR or FATAL to a
non-failure state at INFO so they remain visible. Preserve DEBUG logging for
ordinary transitions.

}
}

Expand Down
Loading