Spring,Mybatis和Logback集成的时候,考虑到不同环境下,打印的日志级别不一样,采用spring profile active的方式来做,但是在网上搜了很多都是spring boot提供这种springProfile,就是spring profile active的方式来做,而spring没有,继续搜集资料发现一篇文章:
Spring Configuration: If you want to configure Logback components (Appenders, Layouts, etc) in applicationContext.xml instead of logback.xml to take advantage of the many Spring configuration features (PropertyPlaceholderConfigurer, Spring environment profiles, etc), you can follow the following steps.
来源:https://github.com/qos-ch/logback-extensions/wiki/Spring
于是项目中加入logback.xml,applicationContext.xml,在applicationContext.xml中&#