@Test public void testLogRequestSummary_success() { when(requestInfoLogger.isInfoEnabled()).thenReturn(true); loggerDelegate.logRequestSummary(remoteCallReturn); RequestInfo requestInfo = remoteCallReturn.getRequestInfo(); ResponseInfo responseInfo = remoteCallReturn.getResponseInfo(); verify(requestInfoLogger) .info( RemoteCallLoggerDelegate.SUMMARY_TEMPLATE, requestInfo.getServiceName(), requestInfo.getMethodName(), requestInfo.getContextName(), requestInfo.getContextValue(), requestInfo.getUrl(), responseInfo.getRequestId(), responseInfo.getResponseTime(), responseInfo.getOperationsCount(), false, null); }
public void logRequestSummary(RemoteCallReturn remoteCallReturn) { if (remoteCallReturn == null) { return; } boolean isSuccess = remoteCallReturn.getException() == null; if (!isSummaryLoggable(isSuccess)) { return; } RequestInfo request = remoteCallReturn.getRequestInfo(); ResponseInfo response = remoteCallReturn.getResponseInfo(); Object[] logArgs = new Object[10]; if (request != null) { logArgs[0] = request.getServiceName(); logArgs[1] = request.getMethodName(); logArgs[2] = request.getContextName(); logArgs[3] = request.getContextValue(); logArgs[4] = request.getUrl(); } if (response != null) { logArgs[5] = response.getRequestId(); logArgs[6] = response.getResponseTime(); logArgs[7] = response.getOperationsCount(); Throwable throwable = remoteCallReturn.getException(); logArgs[8] = throwable != null; logArgs[9] = truncateThrowable(throwable, MAX_SUMMARY_ERROR_LENGTH); } if (isSuccess) { summaryLogger.info(SUMMARY_TEMPLATE, logArgs); } else { summaryLogger.warn(SUMMARY_TEMPLATE, logArgs); } }
RemoteCallLoggerDelegate { public void logRequestSummary(RemoteCallReturn remoteCallReturn) { if (remoteCallReturn == null) { return; } boolean isSuccess = remoteCallReturn.getException() == null; if (!isSummaryLoggable(isSuccess)) { return; } RequestInfo request = remoteCallReturn.getRequestInfo(); ResponseInfo response = remoteCallReturn.getResponseInfo(); Object[] logArgs = new Object[10]; if (request != null) { logArgs[0] = request.getServiceName(); logArgs[1] = request.getMethodName(); logArgs[2] = request.getContextName(); logArgs[3] = request.getContextValue(); logArgs[4] = request.getUrl(); } if (response != null) { logArgs[5] = response.getRequestId(); logArgs[6] = response.getResponseTime(); logArgs[7] = response.getOperationsCount(); Throwable throwable = remoteCallReturn.getException(); logArgs[8] = throwable != null; logArgs[9] = truncateThrowable(throwable, MAX_SUMMARY_ERROR_LENGTH); } if (isSuccess) { summaryLogger.info(SUMMARY_TEMPLATE, logArgs); } else { summaryLogger.warn(SUMMARY_TEMPLATE, logArgs); } } }
RemoteCallLoggerDelegate { public void logRequestSummary(RemoteCallReturn remoteCallReturn) { if (remoteCallReturn == null) { return; } boolean isSuccess = remoteCallReturn.getException() == null; if (!isSummaryLoggable(isSuccess)) { return; } RequestInfo request = remoteCallReturn.getRequestInfo(); ResponseInfo response = remoteCallReturn.getResponseInfo(); Object[] logArgs = new Object[10]; if (request != null) { logArgs[0] = request.getServiceName(); logArgs[1] = request.getMethodName(); logArgs[2] = request.getContextName(); logArgs[3] = request.getContextValue(); logArgs[4] = request.getUrl(); } if (response != null) { logArgs[5] = response.getRequestId(); logArgs[6] = response.getResponseTime(); logArgs[7] = response.getOperationsCount(); Throwable throwable = remoteCallReturn.getException(); logArgs[8] = throwable != null; logArgs[9] = truncateThrowable(throwable, MAX_SUMMARY_ERROR_LENGTH); } if (isSuccess) { summaryLogger.info(SUMMARY_TEMPLATE, logArgs); } else { summaryLogger.warn(SUMMARY_TEMPLATE, logArgs); } } RemoteCallLoggerDelegate(
      Logger summaryLogger,
      Logger detailLogger,
      @Nullable PrettyPrinterInterface prettyPrinter,
      RemoteCallType remoteCallType); }
