commit 0583cf84bed2a4c2f788ded5bdff15495305c7fe
parent 86444ff8fa85285a0e1f2ba6bbc72cd8c8899c94
Author: MS <ms@taler.net>
Date: Fri, 18 Nov 2022 06:51:43 +0100
reduce logging
Diffstat:
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -476,9 +476,7 @@ val sandboxApp: Application.() -> Unit = {
this.level = Level.DEBUG
this.logger = tech.libeufin.sandbox.logger
this.format { call ->
- val t = Thread.currentThread()
- "${call.response.status()}, ${call.request.httpMethod.value} ${call.request.path()}" +
- " - thread (id/name/group): ${t.id}/${t.name}/${t.threadGroup.name}"
+ "${call.response.status()}, ${call.request.httpMethod.value} ${call.request.path()}"
}
}
install(CORS) {
@@ -507,7 +505,7 @@ val sandboxApp: Application.() -> Unit = {
}
install(StatusPages) {
exception<ArithmeticException> { cause ->
- logger.error("Exception while handling '${call.request.uri}'", cause)
+ logger.error("Exception while handling '${call.request.uri}', ${cause.message}")
call.respondText(
"Invalid arithmetic attempted.",
ContentType.Text.Plain,
@@ -529,7 +527,7 @@ val sandboxApp: Application.() -> Unit = {
)
}
exception<UtilError> { cause ->
- logger.error("Exception while handling '${call.request.uri}'", cause)
+ logger.error("Exception while handling '${call.request.uri}', ${cause.reason}")
call.respond(
cause.statusCode,
SandboxErrorJson(
@@ -545,7 +543,7 @@ val sandboxApp: Application.() -> Unit = {
respondEbicsTransfer(call, e.errorText, e.errorCode)
}
exception<Throwable> { cause ->
- logger.error("Exception while handling '${call.request.uri}'", cause)
+ logger.error("Exception while handling '${call.request.uri}'", cause.message)
call.respondText(
"Internal server error.",
ContentType.Text.Plain,
diff --git a/util/src/main/kotlin/HTTP.kt b/util/src/main/kotlin/HTTP.kt
@@ -19,7 +19,9 @@ fun unauthorized(msg: String): UtilError {
fun notFound(msg: String): UtilError {
return UtilError(
- HttpStatusCode.NotFound, msg, LibeufinErrorCode.LIBEUFIN_EC_NONE
+ HttpStatusCode.NotFound,
+ msg,
+ LibeufinErrorCode.LIBEUFIN_EC_NONE
)
}