Azure Application Insights控制台日志格式

问题描述 投票:1回答:1

我正在使用azure Application Insights的spring-boot应用程序。对于在控制台中显示并使用logback配置的日志,我具有定义的格式]

<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
        <layout>
            <Pattern>%d{ISO8601} %level class=%C{1.} %X{requestKey} msg=%msg%n%throwable </Pattern>
        </layout>
</appender>

<appender name="aiAppender"
              class="com.microsoft.applicationinsights.logback.ApplicationInsightsAppender">
</appender>

问题是AI在cosole中显示的日志如下所示:

2020-01-10 08:47:58,089 INFO class=org.springframework.boot.web.embedded.tomcat.TomcatWebServer  msg=Tomcat initialized with port(s): 8080 (http)
2020-01-10 08:47:58,802 INFO class=org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext  msg=Root WebApplicationContext: initialization completed in 8435 ms
AI: INFO 10-01-2020 07:48:00.819+0000, 1(main): Agent is not running

我不想显示AI:以这种方式记录日志,我的意思是,我想将这些跟踪格式更改为控制台附加程序中定义的相同格式:

2020-01-10 08:47:58,802 INFO class=com.microsoft.blabla.ApplicationInsights msg=Agent is not running

是否可以更改这种跟踪格式?

提前感谢

我正在使用azure Application Insights的spring-boot应用程序。我为控制台中显示的日志定义了格式,这些日志配置了logback

azure spring-boot logging logback azure-application-insights
1个回答
0
投票

您看到的格式是内部AI调试日志记录格式,例如

© www.soinside.com 2019 - 2024. All rights reserved.