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

Spans are not propagated to the log4j backend #860

Open
lukasz-golebiewski opened this issue Jun 15, 2024 · 3 comments
Open

Spans are not propagated to the log4j backend #860

lukasz-golebiewski opened this issue Jun 15, 2024 · 3 comments

Comments

@lukasz-golebiewski
Copy link

A reproducer is available here: https://github.com/lukasz-golebiewski/zio-logging-example

@lukasz-golebiewski
Copy link
Author

Looks like the solution was to concat LogFormat.spans with the default SLF4J log format.

SLF4J.slf4j(LogFormat.spans + SLF4J.logFormatDefault)

Is there a reason why spans are not being logged in the default format?

@justcoon
Copy link
Contributor

Hi @lukasz-golebiewski
I think reason for that is that LogFormat of core zio loggers
https://github.com/zio/zio-logging/blob/master/core/shared/src/main/scala/zio/logging/LogFormat.scala#L917-L922
also do not contains spans, so they were not added also to slf4j default format

@lukasz-golebiewski
Copy link
Author

This is interesting, because an app extending ZIOAppDefault without overridden bootstrap, so using the default zio logger, does log spans out of the box

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