In spring boot, you can define multiple environments in the springprofile tag in Logback.xml
Logback.xml:
<Springprofilename= "Production"> <Root Level= "DEBUG"> <Appender-refref= "STDOUT"/> </Root></Springprofile><Springprofilename= "Dev"> <Root Level= "DEBUG"> <Appender-refref= "CONSOLE"/> </Root></Springprofile>
Now you want to split the Logback.xml file into logback-production.xml,logback-dev.xml two files (logback-{profile}.xml) instead of being defined in the same file. The app then determines which configuration file to use based on profile.
Application.properties Inside Configuration:
Logging.config:classpath:logback-${spring.profiles.active}.xml
Specify at startup:
Java-jar Xxx.jar--spring.profiles.active=dev
You can also specify in Application.properties:
Spring.profiles.active=dev
Reference:
https://docs.spring.io/spring-boot/docs/1.5.7.RELEASE/reference/htmlsingle/# Boot-features-custom-log-configuration (Official configuration reference, all the answers are here)
http://blog.csdn.net/m0_37895333/article/details/72457007
Http://www.cnblogs.com/wuyechun/p/6800956.html
http://blog.csdn.net/vitech/article/details/53812137
Implement Logback Multi-day environment log configuration in Spring boot