springboot+gradle+log4j的配置

configurations {    
    compile.exclude module: 'spring-boot-starter-logging'//排除對默認logging的依賴
}

dependencies {    
    testCompile group: 'junit', name: 'junit', version: '4.12' 
    compile("org.springframework.boot:spring-boot-starter-web:1.4.0.RELEASE")  
    //添加對log4j starter的依賴。
    compile("org.springframework.boot:spring-boot-starter-log4j:1.3.7.RELEASE") 
}

或者

我用第二種時 'exclude'單詞報"can't resolve symbol 'exclude' "結果不影響  添加依賴沒得問題

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章