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

feat: use SLF4J for logging #1680

Merged
merged 1 commit into from
Nov 13, 2023
Merged

feat: use SLF4J for logging #1680

merged 1 commit into from
Nov 13, 2023

Conversation

ttosta-google
Copy link
Collaborator

Fixes #1594

@ttosta-google ttosta-google requested a review from a team as a code owner November 9, 2023 20:12
Copy link
Member

@enocom enocom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a "feature"?

@ttosta-google ttosta-google changed the title chore: use SLF4J for logging feat: use SLF4J for logging Nov 9, 2023
core/pom.xml Outdated
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a test only dependency?

It looks like this is meant for deployment time configuration otherwise: https://www.slf4j.org/manual.html#swapping.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the scope to runtime. I think we should have logs to debug issues outside of the test scope. Please let me know what you think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I've got this wrong, but I'd expect we code to the slf4j-api and then allow applications to supply the "provider". Since we do want logs in test, we should make sure we have a provider in a test scope. Otherwise, we don't want to impose an implementation on our customers.

See https://www.slf4j.org/manual.html#libraries for details.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we remove slf4j-jdk14 dependency, and then add a <scope>test</scope> dependency for logback-classic-1.4.6.jar. I prefer Logback to Java 1.4 logging because I find it is much easier to configure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a <scope>test</scope> dependency for logback-classic as suggested.

Note: the last logback-classic version that supports Java 8 is 1.3.11

@ttosta-google ttosta-google force-pushed the gh-1594-use-slf4j branch 4 times, most recently from 959e3a2 to b7909b5 Compare November 11, 2023 04:55
@ttosta-google ttosta-google merged commit b2c86b8 into main Nov 13, 2023
16 checks passed
@ttosta-google ttosta-google deleted the gh-1594-use-slf4j branch November 13, 2023 17:32
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

Successfully merging this pull request may close these issues.

Use slf4j logging
3 participants