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

Always include slf4j.simple or m2e.logback in each package #48

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

jonahgraham
Copy link
Contributor

Fixes #27 specifically a follow up for #47:
#47 (comment)

@jonahgraham
Copy link
Contributor Author

@HannesWell if you have a chance to review to see if this meets your expectation that would be great.

PS I added github actions in #49 so each package is now built on PRs:

image

@jonahgraham jonahgraham merged commit c878f05 into eclipse-packaging:master Aug 25, 2023
11 checks passed
@jonahgraham jonahgraham deleted the slf4j branch August 25, 2023 18:30
@HannesWell
Copy link
Contributor

@HannesWell if you have a chance to review to see if this meets your expectation that would be great.

This looks perfectly fine. 👍🏽

PS I added github actions in #49 so each package is now built on PRs:

That's very helpful.

@merks
Copy link
Contributor

merks commented Aug 26, 2023

FYI, I tested generating the product catalogs against staging repositories:

Nothing was changed in the generator. Then I created a committers installation with the installer and I see this in the bundles.info:

slf4j.simple,2.0.7,file:/D:/Users/test26/.p2/pool/plugins/slf4j.simple_2.0.7.jar,2,true

No errors are logged on startup.

So it looks good.

I also tried the Java package. There slf4j.simple is not present but it has this instead:

ch.qos.logback.classic,1.4.11,file:/D:/Users/test26/.p2/pool/plugins/ch.qos.logback.classic_1.4.11.jar,2,true

It has this in the log:

image

So I guess that's okay too.

@jonahgraham
Copy link
Contributor Author

Thank you for testing that @merks.

It is expected that java, dsl, jee, rcp packages has logback instead of slf4j:

$ git grep -B1 org.eclipse.m2e.logback.feature **/epp.product
packages/org.eclipse.epp.package.dsl.product/epp.product-      <!-- either m2e.logback or slf4j.simple should be provided in each package -->
packages/org.eclipse.epp.package.dsl.product/epp.product:      <feature id="org.eclipse.m2e.logback.feature" installMode="root"/>
--
packages/org.eclipse.epp.package.java.product/epp.product-      <!-- either m2e.logback or slf4j.simple should be provided in each package -->
packages/org.eclipse.epp.package.java.product/epp.product:      <feature id="org.eclipse.m2e.logback.feature" installMode="root"/>
--
packages/org.eclipse.epp.package.jee.product/epp.product-      <!-- either m2e.logback or slf4j.simple should be provided in each package -->
packages/org.eclipse.epp.package.jee.product/epp.product:      <feature id="org.eclipse.m2e.logback.feature" installMode="root"/>
--
packages/org.eclipse.epp.package.rcp.product/epp.product-      <!-- either m2e.logback or slf4j.simple should be provided in each package -->
packages/org.eclipse.epp.package.rcp.product/epp.product:      <feature id="org.eclipse.m2e.logback.feature" installMode="root"/>

In addition, if you run eclipsec.exe (or in a terminal on non-Windows) you should see with logback:

Aug. 26, 2023 9:40:59 A.M. org.apache.aries.spifly.BaseActivator log
INFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic
Aug. 26, 2023 9:40:59 A.M. org.apache.aries.spifly.BaseActivator log
INFO: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic

and with slf4j:

Aug. 26, 2023 9:41:44 A.M. org.apache.aries.spifly.BaseActivator log
INFO: Registered provider org.slf4j.simple.SimpleServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle slf4j.simple

Which replaces the long standing message:

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.

@merks
Copy link
Contributor

merks commented Aug 26, 2023

Very good. That's what I see with the installer-created installations based on staging:

$committers-latest-staging/eclipse/eclipsec.exe
Aug. 26, 2023 3:46:15 PM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider org.slf4j.simple.SimpleServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle slf4j.simple

$java-latest-staging/eclipse/eclipsec.exe
Aug. 26, 2023 3:44:43 PM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic
Aug. 26, 2023 3:44:44 PM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic

@HannesWell
Copy link
Contributor

That's really great. 🎉 Thank you both for testing.

In addition, if you run eclipsec.exe (or in a terminal on non-Windows) you should see with logback:

Aug. 26, 2023 9:40:59 A.M. org.apache.aries.spifly.BaseActivator log
INFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic

Btw. the ServletContainer is only necessary because Apache Aries cannot handle the edgy metadata of logback. I already provided a patch a while ago, but unfortunately nobody of the Aries maintainers even answered :/

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.

Update EPP for SLF4J v2 changes coming from platform
3 participants