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
Conversation
@@ -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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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.
43ebc72
to
fb33f1a
Compare
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