Merge pull request 'watchdog-be: ログを記録するように' (#15) from watchdog-be into master

Reviewed-on: #15
This commit is contained in:
usbharu 2024-03-14 07:15:33 +00:00
commit f69d444309
2 changed files with 6 additions and 0 deletions

View File

@ -37,6 +37,7 @@ dependencies {
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm") implementation("io.ktor:ktor-serialization-kotlinx-json-jvm")
implementation("io.ktor:ktor-server-netty-jvm") implementation("io.ktor:ktor-server-netty-jvm")
implementation("io.ktor:ktor-server-cors") implementation("io.ktor:ktor-server-cors")
implementation("io.ktor:ktor-server-call-logging")
implementation("ch.qos.logback:logback-classic:1.5.3") implementation("ch.qos.logback:logback-classic:1.5.3")
} }

View File

@ -9,9 +9,11 @@ import io.grpc.ServerBuilder
import io.ktor.http.* import io.ktor.http.*
import io.ktor.serialization.kotlinx.json.* import io.ktor.serialization.kotlinx.json.*
import io.ktor.server.application.* import io.ktor.server.application.*
import io.ktor.server.plugins.callloging.*
import io.ktor.server.plugins.contentnegotiation.* import io.ktor.server.plugins.contentnegotiation.*
import io.ktor.server.plugins.cors.routing.* import io.ktor.server.plugins.cors.routing.*
import io.ktor.server.routing.* import io.ktor.server.routing.*
import org.slf4j.event.Level
import java.net.URI import java.net.URI
fun main(args: Array<String>) { fun main(args: Array<String>) {
@ -33,6 +35,9 @@ fun Application.module() {
allowCredentials = true allowCredentials = true
allowNonSimpleContentTypes = true allowNonSimpleContentTypes = true
} }
install(CallLogging){
level = Level.TRACE
}
val url = environment.config.property("watchdog.db.url").getString() val url = environment.config.property("watchdog.db.url").getString()
val databaseName = environment.config.property("watchdog.db.database").getString() val databaseName = environment.config.property("watchdog.db.database").getString()