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")