Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EJBCLIENT-236] Add in more trace logging for tracking invocations #288

Merged
merged 1 commit into from Jul 17, 2017

Conversation

rachmatowicz
Copy link
Contributor

This PR adds in more trace logging to the key interceptor and discovery provider used by the client when making invocations.

See: https://issues.jboss.org/browse/EJBCLIENT-236

@@ -340,6 +348,7 @@ Discovery getDiscovery() {
final Map.Entry<URI, String> entry = nodes.entrySet().iterator().next();
location = entry.getKey();
nodeName = entry.getValue();
Logs.INVOCATION.tracef("Performed first-match discovery(target affinity = %s, destination = %s)", new NodeAffinity(nodeName), location);
Copy link
Member

Choose a reason for hiding this comment

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

This should just log the node name so that we don't pay the construction cost when trace is disabled.

@@ -352,6 +361,7 @@ Discovery getDiscovery() {
if (location == null) {
throw Logs.INVOCATION.selectorReturnedUnknownNode(selector, nodeName);
}
Logs.INVOCATION.tracef("Performed first-match discovery, nodes > 1, deployment selector used(target affinity = %s, destination = %s)", new NodeAffinity(nodeName), location);
Copy link
Member

Choose a reason for hiding this comment

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

Here too

@@ -363,6 +373,7 @@ Discovery getDiscovery() {
if (nodeName == null) {
throw Logs.INVOCATION.selectorReturnedUnknownNode(selector, location.toString());
}
Logs.INVOCATION.tracef("Performed first-match discovery, nodes > 1, URI selector used(target affinity = %s, destination = %s)", new NodeAffinity(nodeName), location);
Copy link
Member

Choose a reason for hiding this comment

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

Here too

@@ -422,6 +440,9 @@ Discovery getDiscovery() {
}
}
}
Logs.INVOCATION.tracef("Performing cluster discovery (connected nodes = %s, available nodes = %s)",
connectedNodes == null ? "null" : connectedNodes, availableNodes == null ? "null" : availableNodes);
Copy link
Member

Choose a reason for hiding this comment

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

You don't need these conditionals; null values are rendered as "null".

for (EJBClientConnection connection : configuredConnections) {
if (! connection.isForDiscovery()) {
continue;
}
Logs.INVOCATION.tracef("EJB discovery provider: attempting to connect to connection %s", connection.getDestination());
Copy link
Member

Choose a reason for hiding this comment

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

This could be extracted to a local variable.

@dmlloyd dmlloyd merged commit 3462606 into wildfly:master Jul 17, 2017
@rachmatowicz rachmatowicz deleted the moreTraceLogging branch July 20, 2017 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants