zio-logging
zio-logging copied to clipboard
Custom Logger not adding annotations
I'm following this doc for creating a custom logger. However, I noticed that custom log annotations are not present in the "annotations" field: the map is always empty. When creating a console or file logger (built-in), the custom annotations is present as expected. https://zio.dev/guides/tutorials/create-custom-logger-for-a-zio-application/#creating-a-custom-logger
zio.Runtime.removeDefaultLoggers >>> (SLF4J.slf4j ++ zio.Runtime.addLogger(SnsLogger.LOGGER))
...
val LOGGER: ZLogger[String, Unit] =
new ZLogger[String, Unit] {
override def apply(
trace: Trace,
fiberId: FiberId,
logLevel: LogLevel,
message: () => String,
cause: Cause[Any],
context: FiberRefs,
spans: List[LogSpan],
annotations: Map[String, String] // always empty
): Unit = {
...
}
hi @fernanluyano, are you able to create small reproducer? Thanks