RemoteCallLoggerDelegate { public void logRequestSummary(RemoteCallReturn remoteCallReturn) { if (remoteCallReturn == null) { return; } boolean isSuccess = remoteCallReturn.getException() == null; if (!isSummaryLoggable(isSuccess)) { return; } RequestInfo request = remoteCallReturn.getRequestInfo(); ResponseInfo response = remoteCallReturn.getResponseInfo(); Object[] logArgs = new Object[10]; if (request != null) { logArgs[0] = request.getServiceName(); logArgs[1] = request.getMethodName(); logArgs[2] = request.getContextName(); logArgs[3] = request.getContextValue(); logArgs[4] = request.getUrl(); } if (response != null) { logArgs[5] = response.getRequestId(); logArgs[6] = response.getResponseTime(); logArgs[7] = response.getOperationsCount(); Throwable throwable = remoteCallReturn.getException(); logArgs[8] = throwable != null; logArgs[9] = truncateThrowable(throwable, MAX_SUMMARY_ERROR_LENGTH); } if (isSuccess) { summaryLogger.info(SUMMARY_TEMPLATE, logArgs); } else { summaryLogger.warn(SUMMARY_TEMPLATE, logArgs); } } RemoteCallLoggerDelegate(
      Logger summaryLogger,
      Logger detailLogger,
      @Nullable PrettyPrinterInterface prettyPrinter,
      RemoteCallType remoteCallType); boolean isSummaryLoggable(boolean isSuccess); boolean isDetailsLoggable(boolean isSuccess); void logRequestDetails(RemoteCallReturn remoteCallReturn); void logRequestSummary(RemoteCallReturn remoteCallReturn); }
RemoteCallLoggerDelegate { public void logRequestSummary(RemoteCallReturn remoteCallReturn) { if (remoteCallReturn == null) { return; } boolean isSuccess = remoteCallReturn.getException() == null; if (!isSummaryLoggable(isSuccess)) { return; } RequestInfo request = remoteCallReturn.getRequestInfo(); ResponseInfo response = remoteCallReturn.getResponseInfo(); Object[] logArgs = new Object[10]; if (request != null) { logArgs[0] = request.getServiceName(); logArgs[1] = request.getMethodName(); logArgs[2] = request.getContextName(); logArgs[3] = request.getContextValue(); logArgs[4] = request.getUrl(); } if (response != null) { logArgs[5] = response.getRequestId(); logArgs[6] = response.getResponseTime(); logArgs[7] = response.getOperationsCount(); Throwable throwable = remoteCallReturn.getException(); logArgs[8] = throwable != null; logArgs[9] = truncateThrowable(throwable, MAX_SUMMARY_ERROR_LENGTH); } if (isSuccess) { summaryLogger.info(SUMMARY_TEMPLATE, logArgs); } else { summaryLogger.warn(SUMMARY_TEMPLATE, logArgs); } } RemoteCallLoggerDelegate(
      Logger summaryLogger,
      Logger detailLogger,
      @Nullable PrettyPrinterInterface prettyPrinter,
      RemoteCallType remoteCallType); boolean isSummaryLoggable(boolean isSuccess); boolean isDetailsLoggable(boolean isSuccess); void logRequestDetails(RemoteCallReturn remoteCallReturn); void logRequestSummary(RemoteCallReturn remoteCallReturn);  }