Skip to content

Commit

Permalink
Add server call logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dellisd committed Mar 15, 2024
1 parent 095a0de commit 0cc0ae3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kotlin = "1.9.21"
kotlinx-serialization = "1.5.0"
sqldelight = "2.0.1"
ktlint = "0.48.2"
ktor = "2.3.4"
ktor = "2.3.9"
inject = "0.6.3"

copyWebpackPlugin = "9.1.0"
Expand All @@ -15,7 +15,7 @@ absurdSql = "0.0.53"
[libraries]
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines"}
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
kotlinx-serialization-yaml = "com.charleskorn.kaml:kaml:0.49.0"
kotlinx-serialization-yaml = "com.charleskorn.kaml:kaml:0.57.0"
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" }
kotlinx-datetime = "org.jetbrains.kotlinx:kotlinx-datetime:0.4.0"
Expand All @@ -26,6 +26,7 @@ ktor-server-netty = { module = "io.ktor:ktor-server-netty", version.ref = "ktor"
ktor-server-contentNegotiation = { module = "io.ktor:ktor-server-content-negotiation", version.ref = "ktor" }
ktor-server-autoHead = { module = "io.ktor:ktor-server-auto-head-response", version.ref = "ktor" }
ktor-server-webSockets = { module = "io.ktor:ktor-server-websockets", version.ref = "ktor" }
ktor-server-logging = { module = "io.ktor:ktor-server-call-logging", version.ref = "ktor" }
# Ktor Client
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }
Expand All @@ -50,7 +51,7 @@ assertk = { module = "com.willowtreeapps.assertk:assertk", version = "0.27.0" }
compose-mapbox = { module = "ca.derekellis.mapbox:compose-web-mapbox", version = "0.2.0-SNAPSHOT" }
spatialk-geojson = "io.github.dellisd.spatialk:geojson:0.3.0-SNAPSHOT"
kgtfs-gtfs = "ca.derekellis.kgtfs:gtfs:0.2.0-SNAPSHOT"
logback = "ch.qos.logback:logback-classic:1.2.11"
logback = "ch.qos.logback:logback-classic:1.4.14"
klock = "com.soywiz.korlibs.klock:klock:2.2.0"
clikt = "com.github.ajalt.clikt:clikt:3.5.0"
jgrapht = "org.jgrapht:jgrapht-core:1.5.1"
Expand Down
1 change: 1 addition & 0 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies {
implementation(libs.ktor.server.core)
implementation(libs.ktor.server.contentNegotiation)
implementation(libs.ktor.server.autoHead)
implementation(libs.ktor.server.logging)
implementation(libs.ktor.server.netty)
implementation(libs.ktor.server.webSockets)
implementation(libs.ktor.serialization.json)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import io.ktor.serialization.kotlinx.json.json
import io.ktor.server.application.Application
import io.ktor.server.application.install
import io.ktor.server.plugins.autohead.AutoHeadResponse
import io.ktor.server.plugins.callloging.CallLogging
import io.ktor.server.plugins.contentnegotiation.ContentNegotiation
import io.ktor.server.routing.routing
import io.ktor.server.websocket.WebSockets
Expand Down Expand Up @@ -37,6 +38,7 @@ class RerouteServer(

contentConverter = KotlinxWebsocketSerializationConverter(Json)
}
install(CallLogging)

routing {
dataRoute.route()
Expand Down

0 comments on commit 0cc0ae3

Please sign in to comment.