gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] 01/04: install requests logger


From: gnunet
Subject: [libeufin] 01/04: install requests logger
Date: Wed, 22 Jan 2020 22:09:22 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository libeufin.

commit 674ff93b905972625d42b393b425427a31a51695
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Jan 22 20:37:04 2020 +0100

    install requests logger
---
 nexus/src/main/kotlin/Main.kt | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/nexus/src/main/kotlin/Main.kt b/nexus/src/main/kotlin/Main.kt
index 5c410bf..d6911f5 100644
--- a/nexus/src/main/kotlin/Main.kt
+++ b/nexus/src/main/kotlin/Main.kt
@@ -25,6 +25,7 @@ import io.ktor.application.ApplicationCallPipeline
 import io.ktor.application.call
 import io.ktor.application.install
 import io.ktor.client.*
+import io.ktor.features.CallLogging
 import io.ktor.features.ContentNegotiation
 import io.ktor.features.StatusPages
 import io.ktor.gson.gson
@@ -41,6 +42,7 @@ import org.jetbrains.exposed.sql.transactions.transaction
 import org.joda.time.DateTime
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
+import org.slf4j.event.Level
 import tech.libeufin.util.ebics_h004.*
 import tech.libeufin.util.*
 import java.text.DateFormat
@@ -99,6 +101,12 @@ fun main() {
 
     val server = embeddedServer(Netty, port = 5001) {
 
+        install(CallLogging) {
+            this.level = Level.DEBUG
+            this.logger = LOGGER
+
+        }
+
         install(ContentNegotiation) {
 
             moshi {
@@ -194,8 +202,6 @@ fun main() {
                 val endDate = DateTime.parse(body.end)
                 // will throw DateTimeParseException if strings are malformed.
 
-
-
                 val subscriberData = transaction {
                     containerInit(EbicsSubscriberEntity.findById(id) ?: throw 
SubscriberNotFoundError(HttpStatusCode.NotFound))
                 }
@@ -212,6 +218,12 @@ fun main() {
                     ),
                     subscriberData.customerAuthPriv
                 )
+
+                call.respondText(
+                    "Nothing crashed!",
+                    ContentType.Text.Plain,
+                    HttpStatusCode.OK)
+                return@post
             }
 
             get("/ebics/subscribers/{id}/sendHtd") {

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]