Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Logger not adding annotations #827

Open
fernanluyano opened this issue Mar 18, 2024 · 1 comment
Open

Custom Logger not adding annotations #827

fernanluyano opened this issue Mar 18, 2024 · 1 comment

Comments

@fernanluyano
Copy link

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 = {
...
}
@justcoon
Copy link
Contributor

hi @fernanluyano,
are you able to create small reproducer? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants