Default Spring Boot log4j2 log pattern

时光总嘲笑我的痴心妄想 提交于 2019-12-24 01:42:25

问题


Spring boot ships with several default logging framework configurations including Log4j2. While there is detailed documentation about logging in the Spring boot reference manual it does not mention how and where exactly the default log pattern is configured, which makes it difficult to override this.

The question is where does Spring Boot configure the default log pattern of for Log4j2?

So far I have looked in the following places of Spring Boot:

AutoConfigurationReportLoggingInitializer
LoggingApplicationListener
SimpleFormatter
LoggingSystem
Log4J2LoggingSystem

回答1:


It seems the Log4J2 configuration is not done in any Java class so I was looking at the wrong place. Spring Boot ships with two files log4j2.xml and log4j2-file.xml which contain the default configuration and can be found in org.springframework.boot.logging.log4j2.



来源:https://stackoverflow.com/questions/36544980/default-spring-boot-log4j2-log-pattern

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!