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

slf4j 2.0.3 + Lombok: logging class always resolved to org.slf4j.spi.DefaultLoggingEventBuilder #291

Closed
q3769 opened this issue Oct 3, 2022 · 3 comments
Assignees
Labels
Milestone

Comments

@q3769
Copy link
Contributor

q3769 commented Oct 3, 2022

Describe the bug
It should have been resolved to the class issuing the logs, not the SPI class of the Slf4j.

To Reproduce
Steps to reproduce the behavior:

  1. In Maven pom.xml
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.3</version>
        </dependency>
        <dependency>
            <groupId>org.tinylog</groupId>
            <artifactId>slf4j-tinylog</artifactId>
            <version>2.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.tinylog</groupId>
            <artifactId>tinylog-impl</artifactId>
            <version>2.5.0</version>
        </dependency>
  1. Use Lombok @slf4j in logging class, not manual import of tinylog Logger.
  2. Log code sample
log.atInfo()
                .log("[{}] tasks were run by [{}] threads, with thread pool size [{}]",
                        TASK_COUNT,
                        actualThreadCount,
                        threadPoolSize);

Environment
tinylog version: 2.5.0
Java version: 17 (with release target 8)

@q3769 q3769 added the bug label Oct 3, 2022
@pmwmedia
Copy link
Member

pmwmedia commented Oct 3, 2022

@q3769 What is the output in the log file?

@q3769
Copy link
Contributor Author

q3769 commented Oct 3, 2022

It looks like this when I do "mvn clean install":

2022-10-03 15:11:38 [main] org.slf4j.spi.DefaultLoggingEventBuilder.logViaPublicSLF4JLoggerAPI()
INFO: [100] tasks were run by [100] threads, with thread pool size [1000]

@pmwmedia pmwmedia added this to the 2.6 milestone Oct 3, 2022
@pmwmedia pmwmedia self-assigned this Oct 3, 2022
@github-actions
Copy link

This closed issue has been locked automatically. However, please feel free to file a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants