默认Spring Bootlog4j2日志patterns

时间:2016-04-11 09:36:46

标签: spring-boot log4j2

Spring boot附带了几个默认的日志记录框架配置,包括Log4j2。虽然有关于登录Spring引导参考手册的详细文档,但没有提到配置默认日志模式的方式和位置,这使得很难覆盖它。

问题是Spring Boot在哪里配置Log4j2的默认日志模式?

到目前为止,我已经查看了Spring Boot的以下位置:

AutoConfigurationReportLoggingInitializer
LoggingApplicationListener
SimpleFormatter
LoggingSystem
Log4J2LoggingSystem

1 个答案:

答案 0 :(得分:3)

似乎Log4J2配置没有在任何Java类中完成,所以我看错了地方。 Spring Boot附带了两个文件log4j2.xmllog4j2-file.xml,其中包含默认配置,可以在org.springframework.boot.logging.log4j2中找到。

相关问题