nizhikov commented on a change in pull request #6928: IGNITE-12250 Adds rest
requests processing logging.
URL: https://github.com/apache/ignite/pull/6928#discussion_r330055253
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
##########
@@ -1039,6 +1043,30 @@ private void startProtocol(GridRestProtocol proto)
throws IgniteCheckedException
X.println(">>> handlersSize: " + handlers.size());
}
+ /**
+ * Logs REST request processing result.
+ *
+ * @param req Received REST request.
+ * @param fut Result of REST request processing.
+ */
+ private void logRestRequestResult(GridRestRequest req,
IgniteInternalFuture<GridRestResponse> fut) {
+ if (log == null || !log.isInfoEnabled())
+ return;
+
+ GridRestResponse resp = null;
+
+ IgniteCheckedException reqProcErr = null;
+
+ try {
+ resp = fut.get();
+ }
+ catch (IgniteCheckedException e) {
+ reqProcErr = e;
+ }
+
+ log.info(String.format("REST request handled [req=%s, resp=%s,
err=%s].", req, resp, reqProcErr));
Review comment:
Why do we need `info` level here? I think every parameter of every request
should be on `debug` or even `trace` level.
You need use `if (log.isDebugEnabled())` to pervent unnecessary string
construction when log turned off.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services