From ec62e01c3a17f09abf9952af7a34accd7be89865 Mon Sep 17 00:00:00 2001 From: Juan Javier Date: Tue, 11 Aug 2020 10:15:55 +0200 Subject: [PATCH] Call requestHandled method once the request have been completed in play server --- .../main/scala/sttp/tapir/server/play/TapirPlayServer.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/play-server/src/main/scala/sttp/tapir/server/play/TapirPlayServer.scala b/server/play-server/src/main/scala/sttp/tapir/server/play/TapirPlayServer.scala index 11c9cbf4eb..7ff0b56cad 100644 --- a/server/play-server/src/main/scala/sttp/tapir/server/play/TapirPlayServer.scala +++ b/server/play-server/src/main/scala/sttp/tapir/server/play/TapirPlayServer.scala @@ -41,8 +41,10 @@ trait TapirPlayServer { val i = value.asInstanceOf[I] e.logic(new FutureMonadError())(i) .map { - case Right(result) => OutputToPlayResponse(ServerDefaults.StatusCodes.success, e.output, result) - case Left(err) => OutputToPlayResponse(ServerDefaults.StatusCodes.error, e.errorOutput, err) + case Right(result) => serverOptions.logRequestHandling.requestHandled(e.endpoint, ServerDefaults.StatusCodes.success.code) + OutputToPlayResponse(ServerDefaults.StatusCodes.success, e.output, result) + case Left(err) => serverOptions.logRequestHandling.requestHandled(e.endpoint, ServerDefaults.StatusCodes.error.code) + OutputToPlayResponse(ServerDefaults.StatusCodes.error, e.errorOutput, err) } } def handleDecodeFailure(