zio-logging
zio-logging copied to clipboard
Log filtering improvements
Fixes: #509
current version of ZLogger (zio 2.0.2) and also other loggers implementations, in general, they are supporting just log filtering by LogLevel (Zlogger.filterLogLevel)
log backends implementations like logback, log4j also supporting "filtering" by package/Logger name (in configuration)
we should have support for something like that also in ZLogger
,
LogFiltering support based on implementation from zio-logging zio 1 version - LogFiltering (thanks to @vigoo)
open problems and questions:
- implementation of filter have
LogLevel
,Trace
,FiberRefs
and annotations, should we add another attributes fromZLogger
? - there is
LogFilter.cachedLogLevelAndName
(based onLogFiltering.cachedFilterBy
taken from zio 1 version), which usingTMap
, but this then requireUnsafe
run, also similar implementation ofLogFilter.cachedLogLevelAndName
which usingjava.util.concurrent.ConcurrentHashMap
was added, second one have better performance based on benchmarks, which of this 2 implementations we should have? - now in zio.logging.package, we have a lot of specific functions for logging layers, i think we should find way, how to do it more customisable and composable (have option to customise
ZLogger
, logger output and then create layer from that) - should we add some of this features directly into zio-core?