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

Configure Plug-in Start Levels to enable slf4j-2 logging #43

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

HannesWell
Copy link
Contributor

@HannesWell HannesWell commented Aug 20, 2023

Fixes #27

For all products this means that the implementation of the OSGi Service Loader Mediator Specification supplied by Eclipse-Platform, namly the 'org.apache.aries.spifly.dynamic.bundle' bundle has to be auto-started at level two, like it is already done for the Eclipse SDK managed by Eclipse-Platform.

All products that contain the slf4j.simple logging back-end, need to auto-start slf4j.simple as well.
Additionally a VM-property is set to turn slf4j.simple off by default. A user can then configure it as desired by modifying/setting the corresponding system-properties in the eclipse.ini, as defined in the SimpleLogger doc:
https://www.slf4j.org/api/org/slf4j/simple/SimpleLogger.html

If a product uses the o.e.m2e.logback feature, and therefore logback as logging back-end, nothing needs to be done. The m2e.logback feature already performs all necessary configuration upon its installation.

For the products that don't include m2e.logback this is the same change like it was done with the following two changes

At the moment I just opened this as a draft since the following changes are still pending and need to be contributed to SimRel in order to make the logging fully functional:

Theoretically we could already merge this even before the mentioned issues are resolved respectively before the solution is contributed to SimRel, but we could only verify if it really works afterwards.

@jonahgraham
Copy link
Contributor

At the moment I just opened this as a draft [...]

OK - lets revisit it on Thursday and I can merge before doing M3 EPP build.

For all products this means that the implementation of the OSGi Service
Loader Mediator Specification supplied by Eclipse-Platform, namly the
'org.apache.aries.spifly.dynamic.bundle' bundle has to be auto-started
at level two, like it is already done for the Eclipse SDK managed by
Eclipse-Platform.

All products that contain the slf4j.simple logging back-end, need to
auto-start slf4j.simple as well.
Additionally a VM-property is set to turn slf4j.simple off by default.
A user can then configure it as desired by modifying/setting the
corresponding system-properties in the eclipse.ini, as defined in the
SimpleLogger doc:
https://www.slf4j.org/api/org/slf4j/simple/SimpleLogger.html

If a product uses the o.e.m2e.logback feature, and therefore logback as
logging back-end, nothing needs to be done. The m2e.logback
feature already performs all necessary configuration upon its
installation.

Fixes eclipse-packaging#27
@HannesWell HannesWell marked this pull request as ready for review August 22, 2023 21:24
@HannesWell
Copy link
Contributor Author

At the moment I just opened this as a draft [...]

OK - lets revisit it on Thursday and I can merge before doing M3 EPP build.

The fixed WebTools version was contributed to SimRel as well as the M2E M3 snapshot that contains the m2e.logback feature which contains p2-advices to configure logback automatically.
The only missing thing is the fix in eclipse-rap/org.eclipse.rap.tools#49, but they are already aware of the issue and are working on resolving it.
So I think we are on a good path and this is IMHO ready to review.

@HannesWell
Copy link
Contributor Author

@jonahgraham everything should be ready now. The RAP devs thankfully submitted the fix and contributed it to SimRel just in time.

@jonahgraham
Copy link
Contributor

Thanks Hannes. I'll aim to include this change in M3 tomorrow.

@jonahgraham
Copy link
Contributor

I have run into a couple of problems with getting this integrated.

  1. The changes to php, committers and scout don't build with errors about finding slf4j simple:
Installation failed.
Cannot complete the install because one or more required items could not be found.
        Software being installed: Eclipse IDE for PHP Developers 4.29.0.20230822-2123 (epp.package.php 4.29.0.20230822-2123)
        Missing requirement: toolinggtk.linux.x86_64slf4j.simple 4.29.0.20230822-2123 requires 'osgi.bundle; slf4j.simple 0.0.0' but it could not be found
        Cannot satisfy dependency:
                From: Eclipse IDE for PHP Developers 4.29.0.20230822-2123 (epp.package.php 4.29.0.20230822-2123)
                To: org.eclipse.equinox.p2.iu; toolingepp.package.php.configuration [4.29.0.20230822-2123,4.29.0.20230822-2123]
        Cannot satisfy dependency:
                From: toolingepp.package.php.configuration 4.29.0.20230822-2123
                To: org.eclipse.equinox.p2.iu; toolinggtk.linux.x86_64slf4j.simple [4.29.0.20230822-2123,4.29.0.20230822-2123]
[ERROR] [ba1064db-2778-423d-9437-67172bbb4665][extension>org.eclipse.tycho:tycho-maven-plugin:3.0.5] Cannot complete the install because one or more required items could not be found.
  1. If I start with (e.g.) the CPP package and then install the logback feature org.eclipse.m2e.logback.feature.feature.group) using install new software, then I get unusual messages in the output as both the logback and slf4j simple set to start level 2.
Aug. 24, 2023 1:49:19 P.M. org.apache.aries.spifly.BaseActivator log
INFO: Registered provider org.slf4j.simple.SimpleServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle slf4j.simple
Aug. 24, 2023 1:49:19 P.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. 24, 2023 1:49:19 P.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
SLF4J: Class path contains multiple SLF4J providers.
SLF4J: Found provider [org.slf4j.simple.SimpleServiceProvider@6b21e173]
SLF4J: Found provider [ch.qos.logback.classic.spi.LogbackServiceProvider@541c3759]
SLF4J: See https://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual provider is of type [org.slf4j.simple.SimpleServiceProvider@6b21e173]

I am working on solutions to the above now and I mostly understand what is going on. My vacation has left little time to resolve this before M3 which I really need to have kicked off in the next couple of hours to make the publishing deadline of 10am tomorrow.

@jonahgraham jonahgraham merged commit c76afaf into eclipse-packaging:master Aug 24, 2023
@jonahgraham
Copy link
Contributor

I have merged this change + disabling slf4j.simple on php, committers and scout so I can build M3. If I can resolve it fully soon I will cancel and restart the build. Otherwise we'll fix those products for RC1.

@HannesWell HannesWell deleted the logging branch August 24, 2023 18:40
@HannesWell
Copy link
Contributor Author

Thanks Jonah.

Sorry I don't have time to help today and probably only little time at the weekend, but I'll also try to look into this and help where it is needed.

If I start with (e.g.) the CPP package and then install the logback feature org.eclipse.m2e.logback.feature.feature.group) using install new software, then I get unusual messages in the output as both the logback and slf4j simple set to start level 2.

This is indeed a fundamental problem I encountered as well just recently. I havn't found a good solution yet.
The only approaches I see are either to uninstall slf4j.simple in this case or at least disable its activation.
This could be done in the m2e.logback's pf.inf file.

@jonahgraham
Copy link
Contributor

The changes to php, committers and scout don't build with errors about finding slf4j simple:

Please see #47 for a possible fix for these.

If I start with (e.g.) the CPP package and then install the logback feature org.eclipse.m2e.logback.feature.feature.group) using install new software, then I get unusual messages in the output as both the logback and slf4j simple set to start level 2.

This is indeed a fundamental problem I encountered as well just recently. I havn't found a good solution yet. The only approaches I see are either to uninstall slf4j.simple in this case or at least disable its activation. This could be done in the m2e.logback's pf.inf file.

On further reflection I am unconcerned about this part of the change for now.

@HannesWell
Copy link
Contributor Author

On further reflection I am unconcerned about this part of the change for now.

Yes, it isn't very bad, I meant it is quite low level.

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
2 participants