From e8724f333d7c33a0a01268ac379e2dfdaee87932 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Sat, 7 Sep 2024 13:27:02 +0900 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20=E3=83=AD=E3=82=AC=E3=83=BC?= =?UTF-8?q?=E3=82=92logback=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=A6?= =?UTF-8?q?=E6=A7=8B=E9=80=A0=E5=8C=96=E3=83=AD=E3=82=B0=E3=82=92=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + build.gradle.kts | 6 ---- hideout-core/build.gradle.kts | 25 ++++++------- .../src/main/resources/application.yml | 2 ++ hideout-core/src/main/resources/log4j2.xml | 19 ---------- .../src/main/resources/logback-spring.xml | 15 ++++++++ hideout-core/src/main/resources/logback.xml | 35 ------------------- hideout-mastodon/build.gradle.kts | 7 ---- 8 files changed, 29 insertions(+), 81 deletions(-) delete mode 100644 hideout-core/src/main/resources/log4j2.xml create mode 100644 hideout-core/src/main/resources/logback-spring.xml delete mode 100644 hideout-core/src/main/resources/logback.xml diff --git a/.gitignore b/.gitignore index 9f79d3cb..e3b32bdc 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ out/ /hideout-core/.kotlin/sessions/ /hideout-mastodon/.kotlin/sessions/ /http-client.private.env.json +/logs/ diff --git a/build.gradle.kts b/build.gradle.kts index 2906c67f..a6acf140 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -48,12 +48,6 @@ repositories { } } } -configurations { - all { - exclude("org.springframework.boot", "spring-boot-starter-logging") - exclude("ch.qos.logback", "logback-classic") - } -} dependencies { implementation("dev.usbharu:hideout-core:0.0.1") diff --git a/hideout-core/build.gradle.kts b/hideout-core/build.gradle.kts index 10054038..369efa81 100644 --- a/hideout-core/build.gradle.kts +++ b/hideout-core/build.gradle.kts @@ -90,7 +90,6 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-security") implementation("org.springframework.boot:spring-boot-starter-thymeleaf") - implementation("org.springframework.boot:spring-boot-starter-log4j2") implementation("org.springframework.boot:spring-boot-starter-validation") annotationProcessor("org.springframework:spring-context-indexer") @@ -126,7 +125,7 @@ dependencies { implementation(libs.http.signature) implementation(libs.emoji.kt) - + implementation("co.elastic.logging:logback-ecs-encoder:1.6.0") testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation(libs.kotlin.junit) @@ -134,7 +133,6 @@ dependencies { testImplementation(libs.ktor.client.mock) testImplementation(libs.h2db) testImplementation(libs.mockito.kotlin) - } detekt { @@ -145,14 +143,20 @@ detekt { autoCorrect = true } -configurations.matching { it.name == "detekt" }.all { - resolutionStrategy.eachDependency { - if (requested.group == "org.jetbrains.kotlin") { - useVersion(io.gitlab.arturbosch.detekt.getSupportedKotlinVersion()) +configurations { + matching { it.name == "detekt" }.all { + resolutionStrategy.eachDependency { + if (requested.group == "org.jetbrains.kotlin") { + useVersion(io.gitlab.arturbosch.detekt.getSupportedKotlinVersion()) + } } } + all { + exclude("org.apache.logging.log4j", "log4j-slf4j2-impl") + } } + //tasks{ // bootRun { // sourceResources(sourceSets.main.get()) @@ -176,13 +180,6 @@ tasks.withType().configure exclude("**/org/koin/ksp/generated/**", "**/generated/**") } -configurations { - all { - exclude("org.springframework.boot", "spring-boot-starter-logging") - exclude("ch.qos.logback", "logback-classic") - } -} - project.gradle.taskGraph.whenReady { println(this.allTasks) this.allTasks.map { println(it.name) } diff --git a/hideout-core/src/main/resources/application.yml b/hideout-core/src/main/resources/application.yml index 81d62b8a..3c3df36d 100644 --- a/hideout-core/src/main/resources/application.yml +++ b/hideout-core/src/main/resources/application.yml @@ -4,6 +4,8 @@ hideout: private: true spring: + application: + name: hideout data: mongodb: auto-index-creation: true diff --git a/hideout-core/src/main/resources/log4j2.xml b/hideout-core/src/main/resources/log4j2.xml deleted file mode 100644 index a4436af8..00000000 --- a/hideout-core/src/main/resources/log4j2.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hideout-core/src/main/resources/logback-spring.xml b/hideout-core/src/main/resources/logback-spring.xml new file mode 100644 index 00000000..62421f27 --- /dev/null +++ b/hideout-core/src/main/resources/logback-spring.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hideout-core/src/main/resources/logback.xml b/hideout-core/src/main/resources/logback.xml deleted file mode 100644 index 8a8ec24f..00000000 --- a/hideout-core/src/main/resources/logback.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - logFile.log - - UTF-8 - %d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level [%X{x-request-id}] %logger{36} - %msg%n - - - - logFile.%d{yyyy-MM-dd_HH}.log - - - 30 - - - - - %d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level [%X{x-request-id},%X{x-job-id}] %logger{36} - - %msg%n - - - - - - - - - - - - - - - - diff --git a/hideout-mastodon/build.gradle.kts b/hideout-mastodon/build.gradle.kts index 27da44bb..2265937b 100644 --- a/hideout-mastodon/build.gradle.kts +++ b/hideout-mastodon/build.gradle.kts @@ -41,19 +41,12 @@ repositories { } } -configurations { - all { - exclude("org.springframework.boot", "spring-boot-starter-logging") - exclude("ch.qos.logback", "logback-classic") - } -} dependencies { detektPlugins(libs.detekt.formatting) implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-security") implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") - implementation("org.springframework.boot:spring-boot-starter-log4j2") implementation("dev.usbharu:hideout-core:0.0.1") From c26e8aea4bffedee19379767bf1e973652e0be2f Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Sat, 7 Sep 2024 13:30:46 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20version=20catalog=E3=82=92?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hideout-core/build.gradle.kts | 3 +-- libs.versions.toml | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hideout-core/build.gradle.kts b/hideout-core/build.gradle.kts index 369efa81..88b2bca3 100644 --- a/hideout-core/build.gradle.kts +++ b/hideout-core/build.gradle.kts @@ -124,8 +124,7 @@ dependencies { implementation(libs.http.signature) implementation(libs.emoji.kt) - - implementation("co.elastic.logging:logback-ecs-encoder:1.6.0") + implementation(libs.logback.ecs.encoder) testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation(libs.kotlin.junit) diff --git a/libs.versions.toml b/libs.versions.toml index 5703b22b..19c43727 100644 --- a/libs.versions.toml +++ b/libs.versions.toml @@ -105,6 +105,8 @@ mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version = "5.4. http-signature = { module = "dev.usbharu:http-signature", version = "1.0.0" } emoji-kt = { module = "dev.usbharu:emoji-kt", version = "2.0.0" } +logback-ecs-encoder = { module = "co.elastic.logging:logback-ecs-encoder", version = "1.6.0" } + [bundles] exposed = ["exposed-core", "exposed-java-time", "exposed-jdbc", "exposed-spring"]