Skip to content

Commit

Permalink
zio2.0.15 with logback.xml ( no logback-test)
Browse files Browse the repository at this point in the history
  • Loading branch information
ostrygun committed Jun 20, 2023
1 parent 851e743 commit dbcffd6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ThisBuild / scalaVersion := "3.2.1"
ThisBuild / version := "2.0.0"
ThisBuild / scalaVersion := "3.3.0"
ThisBuild / version := "2.0.1"
ThisBuild / organization := "io.github.ollls"
ThisBuild / organizationName := "ollls"
ThisBuild / versionScheme := Some("strict")
Expand Down Expand Up @@ -48,10 +48,10 @@ lazy val root = (project in file("."))
name := "zio-tls-http",
maxErrors := 3,
retrieveManaged := true,
libraryDependencies += "dev.zio" %% "zio" % "2.0.8" % "provided",
libraryDependencies += "dev.zio" %% "zio-test" % "2.0.8",
libraryDependencies += "dev.zio" %% "zio-json" % "0.4.2",
libraryDependencies += "dev.zio" %% "zio-logging-slf4j" % "2.1.5",
libraryDependencies += "dev.zio" %% "zio" % "2.0.15",
libraryDependencies += "dev.zio" %% "zio-test" % "2.0.15",
libraryDependencies += "dev.zio" %% "zio-json" % "0.5.0",
libraryDependencies += "dev.zio" %% "zio-logging-slf4j" % "2.1.13",
libraryDependencies += "org.slf4j" % "slf4j-api" % "2.0.4",
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.3.5"
)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/main/scala/server/FileUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ object FileUtils {
//https://zio.dev/zio-logging/slf4j
//access
//_ <- Logs.log_access(req, StatusCode.OK, body.size)
_ <- ZIO.logInfo( req.method.toString + " " + req.uri.toString() + " " + StatusCode.OK.value + " " + body.size ) @@ SLF4J.loggerName( "access")
_ <- ZIO.logInfo( req.method.toString + " " + req.uri.toString() + " " + StatusCode.OK.value + " " + body.size ) @@ zio.logging.loggerName("access")
s <-
if (file_name.toString.endsWith(".jpg")) {
ZIO.attempt(headerStream("image/jpeg", file_path.toString) ++ fstream)
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/server/HttpRouter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ class HttpRouter[Env](val appRoutes: List[HttpRoutes[Env]]) {

if (resp.isChunked) {
ZIO.logDebug(req.method.toString + " " + req.uri.toString() + " " + status.value + " chunked") *>
ZIO.logInfo(req.method.toString + " " + req.uri.toString() + " " + status.value + " chunked") @@ SLF4J.loggerName("access") *>
ZIO.logInfo(req.method.toString + " " + req.uri.toString() + " " + status.value + " chunked") @@ zio.logging.loggerName("access") *>
ResponseWriters.writeFullResponseFromStream(ch, resp).refineToOrDie[Exception].map(_ => 0)
} else
(for {
Expand All @@ -397,7 +397,7 @@ class HttpRouter[Env](val appRoutes: List[HttpRoutes[Env]]) {
case _ => ResponseWriters.writeNoBodyResponse(ch, status, new String(body.toArray), true)
}
_ <- ZIO.logDebug(req.method.toString + " " + req.uri.toString() + " " + status.value + " " + body.size)
_ <- ZIO.logInfo(req.method.toString + " " + req.uri.toString() + " " + status.value + " " + body.size) @@ SLF4J.loggerName("access")
_ <- ZIO.logInfo(req.method.toString + " " + req.uri.toString() + " " + status.value + " " + body.size) @@ zio.logging.loggerName("access")

} yield (0)).refineToOrDie[Exception]

Expand Down

0 comments on commit dbcffd6

Please sign in to comment.