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
Update EPP for SLF4J v2 changes coming from platform #27
Comments
@HannesWell in the N&N entry it says this:
But in the bundles.info the entry in RC1 is:
with the false meaning no autostart which lines up with the product file (sdk, platform). So does Eclipse Platform achieve this a different way? At the moment EPP is not shipping with any of the 2.x versions of SLF4J as AFAICT the 1.x versions are fufulling requirements and since some of the requirements are strictly on 1.x version the 2.x don't get selected at all. (Part of my EPP release process is to track changes in the Eclipse Platform files to make sure I match configuration changes - but I didn't notice any changes in this area) |
that doesn't seem correct to me, not sure when the slf4j stuff are loaded when starting the normal eclipse But we use aries in our product already for years, and we now ship both slf4j (1.7 and 2.0.x) because 1.7 is forced by eclipse and we use already 2.x our self because also the latest log4j has only bindings for the 2.0.x If i download the RC1 of eclipse and i start it with: eclipse.exe -console i don't see the correct stuff because if i do that with our product i right away see: May 31, 2023 5:14:37 PM org.apache.aries.spifly.BaseActivator log those are 2 bridges that are installed 1 is apache commons logging to log4j The "failed" one that you see is the SLF4J 1.7 because there we don't have any bindings.. But eclipse by default i think installs slf4j-nop ? But currently eclipse itself doesn't really use it at all i think |
if i change in the RC1 install this: org.apache.aries.spifly.dynamic.bundle,1.3.6,plugins/org.apache.aries.spifly.dynamic.bundle_1.3.6.jar,4,true and slf4j.api,2.0.7,plugins/slf4j.api_2.0.7.jar,4,true so i just auto start all 3 and then i start with -console: jun. 01, 2023 9:35:14 A.M. org.apache.aries.spifly.BaseActivator log my feeling is that eclipse kind of means that to happen? |
I have to admit that I just forgot that those products are created by Platform directly and have to be updated. I can do that when back from vacation in about 1.5 weeks. In the meantime it is probably not a too big Deal for the SDK product since it is shipped with the no-op Binding by default, so no logging happens anyway. One probably only gets a extra warning that no provider was found. Nevertheless at least for those EPPs that have another Backend included (e.g. logback from m2e), should have it to have a working logging. Regarding the two SLF4J versions in SimRel, I actually started efforts to make slf4j-1 obsolete a while ago, but I don't recall If all changes in other projects are already merged. But I cannot tell it for sure on the Phone. @jcompagner with the upcomming release there should be much less Plugins/Features that require slf4j-1 (I thought none, but as Jonah said it is still there). Maybe you can already remove it from your product respectivly don't get it added. And yes as usual there should be only one provider for slf4j-2. But adding one to a product explicitly should be sufficient to not get the no-op included implicitly. |
FYI, this is what I see in terms of dependencies in SimRel at the moment... These are the things that strictly require the older version: And these are the things that require the thing that requires the older version: So if I read this correctly it's m2e that is is keeping the older version around... |
yes they ship a older logging implementation that is build for slf4j 1.7 1.4.7 is build for 2.x i see. i have a bit of a feeling that eclipse should ship something standard? (maybe that logs to the ,log file of eclipse itself?) |
I don't think I will be able to do anything for the 2023-06 release. I think we are going to have the same default no-op logger that has been the case for quite a while now:
In response to both:
and
I think this should start in Eclipse Platform and then EPP should follow that lead. I have raised eclipse-platform/eclipse.platform.releng.aggregator#1094 |
Thanks Ed. Indeed, the blame is on me 😅 But as Jonah said for the current SimRel we have to live with that situation, but it isn't that bad because consumers can easily overrule the delivered defaults.
Yes that is probably a good Idea. We also had the 'problem' that logback shipped with m2e-logback was understood as generell purpose logging Backend for Eclipse. But it was never meant to be that and ist actually only there to catch Maven logs. |
Just wondering, why is it that if i download the SDK of eclipse (4.28) that aries is included and also the "objectweb.asm" stuff most asm stuff was already in eclipse for years, i think i only needed to include myself the "asm.commons" because that one wasn't shipped The thing is aries does need those, not sure where for (but aries is more a 'weaving' jar right, but we kind of only use it for service loader wiring? i guess it doesn't really need asm for that?) now i am onl that topic, i always wondered why Equinox doesn't have its own simple implementation for this service loader stuff? Why do we need (kind of an obscure. hidden) external jar for this?
that stuff "osgi.service", "osgi.extender" and "osgi.serviceloader" that is specified in the specification of osgi right? so i kind of expect that a osgi implementation as Equinox would already have build in support for that. P.S. if i include now my own slf4j (2.0.x) then with 4.28 1.7 is not there anymore. |
With the changes in Platfrom this change will be made in EPP 2023-09 M3 (#40). Useful xrefs: |
@jonahgraham should I provide a PR for the packages, since the exact configuration depends on what is installed (i.e. slf4j-simple oder logback through m2e.logback)? |
A PR would be most welcome, I will be looking at this Friday (after M3 contribution from platform to SimRel) and next Thursday which is my EPP day. |
Ok, I'll try to provide one at the weekend. But I'll have to do some adjustments in m2e too. |
Thanks Hannes |
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
This is a follow up to #27 to workaround the committers, php and scout products not including slf4j, so therefore not being able to have start levels for them. The org.apache.aries.spifly.dynamic.bundle start level for these bundles is kept to allow installing, for example m2e logback.
The php, committers and scout packages/products are not complete - see a196924 which should be reverted + the necessary fixes to resolve. |
Because the slf4j.simple is not included "naturally" by any of the features already in php, committers or scout, include it explicitly here. Includes revert "Don't add slf4j.simple to products that don't include slf4j already" This reverts commit a196924. Fixes eclipse-packaging#27
Fixes eclipse-packaging#27 specifically a follow up for eclipse-packaging#47: eclipse-packaging#47 (comment)
Fixes eclipse-packaging#27 specifically a follow up for eclipse-packaging#47: eclipse-packaging#47 (comment)
Fixes #27 specifically a follow up for #47: #47 (comment)
This work is now complete - but today on Planning Council call we identified that we should publish this information somewhere - perhaps in a N&N entry for EPP at least (perhaps for Platform too)? The java, dsl, jee, rcp packages use logback, the rest of the packages use slf4j - for maintainers this is how to tell which is which: $ 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:
and with slf4j:
Which replaces the long standing message:
|
In general I agree but as mentioned in eclipse-platform/eclipse.platform.releng.aggregator#1252 (comment) I'm currently a bit hesitating about that since I don't want to advertise m2e.logback as an 'official' provider and configurator of logback for Eclipse. To make a long-story short, if it is mentioned it would be great if it is focused on slf4j.simple and/or that it is made clear that the m2e.logback feature is probably subject to change in the future.
I would not mention the LogbackServletContainerInitializer since it is usually not necessary within the Eclipse IDE and only available due to apache/aries#233. |
Thanks @HannesWell - I'll add you to reviewers before it gets published so we don't promise things we don't want to maintain! |
Is there any way to disable
when running from a terminal? None of these did anything:
We use some features of eclipse headless as part of builds and those messages can add a lot of clutter when invoked multiple times. |
I think this is controlled by org.slf4j.helpers.Reporter.initVerbosity() where I think it's not possible to specify something that will ignore info messages:
I suggest using the debugger to see if there is some way, but it appears to me there isn't.... |
I am not sure exactly what needs to be done in EPP yet, see eclipse-platform/eclipse.platform.releng.aggregator#588 (comment) for a starting point and the N&N entry https://www.eclipse.org/eclipse/news/4.28/platform.php#slf4j.api-version-2
The text was updated successfully, but these errors were encountered: