logging.config configuration for spring boot -
i wanted configure location of log4j.xml file in spring boot application. have added logging.config property application.properties configuration, indicating log4j.xml file path. seems property ignored. should work accorindg spring boot docs:
logging.config= # location of config file (default classpath:logback.xml logback)
have did wrong?
spring boot includes starters can used if want exclude or swap specific technical facets. it's using logback
default, if you're gonna use log4j
add spring-boot-starter-log4j
in classpath. example, maven this:
<dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-log4j2</artifactid> <version>1.2.4.release</version> </dependency>
and log4j 1.x:
<dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-log4j</artifactid> <version>1.2.4.release</version> </dependency>
then add logging.config
application.properties
:
logging.config = classpath:path/to/log4j.xml
Comments
Post a Comment