Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i change logback version in spring boot?

I want to use logback smtp appender in my spring boot application, but somehow spring boot default logback 1.1.7 dependency does not work well with SMTP appenders. How can I downgrade spring boot provided logback library from 1.1.7 to 1.1.6? I am using gradle for build management.

Update

It worked after i tried Andy's Answer, so now my build.gradle file looks like this

buildscript {
...    
 ext['logback.version'] = '1.1.6'
 ...
}
like image 976
Munish Chandel Avatar asked Jul 20 '16 09:07

Munish Chandel


People also ask

Does spring boot use Logback by default?

By default, Spring Boot picks up the native configuration from its default location for the system (such as classpath:logback. xml for Logback), but you can set the location of the config file by using the "logging. config" property.

How do you specify Logback xml in application properties?

If you name your configuration file logback-spring. xml , rather than logback. xml , you can use <springProperty> to access properties from Spring's environment including those configured in application. properties .

Where does Logback xml go in spring boot?

In a Spring Boot application, you can put the Logback. xml file in the resources folder. If your Logback. xml file is outside the classpath, you need to point to its location using the Logback.


1 Answers

Your best bet is to override the logback.version property. This will ensure that you get the desired version of Logback everywhere:

ext['logback.version'] = '1.1.6'
like image 60
Andy Wilkinson Avatar answered Oct 17 '22 04:10

Andy Wilkinson