log4cats icon indicating copy to clipboard operation
log4cats copied to clipboard

FiberLocal / IOLocal logger wrapper

Open kubukoz opened this issue 3 years ago • 2 comments

hopefully self-explanatory: it would be great to have a wrapper for loggers that would allow one to pass structured logging context in a more implicit fashion.

This would probably involve creating a root logging context (the default value of the IOLocal), then using that in a wrapped logger so it passes the context to the underlying logger (e.g. slf4j).

kubukoz avatar Jun 30 '21 16:06 kubukoz

Would something like this be helpful? https://github.com/typelevel/log4cats/pull/676

wunderk1nd-e avatar Aug 17 '22 12:08 wunderk1nd-e

Yes, that's pretty much what I was looking for :)

Maybe some utility that would create the IOLocal for you would also be nice.

kubukoz avatar Aug 17 '22 14:08 kubukoz