diff --git a/modules/app/src/main/scala/http.middleware.scala b/modules/app/src/main/scala/http.middleware.scala index 498aeb3..585477a 100644 --- a/modules/app/src/main/scala/http.middleware.scala +++ b/modules/app/src/main/scala/http.middleware.scala @@ -14,7 +14,7 @@ def MkMiddleware(config: HttpServerConfig)(using LoggerFactory[IO]): Middleware def verboseLogger = RequestLogger.httpRoutes[IO](true, true).andThen(ResponseLogger.httpRoutes[IO, Request[IO]](true, true)) - val logger = + def logger = if config.apiLogger then verboseLogger else ApiErrorLogger.instance(using LoggerFactory[IO].getLogger) diff --git a/modules/app/src/main/scala/service.health.scala b/modules/app/src/main/scala/service.health.scala index 2956456..1ad76ab 100644 --- a/modules/app/src/main/scala/service.health.scala +++ b/modules/app/src/main/scala/service.health.scala @@ -8,14 +8,14 @@ import org.typelevel.log4cats.{ Logger, LoggerFactory } class HealthServiceImpl(esClient: ESClient[IO])(using LoggerFactory[IO]) extends HealthService[IO]: - given logger: Logger[IO] = LoggerFactory[IO].getLogger + given Logger[IO] = LoggerFactory[IO].getLogger override def healthCheck(): IO[HealthCheckOutput] = esClient.status .flatMap(transform) .map(HealthCheckOutput(_)) .handleErrorWith: e => - logger.error(e)("Error in health check") *> + Logger[IO].error(e)("Error in health check") *> IO.raiseError(InternalServerError(s"Internal server error $e")) private def transform(status: String): IO[ElasticStatus] = diff --git a/modules/app/src/main/scala/service.search.scala b/modules/app/src/main/scala/service.search.scala index a066637..d209c09 100644 --- a/modules/app/src/main/scala/service.search.scala +++ b/modules/app/src/main/scala/service.search.scala @@ -22,7 +22,7 @@ class SearchServiceImpl(esClient: ESClient[IO], metric: Histogram[IO, Double])(u import SearchServiceImpl.{ *, given } - given logger: Logger[IO] = LoggerFactory[IO].getLogger + private val logger: Logger[IO] = LoggerFactory[IO].getLogger private val baseAttributes = Attributes(Attribute("http.request.method", "POST")) private val countMetric = diff --git a/smithy-build.json b/smithy-build.json index fae79ba..0a2ce9f 100644 --- a/smithy-build.json +++ b/smithy-build.json @@ -2,7 +2,7 @@ "version": "1.0", "maven": { "dependencies": [ - "com.disneystreaming.smithy4s:smithy4s-protocol:0.18.15", + "com.disneystreaming.smithy4s:smithy4s-protocol:0.18.27", "com.disneystreaming.alloy:alloy-core:0.3.4" ], "repositories": [] @@ -10,6 +10,6 @@ "imports": [ "./src", "modules/smithy/src/main/smithy", - "modules/smithy/target/scala-3.5.0/src_managed/main/smithy" + "modules/smithy/target/scala-3.5.2/src_managed/main/smithy" ] } \ No newline at end of file