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 2021/03/02 03:19:20 UTC

[GitHub] [servicecomb-java-chassis] xien0 opened a new issue #2266: 2.0之后业务日志打印traceId和类信息

xien0 opened a new issue #2266:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2266


   新增handler后打印出来的类信息都是代理类的,但是实际上需要的是具体业务的类信息,请问这个有没有其他的解决方案?
   ![traceId](https://user-images.githubusercontent.com/17806860/109591756-0f08dc00-7b49-11eb-9799-d892f82eb62a.png)
   


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

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



[GitHub] [servicecomb-java-chassis] xien0 commented on issue #2266: 2.0之后业务日志打印traceId和类信息

Posted by GitBox <gi...@apache.org>.
xien0 commented on issue #2266:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2266#issuecomment-789342080


   (Invocation) ContextUtils.getInvocationContext()可直接获取到traceId,这种方式对业务开发可能不大友好,但是确实可以解决这个问题;关于traceId的信息官方文档介绍很少,看了TraceIdGenerator接口的实现,在nexTraceIdHigh(int random)方法里使用当前系统的epochSecond做为高32位,random做低32位,但是不知道如何计算它的重复概率,如有解答,不胜感激。


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

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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2266: 2.0之后业务日志打印traceId和类信息

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2266:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2266#issuecomment-788725598


   没有好的方法。 可以参考 TraceIdLogger 的代码, 在每个记录日志的地方使用, 能够满足要求,就是代码有些重复。 


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

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