From f1bb82c1dec91f95044e2272d80ff8549822dadd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=9B=A8=E7=96=8F?= <35320326+wildeslam@users.noreply.github.com> Date: Mon, 13 Nov 2023 01:33:40 -0600 Subject: [PATCH] feat: add more logs (#211) * feat: add more logs * feat: add more logs * feat: add more logs --------- Co-authored-by: yushuwang --- .../planexecution/impl/DefaultExecutionContextProvider.java | 6 ++++-- .../schedule/sender/impl/DefaultDubboReplaySender.java | 6 +++++- .../schedule/sender/impl/DefaultHttpReplaySender.java | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/arex-schedule-web-api/src/main/java/com/arextest/schedule/planexecution/impl/DefaultExecutionContextProvider.java b/arex-schedule-web-api/src/main/java/com/arextest/schedule/planexecution/impl/DefaultExecutionContextProvider.java index 7d7d72017..b3e87ad35 100644 --- a/arex-schedule-web-api/src/main/java/com/arextest/schedule/planexecution/impl/DefaultExecutionContextProvider.java +++ b/arex-schedule-web-api/src/main/java/com/arextest/schedule/planexecution/impl/DefaultExecutionContextProvider.java @@ -125,8 +125,10 @@ public void onBeforeContextExecution( if (StringUtils.isEmpty(plan.getErrorMessage())) { plan.setErrorMessage(warmupCase.getSendErrorMessage()); } - throw new RuntimeException( - "Failed to warmup context: " + currentContext + " with case:" + warmupCase); + String errorMsg = + "Failed to warmup context: " + currentContext + " with case:" + warmupCase; + LOGGER.error(errorMsg); + throw new RuntimeException(errorMsg); } return true; }); diff --git a/arex-schedule-web-api/src/main/java/com/arextest/schedule/sender/impl/DefaultDubboReplaySender.java b/arex-schedule-web-api/src/main/java/com/arextest/schedule/sender/impl/DefaultDubboReplaySender.java index 4eb25593b..6a821251c 100644 --- a/arex-schedule-web-api/src/main/java/com/arextest/schedule/sender/impl/DefaultDubboReplaySender.java +++ b/arex-schedule-web-api/src/main/java/com/arextest/schedule/sender/impl/DefaultDubboReplaySender.java @@ -69,11 +69,13 @@ DubboInvocation generateDubboInvocation(ReplayActionCaseItem caseItem, ImmutablePair interfaceNameAndMethod = getInterfaceNameAndMethod(caseItem.getParent().getOperationName()); if (interfaceNameAndMethod == null) { + LOGGER.error("getInterfaceNameAndMethod failed, caseItem:{}", caseItem); return null; } ServiceInstance instanceRunner = selectLoadBalanceInstance(caseItem.getId(), caseItem.getParent().getTargetInstance()); if (instanceRunner == null) { + LOGGER.error("selectLoadBalanceInstance failed, caseItem:{}", caseItem); return null; } String url = instanceRunner.getUrl(); @@ -102,11 +104,13 @@ private boolean doSend(ReplayActionCaseItem caseItem, Map header } } if (replayInvokeResult == null) { + LOGGER.error("replayInvokeResult is null, caseItem:{}", caseItem); return false; } if (replayInvokeResult.getErrorMsg() != null) { - LOGGER.error("dubbo invoke error msg:{}", replayInvokeResult.getErrorMsg()); + LOGGER.error("dubbo invoke error msg:{}, thrown:{}", replayInvokeResult.getErrorMsg(), + replayInvokeResult.getException()); } ReplaySendResult targetSendResult = fromDubboResult(headers, dubboInvocation.getUrl(), diff --git a/arex-schedule-web-api/src/main/java/com/arextest/schedule/sender/impl/DefaultHttpReplaySender.java b/arex-schedule-web-api/src/main/java/com/arextest/schedule/sender/impl/DefaultHttpReplaySender.java index 4dd644520..38909e6c5 100644 --- a/arex-schedule-web-api/src/main/java/com/arextest/schedule/sender/impl/DefaultHttpReplaySender.java +++ b/arex-schedule-web-api/src/main/java/com/arextest/schedule/sender/impl/DefaultHttpReplaySender.java @@ -70,6 +70,7 @@ private boolean doSend(ReplayActionItem replayActionItem, ReplayActionCaseItem c ServiceInstance instanceRunner = selectLoadBalanceInstance(caseItem.getId(), replayActionItem.getTargetInstance()); if (instanceRunner == null) { + LOGGER.error("selectLoadBalanceInstance failed, caseItem:{}", caseItem); return false; } String operationName = caseItem.requestPath();