apache / apache/servicecomb-java-chassis

demo中的traceid无法打印

Open
#3,896 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
1.9k
Forks
814
Avg merge
8d 23h
Merged PRs (30d)
1

Description

最近看文档的[2.0.1 新特性介绍: 在日志中记录trace id](https://servicecomb.incubator.apache.org/references/java-chassis/zh_CN/featured-topics/features/trace-id.html),我按照文档里的说明配置了一下,发现实际traceid存在,但是最终日志/console不会打印。
刚才运行[servicecomb-java-chassis/demo/demo-jaxrs](https://github.com/apache/servicecomb-java-chassis/tree/master/demo/demo-jaxrs)看了下,发现traceid也是存在的,但是日志没有打印,请问是还需要别的配置吗?
比如:
```log
[2023-08-11 09:59:36,128][transport-vert.x-eventloop-thread-0][ERROR][org.apache.servicecomb.core.exception.DefaultExceptionProcessor:158][] failed to invoke jaxrs.MultiErrorCodeService.errorCodeWithHeader, endpoint=rest://192.168.56.1:8080, trace id=64d5960891532378.
```
最后一个`[]`按配置是`[%X{SERVICECOMB_TRACE_ID}]`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue in demo/demo-jaxrs and compare its behavior with the trace-id documentation linked in the report. Check how the configured [%X{SERVICECOMB_TRACE_ID}] value is expected to reach the console log; done means the existing trace ID appears in the final log output.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.