blaze
blaze copied to clipboard
`BlazeServerBuilder` doesn't respect metered logger
Currently, BlazeServerBuilder
has line statically defined logger
(https://github.com/http4s/http4s/blob/2dba53fd4bcd8711f7db093e445ed5854f319afa/blaze-server/src/main/scala/org/http4s/server/blaze/BlazeServerBuilder.scala#L97). It limits our ability to us metered logger.
Would it make sense to provide extra def withLogger(logger: Logger[F])
function would allow us to provide metered logger?
https://gitter.im/http4s/http4s?at=5ced612b6366992a9438c309
I think that might also be achievable by an appender, but I'm not opposed to a configurable logger if that's deemed a better way.
"By an appender" - how? I am not sure, that I follow your idea
Maybe a Filter
is a better choice than an appender. A Filter
would let you count events and respond accordingly. Is that your use case?
I believe something along the lines of whats capable with epimetheus-log4cats perhaps.
we use epimetheus-log4cats
and we added metrics like:
logger <- LogModifier.selfAwareStructured(registry, Slf4jLogger.getLogger[IO])
but I noticed, that logs from server are not accounted for :)
The logger in Blaze is log4s, so I'm not sure what the log4cats solution achieves. I guess we can still add this, but I'm still not understanding what can't be accomplished through logback facilities.