Skip to content

Commit

Permalink
Update Gradle configuration for Boot projects to use Log4j2 instead o…
Browse files Browse the repository at this point in the history
…f Logback.
  • Loading branch information
vnobo committed Apr 29, 2024
1 parent 5194645 commit 88a5f10
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
10 changes: 9 additions & 1 deletion boot/authorization/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ tasks.named("bootBuildImage") {
imageName = ("${dockerPrefix}/${rootProject.name}-${project.name}:${project.version}")
environment = [
"BPE_DELIM_JAVA_TOOL_OPTIONS" : " ",
"BPE_APPEND_JAVA_TOOL_OPTIONS": "-Dfile.encoding=UTF-8"
"BPE_APPEND_JAVA_TOOL_OPTIONS": "-Dfile.encoding=UTF-8 " +
"-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager"
]
publish = true
docker {
Expand All @@ -45,6 +46,13 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-oauth2-authorization-server'
implementation("org.springframework.boot:spring-boot-starter-security")

implementation("org.springframework.boot:spring-boot-starter-log4j2")
modules {
module("org.springframework.boot:spring-boot-starter-logging") {
replacedBy("org.springframework.boot:spring-boot-starter-log4j2", "Use Log4j2 instead of Logback")
}
}

compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
Expand Down
11 changes: 9 additions & 2 deletions boot/platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ tasks.named("bootBuildImage") {
imageName = ("${dockerPrefix}/${rootProject.name}-${project.name}:${project.version}")
environment = [
"BPE_DELIM_JAVA_TOOL_OPTIONS" : " ",
"BPE_APPEND_JAVA_TOOL_OPTIONS": "-Dfile.encoding=UTF-8"
"BPE_APPEND_JAVA_TOOL_OPTIONS": "-Dfile.encoding=UTF-8 " +
"-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager"
]
publish = true
docker {
Expand All @@ -44,9 +45,15 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.boot:spring-boot-starter-validation")

implementation("org.springframework.boot:spring-boot-starter-data-redis-reactive")

implementation("org.springframework.boot:spring-boot-starter-log4j2")
modules {
module("org.springframework.boot:spring-boot-starter-logging") {
replacedBy("org.springframework.boot:spring-boot-starter-log4j2", "Use Log4j2 instead of Logback")
}
}

implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
implementation("org.postgresql:r2dbc-postgresql")
implementation("io.r2dbc:r2dbc-spi")
Expand Down

0 comments on commit 88a5f10

Please sign in to comment.