JavaのWebアプリケーション開発フレームワークによる、Webサイト開発の顛末記です。

EclipseのMavenを使った、Spring-MVC、Thymeleaf、MyBatis 等のプログラミングテクニックを、
備忘録的に記録しています。実際に動くソースコードを多用して説明していますので、
これからEclipseや、Spring-MVCを始めたいと思っている人にとって、少しでも参考になれば幸いです。
Spring-MVCの散歩道 > Spring Boot の小径 > 第4歩 Spring Boot 匍匐前進 > ロギング

buildscript {
    ext {
        springBootVersion = '1.3.8.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'spring-boot'
apply plugin: 'war'

war {
    baseName = 'bootLabo'
    version = '1.0'
}

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

configurations {
    providedRuntime
}
//ここまでは、変更なし

dependencies {
    [
        //以下のライブラリは、依存関係でlogbackをインポートするので
        //このライブラリからlogbackの依存を排除します。
        'org.springframework.boot:spring-boot-starter-web',
        'org.springframework.boot:spring-boot-starter-aop',
        'org.springframework.boot:spring-boot-starter-thymeleaf',
        'org.springframework.boot:spring-boot-configuration-processor'
    ].each { dep ->
            compile(dep) {
                //上記のライブラリから、logbackの依存を排除する(logback)を無効にする
                exclude module: 'spring-boot-starter-logging'
                exclude module: 'logback-classic'
            }
        }

    //TEST
    [
        //テスト用boot-starter もlogbackに依存しているのでこちらも無効化
        'org.springframework.boot:spring-boot-starter-test'
    ].each { dep ->
            testCompile(dep) {
                //logback依存を排除する
                exclude module: 'spring-boot-starter-logging'
                exclude module: 'logback-classic'
            }
        }

    runtime('org.postgresql:postgresql')
    providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
    compile('org.projectlombok:lombok:1.16.12')
    //Log4j2 ライブラリを追加
    compile('org.springframework.boot:spring-boot-starter-log4j2')
}