我正在开发一个使用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有可能改变这样的轨迹格式吗?
提前感谢
发布于 2020-01-22 08:34:54
您看到的格式是内部AI调试日志格式,例如
AI: INFO 10-01-2020 07:48:00.819+0000, 1(main): Agent is not running当前无法更改此格式。
但是,如果您想分享反馈,请在here中添加有关您正在尝试实现的场景的其他详细信息,这将允许产品团队相应地评估该请求。谢谢
https://stackoverflow.com/questions/59677454
复制相似问题