From 59b8fedc7360e399ab5b092c3cae136084be9266 Mon Sep 17 00:00:00 2001 From: Slash Nephy Date: Wed, 22 Aug 2018 01:43:28 +0900 Subject: [PATCH] Install CallLogging --- src/main/kotlin/jp/nephy/tweetstorm/App.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/jp/nephy/tweetstorm/App.kt b/src/main/kotlin/jp/nephy/tweetstorm/App.kt index 84d8382..6355914 100644 --- a/src/main/kotlin/jp/nephy/tweetstorm/App.kt +++ b/src/main/kotlin/jp/nephy/tweetstorm/App.kt @@ -3,6 +3,7 @@ package jp.nephy.tweetstorm import io.ktor.application.Application import io.ktor.application.call import io.ktor.application.install +import io.ktor.features.CallLogging import io.ktor.features.XForwardedHeadersSupport import io.ktor.features.origin import io.ktor.http.ContentType @@ -18,6 +19,7 @@ import io.ktor.util.toMap import jp.nephy.tweetstorm.session.AuthenticatedStream import jp.nephy.tweetstorm.session.SampleStream import mu.KotlinLogging +import org.slf4j.event.Level import java.util.logging.LogManager val logger = KotlinLogging.logger("Tweetstorm") @@ -25,6 +27,10 @@ val config = Config.load() val fetcher = Fetcher() fun Application.module() { + install(CallLogging) { + level = Level.INFO + } + install(XForwardedHeadersSupport) install(Routing) { @@ -51,7 +57,6 @@ fun Application.module() { fun main(args: Array) { LogManager.getLogManager().reset() - val config = Config.load() embeddedServer(Netty, host = config.host, port = config.port, configure = { responseWriteTimeoutSeconds = 60