zio-logging icon indicating copy to clipboard operation
zio-logging copied to clipboard

Log filtering improvements

Open justcoon opened this issue 1 year ago • 0 comments

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 from ZLogger?
  • there is LogFilter.cachedLogLevelAndName (based on LogFiltering.cachedFilterBy taken from zio 1 version), which using TMap, but this then require Unsafe run, also similar implementation of LogFilter.cachedLogLevelAndName which using java.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?

justcoon avatar Sep 15 '22 17:09 justcoon