perf4J 与 MDC
有谁知道 perf4J 是否支持 log4j MDC。我的所有日志语句都附加了 MDC 值,但是 perf4J 日志语句不显示 MDC 值。
请参阅下文,我希望 MDCMappedValue 也显示在 [TimingLogger] 日志语句的末尾。
18:35:48,038 INFO [LoginAction] 将用户 kermit 登录到应用程序 - MDCMappedValue 18:35:48,749 INFO [PostAuthenticationHandler] doPostAuthenticate() 已启动 - MDCMappedValue 18:36:03,653 INFO [PostAuthenticationHandler] 为 kermit 加载配置文件 - MDCMappedValue 18:36 :08,224 INFO [TimingLogger] start[1300905347914] time[20310] tag[HTTP.Success] message[/csa/login.seam] -
18:36:09,142 INFO [TimingLogger] 开始[1300905368240] 时间[902] 标签[HTTP.Success] 消息[/csa/home.seam] -
Does anyone know if perf4J has support for log4j MDC. All my log statements are appended with MDC values, however the perf4J log statements don't show the MDC value.
Please see below, I expect MDCMappedValue to be shown at the end of [TimingLogger] log statements as well.
18:35:48,038 INFO [LoginAction] Logging in user kermit into application - MDCMappedValue 18:35:48,749 INFO [PostAuthenticationHandler] doPostAuthenticate() started - MDCMappedValue 18:36:03,653 INFO [PostAuthenticationHandler] Profile Loaded for kermit - MDCMappedValue 18:36:08,224 INFO [TimingLogger] start[1300905347914] time[20310] tag[HTTP.Success] message[/csa/login.seam] -
18:36:09,142 INFO [TimingLogger] start[1300905368240] time[902] tag[HTTP.Success] message[/csa/home.seam] -
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的测试似乎产生了预期的结果。请注意,我使用
Log4JStopWatch
,而不是LoggingStopWatch
:我的 log4j.properties 如下:
输出为:
My test seems to produce the expected results. Notice that I use the
Log4JStopWatch
, not theLoggingStopWatch
:My log4j.properties is as follows:
And the output is: