Skip to content

Commit 0d5a644

Browse files
committed
Watch logging
1 parent 706bf61 commit 0d5a644

File tree

4 files changed

+66
-56
lines changed

4 files changed

+66
-56
lines changed

src/main/java/oracle/kubernetes/operator/helpers/CallBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ public com.squareup.okhttp.Call listDomainCall(String namespace) throws ApiExcep
181181
if (client == null) {
182182
throw new IllegalStateException();
183183
}
184+
185+
LOGGER.fine(MessageKeys.WATCH_REQUEST, "listDomain", namespace, fieldSelector, labelSelector, resourceVersion, limit, timeoutSeconds);
184186
return client.getWeblogicApiClient().listWebLogicOracleV1NamespacedDomainCall(namespace, pretty, _continue,
185187
fieldSelector, includeUninitialized, labelSelector, limit, resourceVersion, timeoutSeconds, watch, null, null);
186188
}
@@ -375,6 +377,7 @@ public V1PodList listPod(String namespace) throws ApiException {
375377
*/
376378
public com.squareup.okhttp.Call listPodCall(String namespace) throws ApiException {
377379
String _continue = "";
380+
LOGGER.fine(MessageKeys.WATCH_REQUEST, "listPod", namespace, fieldSelector, labelSelector, resourceVersion, limit, timeoutSeconds);
378381
return client.getCoreApiClient().listNamespacedPodCall(namespace, pretty, _continue, fieldSelector,
379382
includeUninitialized, labelSelector, limit, resourceVersion, timeoutSeconds, watch, null, null);
380383
}
@@ -606,6 +609,7 @@ public V1ServiceList listService(String namespace) throws ApiException {
606609
*/
607610
public com.squareup.okhttp.Call listServiceCall(String namespace) throws ApiException {
608611
String _continue = "";
612+
LOGGER.fine(MessageKeys.WATCH_REQUEST, "listService", namespace, fieldSelector, labelSelector, resourceVersion, limit, timeoutSeconds);
609613
return client.getCoreApiClient().listNamespacedServiceCall(namespace, pretty, _continue, fieldSelector,
610614
includeUninitialized, labelSelector, limit, resourceVersion, timeoutSeconds, watch, null, null);
611615
}
@@ -979,6 +983,7 @@ public V1beta1IngressList listIngress(String namespace) throws ApiException {
979983
*/
980984
public com.squareup.okhttp.Call listIngressCall(String namespace) throws ApiException {
981985
String _continue = "";
986+
LOGGER.fine(MessageKeys.WATCH_REQUEST, "listIngress", namespace, fieldSelector, labelSelector, resourceVersion, limit, timeoutSeconds);
982987
return client.getExtensionsV1beta1ApiClient().listNamespacedIngressCall(namespace, pretty, _continue, fieldSelector,
983988
includeUninitialized, labelSelector, limit, resourceVersion, timeoutSeconds, watch, null, null);
984989
}

src/main/java/oracle/kubernetes/operator/logging/MessageKeys.java

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -110,29 +110,31 @@ private MessageKeys() {
110110
public static final String ASYNC_NO_RETRY = "WLSKO-0094";
111111
public static final String ASYNC_RETRY = "WLSKO-0095";
112112
public static final String ASYNC_TIMEOUT = "WLSKO-0096";
113-
public static final String DOMAIN_STATUS = "WLSKO-0097";
114-
public static final String INVALID_MANAGE_SERVER_COUNT = "WLSKO-0098";
115-
public static final String SCALE_COUNT_GREATER_THAN_CONFIGURED = "WLSKO-0099";
116-
public static final String SCALING_AUTO_CONTROL_AUTO = "WLSKO-0100";
117-
public static final String MATCHING_DOMAIN_NOT_FOUND = "WLSKO-0101";
118-
public static final String INVALID_DOMAIN_UID = "WLSKO-0102";
119-
public static final String NULL_DOMAIN_UID = "WLSKO-0103";
120-
public static final String NULL_TOKEN_REVIEW_STATUS = "WLSKO-0104";
121-
public static final String NULL_USER_INFO = "WLSKO-0105";
122-
public static final String RESOURCE_BUNDLE_NOT_FOUND = "WLSKO-0106";
123-
public static final String RESTART_ADMIN_COMPLETE = "WLSKO-0107";
124-
public static final String RESTART_SERVERS_COMPLETE = "WLSKO-0108";
125-
public static final String ROLLING_CLUSTERS_COMPLETE = "WLSKO-0109";
126-
public static final String RESTART_ADMIN_STARTING = "WLSKO-0110";
127-
public static final String RESTART_SERVERS_STARTING = "WLSKO-0111";
128-
public static final String ROLLING_CLUSTERS_STARTING = "WLSKO-0112";
129-
public static final String CYCLING_SERVERS = "WLSKO-0113";
130-
public static final String ROLLING_SERVERS = "WLSKO-0114";
131-
public static final String REMOVING_INGRESS = "WLSKO-0115";
132-
public static final String LIST_INGRESS_FOR_DOMAIN = "WLSKO-0116";
133-
public static final String POD_DELETED = "WLSKO-0117";
134-
public static final String SERVER_SERVICE_DELETED = "WLSKO-0118";
135-
public static final String CLUSTER_SERVICE_DELETED = "WLSKO-0119";
136-
public static final String INGRESS_DELETED = "WLSKO-0120";
113+
public static final String WATCH_REQUEST = "WLSKO-0097";
114+
public static final String WATCH_EVENT = "WLSKO-0098";
115+
public static final String DOMAIN_STATUS = "WLSKO-0099";
116+
public static final String INVALID_MANAGE_SERVER_COUNT = "WLSKO-0100";
117+
public static final String SCALE_COUNT_GREATER_THAN_CONFIGURED = "WLSKO-0101";
118+
public static final String SCALING_AUTO_CONTROL_AUTO = "WLSKO-0102";
119+
public static final String MATCHING_DOMAIN_NOT_FOUND = "WLSKO-0103";
120+
public static final String INVALID_DOMAIN_UID = "WLSKO-0104";
121+
public static final String NULL_DOMAIN_UID = "WLSKO-0105";
122+
public static final String NULL_TOKEN_REVIEW_STATUS = "WLSKO-0106";
123+
public static final String NULL_USER_INFO = "WLSKO-0107";
124+
public static final String RESOURCE_BUNDLE_NOT_FOUND = "WLSKO-0108";
125+
public static final String RESTART_ADMIN_COMPLETE = "WLSKO-0109";
126+
public static final String RESTART_SERVERS_COMPLETE = "WLSKO-0110";
127+
public static final String ROLLING_CLUSTERS_COMPLETE = "WLSKO-0111";
128+
public static final String RESTART_ADMIN_STARTING = "WLSKO-0112";
129+
public static final String RESTART_SERVERS_STARTING = "WLSKO-0113";
130+
public static final String ROLLING_CLUSTERS_STARTING = "WLSKO-0114";
131+
public static final String CYCLING_SERVERS = "WLSKO-0115";
132+
public static final String ROLLING_SERVERS = "WLSKO-0116";
133+
public static final String REMOVING_INGRESS = "WLSKO-0117";
134+
public static final String LIST_INGRESS_FOR_DOMAIN = "WLSKO-0118";
135+
public static final String POD_DELETED = "WLSKO-0119";
136+
public static final String SERVER_SERVICE_DELETED = "WLSKO-0120";
137+
public static final String CLUSTER_SERVICE_DELETED = "WLSKO-0121";
138+
public static final String INGRESS_DELETED = "WLSKO-0122";
137139

138140
}

src/main/java/oracle/kubernetes/operator/watcher/Watcher.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,15 @@
2929
* @param <T> The type of the object to be watched.
3030
*/
3131
public class Watcher<T> {
32-
32+
private static final LoggingFacade LOGGER = LoggingFactory.getLogger("Operator", "Operator");
33+
3334
private final Watching<T> watching;
3435
private final Object userContext;
3536
private final AtomicBoolean isAlive = new AtomicBoolean(true);
3637
private final AtomicBoolean isDraining = new AtomicBoolean(false);
3738
private String resourceVersion = "";
3839
private Watch<T> watch = null;
39-
//TODO Remove this when the Watch support is integrated into the K8S API
40-
public static final LoggingFacade LOGGER = LoggingFactory.getLogger("Operator", "Operator");
41-
40+
4241
/*
4342
* ErrorResponse is used when the response is not returning data but an error
4443
* from the server.
@@ -190,6 +189,8 @@ public void doWatch() {
190189
continue;
191190
}
192191

192+
LOGGER.fine(MessageKeys.WATCH_EVENT, item.type, item.object);
193+
193194
if (item.type.equalsIgnoreCase("ERROR")) {
194195
// Check the type of error. If code is 410 meaning
195196
// resource is gone then extract current resourceVersion

src/main/resources/Operator.properties

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -89,35 +89,37 @@ WLSKO-0087=Listen and Public ports are not the same for external channel: {0}
8989
WLSKO-0088=External Channel {0} is using {1} protocol. For non-T3 channels use Ingress instead
9090
WLSKO-0089=External Channel {0} is not defined in server {1}
9191
WLSKO-0090=External Channel {0} port {1} is outside the NodePort range starting at {2} through {3}
92-
WLSKO-0091=Async call: invoking {0}, namespace: {1}, name: {2}, body: {3}, fieldSelector: {4}, labelSelector: {5}, resourceVersion: {6}
92+
WLSKO-0091=Async call invoking: {0}, namespace: {1}, name: {2}, body: {3}, fieldSelector: {4}, labelSelector: {5}, resourceVersion: {6}
9393
WLSKO-0092=Async call failed: {0}, code: {1}, headers {2} after invoking {3}, namespace: {4}, name: {5}, body: {6}, fieldSelector: {7}, labelSelector: {8}, resourceVersion: {9}
94-
WLSKO-0093=Async call succeeded with result: {0}, code: {1}, headers {2}
95-
WLSKO-0094=Async call will not be retried after message: {0}, code: {1}, headers {2}
94+
WLSKO-0093=Async call succeeded: {0}, code: {1}, headers {2}
95+
WLSKO-0094=Async call will not be retried: {0}, code: {1}, headers {2}
9696
WLSKO-0095=Async call will be retried after delay: {0} ms
97-
WLSKO-0096=Async call timed-out while invoking {0}, namespace: {1}, name: {2}, body: {3}, fieldSelector: {4}, labelSelector: {5}, resourceVersion: {6}
98-
WLSKO-0097=Status for Domain with UID {0} is now, available server: {1}, available clusters: {2}, unavailable servers: {3}, unavailable clusters: {4}, conditions: {5}
99-
WLSKO-0098=Specified managed server count parameter of {0} is invalid. Please specify a positive managed server count for scaling
100-
WLSKO-0099=Requested scaling count of {0} is greater than configured cluster size of {1} for WebLogic cluster {2}. Please increase the number of configured managed servers for WebLogic cluster {3}
101-
WLSKO-0100=Scaling of WLS Cluster {0} is only supported with Startup Control=AUTO
102-
WLSKO-0101=Domain matching {0} not found
103-
WLSKO-0102=Invalid domain UID: {0}
104-
WLSKO-0103=Null domainUID
105-
WLSKO-0104=Null V1TokenReviewStatus
106-
WLSKO-0105=Null userInfo {0}
107-
WLSKO-0106=Could not find the resource bundle
108-
WLSKO-0107=Restart of administration server for Domain with UID {0} has completed
109-
WLSKO-0108=Restart of servers for Domain with UID {0} in the list {1} has completed
110-
WLSKO-0109=Rolling restart of servers for Domain with UID {0} in the list of clusters {1} has completed
111-
WLSKO-0110=Restart of administration server for Domain with UID {0} is starting
112-
WLSKO-0111=Restart of servers for Domain with UID {0} in the list {1} is starting
113-
WLSKO-0112=Rolling restart of servers for Domain with UID {0} in the list of clusters {1} is starting
114-
WLSKO-0113=Cycling of servers for Domain with UID {0} in the list {1} now
115-
WLSKO-0114=Rolling of servers for Domain with UID {0} in the list {1} now with ready servers {2}
116-
WLSKO-0115=Removing Ingress {0} in namespace {1}
117-
WLSKO-0116=List Ingress for domain with domainUID {0} in namespace {1}
118-
WLSKO-0117=Pod for domain with domainUID {0} in namespace {1} and with server name {2} deleted; validating domain
119-
WLSKO-0118=Service for domain with domainUID {0} in namespace {1} and with server name {2} deleted; validating domain
120-
WLSKO-0119=Service for domain with domainUID {0} in namespace {1} and with cluster name {2} deleted; validating domain
121-
WLSKO-0120=Ingress for domain with domainUID {0} in namespace {1} and with cluster name {2} deleted; validating domain
97+
WLSKO-0096=Async call timed-out: {0}, namespace: {1}, name: {2}, body: {3}, fieldSelector: {4}, labelSelector: {5}, resourceVersion: {6}
98+
WLSKO-0097=Watch call invoking: {0}, namespace: {1}, fieldSelector: {2}, labelSelector: {3}, resourceVersion: {4}, limit: {5}, timeoutSeconds: {6}
99+
WLSKO-0098=Watch event: {0}, object: {1}
100+
WLSKO-0099=Status for Domain with UID {0} is now, available server: {1}, available clusters: {2}, unavailable servers: {3}, unavailable clusters: {4}, conditions: {5}
101+
WLSKO-0100=Specified managed server count parameter of {0} is invalid. Please specify a positive managed server count for scaling
102+
WLSKO-0101=Requested scaling count of {0} is greater than configured cluster size of {1} for WebLogic cluster {2}. Please increase the number of configured managed servers for WebLogic cluster {3}
103+
WLSKO-0102=Scaling of WLS Cluster {0} is only supported with Startup Control=AUTO
104+
WLSKO-0103=Domain matching {0} not found
105+
WLSKO-0104=Invalid domain UID: {0}
106+
WLSKO-0105=Null domainUID
107+
WLSKO-0106=Null V1TokenReviewStatus
108+
WLSKO-0107=Null userInfo {0}
109+
WLSKO-0108=Could not find the resource bundle
110+
WLSKO-0109=Restart of administration server for Domain with UID {0} has completed
111+
WLSKO-0110=Restart of servers for Domain with UID {0} in the list {1} has completed
112+
WLSKO-0111=Rolling restart of servers for Domain with UID {0} in the list of clusters {1} has completed
113+
WLSKO-0112=Restart of administration server for Domain with UID {0} is starting
114+
WLSKO-0113=Restart of servers for Domain with UID {0} in the list {1} is starting
115+
WLSKO-0114=Rolling restart of servers for Domain with UID {0} in the list of clusters {1} is starting
116+
WLSKO-0115=Cycling of servers for Domain with UID {0} in the list {1} now
117+
WLSKO-0116=Rolling of servers for Domain with UID {0} in the list {1} now with ready servers {2}
118+
WLSKO-0117=Removing Ingress {0} in namespace {1}
119+
WLSKO-0118=List Ingress for domain with domainUID {0} in namespace {1}
120+
WLSKO-0119=Pod for domain with domainUID {0} in namespace {1} and with server name {2} deleted; validating domain
121+
WLSKO-0120=Service for domain with domainUID {0} in namespace {1} and with server name {2} deleted; validating domain
122+
WLSKO-0121=Service for domain with domainUID {0} in namespace {1} and with cluster name {2} deleted; validating domain
123+
WLSKO-0122=Ingress for domain with domainUID {0} in namespace {1} and with cluster name {2} deleted; validating domain
122124

123125

0 commit comments

Comments
 (0)