Skip to content

update to slf4j 2 #3834

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yannicklamprecht
Copy link

No description provided.

@md-5
Copy link
Member

md-5 commented May 25, 2025

Can you please explain a bit more.

Is this a breaking change?

What was the historical reason we have slf4j again? It was for the maven resolver wasn't it? Doesn't that still use/depends on slf4j 1?

@yannicklamprecht
Copy link
Author

yannicklamprecht commented May 25, 2025

The historic reason we have slf4j was the following: #3084
tldr; plugins using slf4j had issues successfully logging in bungee using the facade.

The slf4j 2 logging facade provides additional useful apis like the fluent way of logging. slf4j as a facade itself doesn't have a breaking change. The breaking change probably is how the factories and especially the bridges to the logger will be registered. In 1.x it was done using the logger factory binder interface, in 2.x it's via the Java service definition.

As comparision to explain the absence of the old classes in the pull request.

slf4j 1.7: https://github.com/qos-ch/slf4j/tree/1.7-maintenance/slf4j-jdk14/src/main/java/org/slf4j/impl
slf4j 2.x: https://github.com/qos-ch/slf4j/tree/2.0/slf4j-jdk14/src/main/java/org/slf4j/jul

@md-5
Copy link
Member

md-5 commented May 25, 2025

tldr; plugins using slf4j had issues successfully logging in bungee using the facade.

I think this came about at least partially because the maven-resolver API brought in the slf4j API

@md-5
Copy link
Member

md-5 commented May 25, 2025

Also have you tested this with a slf4j using plugin?

@yannicklamprecht
Copy link
Author

Also have you tested this with a slf4j using plugin?

Yes, did a test using a plugin that utilizes slf4j 2 and a test with the same plugin using slf4j 1.7. Both work like expected.

@yannicklamprecht
Copy link
Author

tldr; plugins using slf4j had issues successfully logging in bungee using the facade.

I think this came about at least partially because the maven-resolver API brought in the slf4j API

Ah okay. So your desire is to remove slf4j fully? That would be a breaking changes as plugins depend on slf4j being present.
In comparison slf4j 1.7 was last updated 3 years ago vs. slf4j 2.x 3 months.

The whole slf4j update to 2.x will also help simplifying support for cross platform plugins which have bungee and spigot support in one jar, as spigot is using slf4j 2.x. Currently plugins supporting both platforms need to depend on slf4j 1.7 because otherwise they need to shade slf4j 2.x in their plugins.

@md-5
Copy link
Member

md-5 commented May 25, 2025

Wasn't aware spigot was using 2.x, that probably simplifies things

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.

2 participants