【问题标题】:How to use RequestContext custom attributes of armeria in log4j2.xml configuration?如何在 log4j2.xml 配置中使用 armeria 的 RequestContext 自定义属性?
【发布时间】:2021-05-09 13:26:06
【问题描述】:

我正在使用 log4j2 2.14.0armeria 1.3.0。根据 armeria 文档,我可以看到 RequestContext custom atrributes 可以在 logback 配置中使用 com.linecorp.armeria.common.logback.RequestContextExportingAppender 导出。因此,我尝试在 log4j2.xml 中对其进行配置,但没有成功。有什么方法可以使用属性在 log4j2.xml 中设置 %X{some_value} 吗?或者是否可以将 ThreadContext(如 MDC)与 armeria 一起使用?

【问题讨论】:

    标签: log4j2 mdc threadcontext armeria


    【解决方案1】:

    Armeria 目前还没有 RequestContextExportingAppender 的 Log4J2 版本。请订阅this GitHub issue继续关注。

    【讨论】:

      猜你喜欢
      • 2022-01-04
      • 2021-08-02
      • 2014-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-28
      • 1970-01-01
      • 2019-11-27
      相关资源
      最近更新 更多