Skip to content

Commit 0d1ca18

Browse files
authored
Move some messages to CONFIG level to make log less chatty (#2387)
1 parent c026181 commit 0d1ca18

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

operator/src/main/java/oracle/kubernetes/operator/TuningParametersImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ private void update() {
9595
if (!main.equals(this.main)
9696
|| !callBuilder.equals(this.callBuilder)
9797
|| !watch.equals(this.watch)
98-
|| !watch.equals(this.pod)
99-
|| !pod.equals(this.featureGates)) {
100-
LOGGER.info(MessageKeys.TUNING_PARAMETERS);
98+
|| !pod.equals(this.pod)
99+
|| !featureGates.equals(this.featureGates)) {
100+
LOGGER.config(MessageKeys.TUNING_PARAMETERS);
101101
}
102102
this.main = main;
103103
this.callBuilder = callBuilder;

operator/src/main/java/oracle/kubernetes/operator/utils/Certificates.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private static String getCertificate(String path, String failureMessage) {
5151
try {
5252
return new String(Files.readAllBytes(GET_PATH.apply(path)));
5353
} catch (IOException e) {
54-
LOGGER.warning(failureMessage, path);
54+
LOGGER.config(failureMessage, path);
5555
return null;
5656
}
5757
}

operator/src/test/java/oracle/kubernetes/operator/utils/CertificatesTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import static oracle.kubernetes.operator.logging.MessageKeys.NO_EXTERNAL_CERTIFICATE;
1919
import static oracle.kubernetes.operator.logging.MessageKeys.NO_INTERNAL_CERTIFICATE;
20+
import static oracle.kubernetes.utils.LogMatcher.containsConfig;
2021
import static oracle.kubernetes.utils.LogMatcher.containsWarning;
2122
import static org.hamcrest.Matchers.equalTo;
2223
import static org.hamcrest.Matchers.notNullValue;
@@ -76,10 +77,10 @@ public void whenNoExternalCertificateFile_returnNull() {
7677
}
7778

7879
@Test
79-
public void whenNoExternalCertificateFile_logWarningMessage() {
80+
public void whenNoExternalCertificateFile_logConfigMessage() {
8081
assertThat(Certificates.getOperatorExternalCertificateData(), nullValue());
8182

82-
assertThat(logRecords, containsWarning(NO_EXTERNAL_CERTIFICATE));
83+
assertThat(logRecords, containsConfig(NO_EXTERNAL_CERTIFICATE));
8384
}
8485

8586
@Test
@@ -97,10 +98,10 @@ public void whenNoInternalCertificateFile_returnNull() {
9798
}
9899

99100
@Test
100-
public void whenNoInternalCertificateFile_logWarningMessage() {
101+
public void whenNoInternalCertificateFile_logConfigMessage() {
101102
Certificates.getOperatorInternalCertificateData();
102103

103-
assertThat(logRecords, containsWarning(NO_INTERNAL_CERTIFICATE));
104+
assertThat(logRecords, containsConfig(NO_INTERNAL_CERTIFICATE));
104105
}
105106

106107
@Test

operator/src/test/java/oracle/kubernetes/utils/LogMatcher.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public static LogMatcher containsSevere(String expectedMessage) {
5252
return new LogMatcher(Level.SEVERE, expectedMessage);
5353
}
5454

55+
public static LogMatcher containsConfig(String expectedMessage) {
56+
return new LogMatcher(Level.CONFIG, expectedMessage);
57+
}
58+
5559
public static LogMatcher containsFine(String expectedMessage) {
5660
return new LogMatcher(Level.FINE, expectedMessage);
5761
}

0 commit comments

Comments
 (0)