【问题标题】:MDC Logging With MuleSoft Runtime 4.4使用 MuleSoft Runtime 4.4 进行 MDC 日志记录
【发布时间】:2021-12-22 19:08:34
【问题描述】:

我在 Anypoint Studio 中遇到 MDC 问题。我在运行时 4.4 中使用新模块在记录器中设置变量,但它不起作用。在控制台中,我有这样的输出。但是在文档中我发现 logger 也应该像这样向我显示这个 set 变量:

INFO 2021-04-08 16:58:26,882 [[MuleRuntime].uber.15: [test-project-app].exmapleFlow.CPU_LITE @18f679] [{correlationId=c85e16c0-98a4-11eb- bc34-cac765a2219b,processorPath=exmapleFlow/processors/2,testVar=testValue}] org.mule.runtime.core.internal.processor.LoggerMessageProcessor:示例

enter image description here

【问题讨论】:

标签: logging mule mulesoft anypoint-studio


【解决方案1】:

您必须编辑 log4j2.xml。默认是这样说的:

[processor: %X{processorPath}; event: %X{correlationId}]

但你需要这样的东西:

[%MDC]

它实际上在文档中:https://docs.mulesoft.com/mule-runtime/4.4/logging-mdc#example-log4j2-xml-file-configurations

【讨论】:

  • 是的,我改了这个,但还是不行。我有这样的:
【解决方案2】:

您必须与 %MDC 一起稍微更改 log4j2.xml 附加程序。

找到下面的工作示例链接,如果你按照下面的链接,我相信它会起作用。

https://help.mulesoft.com/s/question/0D52T00005aW7E2SAK/mdc-logging-in-mulesoft-runtime-44

【讨论】:

    猜你喜欢
    • 2014-09-27
    • 2021-06-26
    • 2019-01-31
    • 1970-01-01
    • 2012-03-24
    • 1970-01-01
    • 2012-05-11
    • 2011-03-01
    • 1970-01-01
    相关资源
    最近更新 更多