Skip to content

SCB-2360 Provides a unified switch to control exception stack printing - #2644

Merged
liubao68 merged 2 commits into
apache:masterfrom
develpoerX:SCB-2360
Nov 25, 2021
Merged

liubao68 merged 2 commits into
apache:masterfrom
develpoerX:SCB-2360

Conversation

@develpoerX

Copy link
Copy Markdown
Contributor

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SCB-XXX] Fixes bug in ApproximateQuantiles, where you replace SCB-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install -Pit to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@codecov-commenter

codecov-commenter commented Nov 23, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #2644 (3ae7cc6) into master (b2a1f64) will decrease coverage by 0.02%.
The diff coverage is 51.61%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2644      +/-   ##
============================================
- Coverage     77.70%   77.68%   -0.03%     
  Complexity     1429     1429              
============================================
  Files          1598     1598              
  Lines         42727    42740      +13     
  Branches       3602     3606       +4     
============================================
+ Hits          33201    33202       +1     
- Misses         8019     8027       +8     
- Partials       1507     1511       +4     
Impacted Files Coverage Δ
...c/main/java/org/apache/servicecomb/core/Const.java 0.00% <ø> (ø)
...rvicecomb/core/ConfigurationSpringInitializer.java 74.07% <36.36%> (-2.27%) ⬇️
...apache/servicecomb/bizkeeper/BizkeeperCommand.java 95.34% <50.00%> (-4.66%) ⬇️
...comb/authentication/provider/AccessController.java 85.05% <55.55%> (-1.85%) ⬇️
...mb/core/handler/impl/ProducerOperationHandler.java 51.28% <71.42%> (-0.72%) ⬇️
.../servicecomb/registry/discovery/DiscoveryTree.java 96.49% <0.00%> (-3.51%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b2a1f64...3ae7cc6. Read the comment docs.

LOG.warn("fallback failed due to:" + e.getMessage());
if (DynamicPropertyFactory.getInstance().getBooleanProperty(Const.PRINT_SENSITIVE_ERROR_MESSAGE,
false).get()) {
LOG.warn("fallback failed due to:" + e);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOG.warn("fallback failed due to:" , e);

false).get()) {
LOG.warn("fallback failed due to:" + e);
} else {
LOG.warn("fallback failed due to:" + e.getMessage());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOG.warn("fallback failed due to {}", e.getMessage());

} catch (Exception e) {
if (DynamicPropertyFactory.getInstance().getBooleanProperty(Const.PRINT_SENSITIVE_ERROR_MESSAGE,
false).get()) {
LOGGER.warn("set up spring property source failed. msg", e);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOGGER.warn("set up spring property source failed. ", e);

@liubao68
liubao68 merged commit 8207a76 into apache:master Nov 25, 2021
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,

@tjlizz tjlizz Jul 26, 2022 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lizeze I think it's a bug, and I create #3220 to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants