You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2022/07/26 01:11:13 UTC

[GitHub] [servicecomb-java-chassis] lizeze commented on a diff in pull request #2644: SCB-2360 Provides a unified switch to control exception stack printing

lizeze commented on code in PR #2644:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2644#discussion_r929438785


##########
core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java:
##########
@@ -125,10 +128,15 @@ public Response doInvoke(Invocation invocation, SwaggerProducerOperation produce
       invocation.onBusinessMethodFinish();
       invocation.onBusinessFinish();
     } catch (Throwable e) {
-      if (shouldPrintErrorLog(e)) {
-        invocation.getTraceIdLogger().error(LOGGER, "unexpected error operation={}, message={}",
-            invocation.getInvocationQualifiedName(),
-            org.apache.servicecomb.foundation.common.utils.ExceptionUtils.getExceptionMessageWithoutTrace(e));
+      if (DynamicPropertyFactory.getInstance().getBooleanProperty(Const.PRINT_SENSITIVE_ERROR_MESSAGE,

Review Comment:
   请问为什么`servicecomb.error.printSensitiveErrorMessage`==`true`的时候不使用用`invocation.getTraceIdLogger().error`打印日志呢?这样打出的异常堆栈没有`trace id`,根据`trace id` 查询错误日志的时候会漏掉这个信息呢



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org