Skip to content

Commit 05de5e0

Browse files
authored
improvement: logging on informer stopping (#1726)
1 parent 9db9e8e commit 05de5e0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
/** An interface from which to retrieve configuration information. */
2525
public interface ConfigurationService {
2626

27+
Logger log = LoggerFactory.getLogger(ConfigurationService.class);
28+
2729
/**
2830
* Retrieves the configuration associated with the specified reconciler
2931
*
@@ -188,9 +190,10 @@ default Optional<InformerStoppedHandler> getInformerStoppedHandler() {
188190
// hasSynced is checked to verify that informer already started. If not started, in case
189191
// of a fatal error the operator will stop, no need for explicit exit.
190192
if (ex != null && informer.hasSynced()) {
191-
Logger log = LoggerFactory.getLogger(ConfigurationService.class);
192193
log.error("Fatal error in informer: {}. Stopping the operator", informer, ex);
193194
System.exit(1);
195+
} else {
196+
log.debug("Informer stopped: {}. Error: {}", informer, ex);
194197
}
195198
});
196199
}

0 commit comments

Comments
 (0)