<div dir="ltr">Jetty includes slf4j-api-2.0.0.alpha.jar in it's jetty-home (distribution), and we've built it specifically against the slf4j version 2.0.0 series.<div><br></div><div><a href="https://github.com/eclipse/jetty.project/blob/jetty-11.0.5/pom.xml#L22">https://github.com/eclipse/jetty.project/blob/jetty-11.0.5/pom.xml#L22</a><br><div><br></div><div><a href="https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/10.0.5/jetty-home-10.0.5.tar.gz">https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/10.0.5/jetty-home-10.0.5.tar.gz</a><br></div><div><br></div><div>[jetty-home-10.0.5]$ find . -name "*slf4j*"</div><div>./lib/logging/jetty-slf4j-impl-10.0.5.jar<br>./lib/logging/slf4j-api-2.0.0-alpha1.jar<br>./modules/logging/slf4j.mod<br></div><div><br></div><div>We don't use the fluent logging API, as we were unhappy with the extra GC it seems to be generating.</div><div><br></div><div>We have full JPMS support with slf4j-api-2.0.0-alph1.jar without any extra work on our part.</div><div>Works well, even with the alternate bridge APIs.</div><div><br></div><div><a href="https://github.com/eclipse/jetty.project/blob/jetty-11.0.5/jetty-slf4j-impl/src/main/java/module-info.java#L22">https://github.com/eclipse/jetty.project/blob/jetty-11.0.5/jetty-slf4j-impl/src/main/java/module-info.java#L22</a><br></div><div><a href="https://github.com/eclipse/jetty.project/blob/jetty-11.0.5/jetty-server/src/main/java/module-info.java#L25">https://github.com/eclipse/jetty.project/blob/jetty-11.0.5/jetty-server/src/main/java/module-info.java#L25</a><br></div><div><a href="https://github.com/eclipse/jetty.project/blob/jetty-11.0.5/jetty-deploy/src/main/java/module-info.java#L25">https://github.com/eclipse/jetty.project/blob/jetty-11.0.5/jetty-deploy/src/main/java/module-info.java#L25</a><br></div><div><br></div><div>We even have automated unit testing of our JPMS layers with logging enabled! :-)</div><div><br></div><div>As for OSGI, the sfl4j-api-2.0.0-alpha1.jar lacks the OSGI manifest `Requires-Capability` for the ServiceLoader layer.</div><div>That's an unfortunate missing piece in the 2.0.0-alpha1 release.</div><div><br></div><div><div>We hacked in that missing serviceloader manifest entry into our own jetty-slf4j-impl.jar.</div><div><a href="https://github.com/eclipse/jetty.project/blob/jetty-11.0.5/jetty-slf4j-impl/pom.xml#L42-L45">https://github.com/eclipse/jetty.project/blob/jetty-11.0.5/jetty-slf4j-impl/pom.xml#L42-L45</a><br></div><div></div></div><div><br></div><div>And we have an osgi bundle fragment that we can hack the manifest into for testing reasons.</div><div>Also, for our paxweb testing, we have a snippet that adds that service loader requirement.</div><div><br></div><div><a href="https://github.com/eclipse/jetty.project/blob/jetty-10.0.3/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java#L164-L167">https://github.com/eclipse/jetty.project/blob/jetty-10.0.3/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java#L164-L167</a><br></div><div><br></div><div>        //the slf4j-api jar does not have support for ServiceLoader in osgi in its manifest, so add it now<br>        res.add(wrappedBundle(mavenBundle().groupId("org.slf4j").artifactId("slf4j-api").versionAsInProject())<br>            .instructions("Require-Capability=osgi.serviceloader;filter:=\"(osgi.serviceloader=org.slf4j.spi.SLF4JServiceProvider)\",osgi.extender;filter:=\"(osgi.extender=osgi.serviceloader.processor)\"")<br>            .overwriteManifest(OverwriteMode.MERGE)<br>            .start());<br></div><div><br></div><div>The work done in SLF4J-457 for OSGi is right on the money, and the associated PR and commit fix it nicely.</div><div><br></div><div>As for Eclipse IDE and slf4j-api-2.0.0-alpha1, they had to recently (this week) yank it out due to both some conflicts in other libraries (i'm unclear what those conflicts entailed), and the general "we think slf4j is an abandoned project" attitude.</div><div>You can see some of the conversations around this at <a href="https://www.eclipse.org/lists/cross-project-issues-dev/threads.html#18493">https://www.eclipse.org/lists/cross-project-issues-dev/threads.html#18493</a><br></div><div>We, Eclipse Jetty, had to even expand our declared Import-Package to allow using 1.7.x upwards of slf4j to allow Eclipse IDE to get past these issues for their current release.</div><div>Thankfully, our main codebase isn't using the slf4j fluent API which means we are still backwards compatible with slf4j 1.7 for OSGi users, but we'd like to encourage & foster slf4j 2.0.0 as the future direction, even there.</div><div><br></div><div>- Joakim</div></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 14, 2021 at 4:33 AM Ceki <<a href="mailto:ceki@qos.ch">ceki@qos.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Hi Joakim,<br>
<br>
Indeed, I am aware that Jetty has been supporting/using slf4j since <br>
early on. Thank you!<br>
<br>
I was not aware that Jetty and Eclipse IDE was using slf4j 2.0.0-alpha.<br>
<br>
As you are probably aware, slf4j 2.0 introduces a fluent logging API <br>
which is quite an enhancement with respect to the traditional logging <br>
API. Are you using the fluent API at all?<br>
<br>
Thank you for your offer to help. It is much appreciated.<br>
<br>
Do you see any issues that are blocking on your end? With slf4j's JPMS <br>
support perhaps? Maybe OSGi?<br>
<br>
More concretely, in SLF4J-457, see [1], the MANIFEST.MF file was <br>
modified [2] by adding a "Require-Capability:" statement, see [2]. How <br>
safe is this addition in OSGi environments? In non-OSGi environments?<br>
<br>
Best regards,<br>
<br>
<br>
[1] <a href="https://jira.qos.ch/browse/SLF4J-457" rel="noreferrer" target="_blank">https://jira.qos.ch/browse/SLF4J-457</a><br>
[2] <a href="https://github.com/qos-ch/slf4j/commit/4a1d5194fe" rel="noreferrer" target="_blank">https://github.com/qos-ch/slf4j/commit/4a1d5194fe</a><br>
<br>
--<br>
Ceki<br>
<br>
<br>
<br>
<br>
On 10.06.2021 14:41, Joakim Erdfelt wrote:<br>
> Hey Ceki,<br>
> <br>
> Hi from the Eclipse Jetty project.<br>
> We've been supporting slf4j in Eclipse Jetty since Jetty 5.x (and slf4j <br>
> 1.1.0)<br>
> <br>
> Recently (in the past 2 years), we moved to slf4j 2.0 because it was our <br>
> favorite logging facade and had support for JPMS. (proper JPMS support <br>
> was the huge deciding factor)<br>
> We did this with our Jetty 10.x series (and Jetty 11.x series), which <br>
> have had 4 stable releases each so far.<br>
> We have a JPMS web server with a JPMS based logging facade.<br>
> <br>
> We've had great success, and even wrote our own minimal implementation <br>
> of slf4j-api 2.0 that we use for our minimal deployments (even <br>
> supporting JPMS).<br>
> <a href="https://github.com/eclipse/jetty.project/tree/jetty-10.0.x/jetty-slf4j-impl" rel="noreferrer" target="_blank">https://github.com/eclipse/jetty.project/tree/jetty-10.0.x/jetty-slf4j-impl</a> <br>
> <<a href="https://github.com/eclipse/jetty.project/tree/jetty-10.0.x/jetty-slf4j-impl" rel="noreferrer" target="_blank">https://github.com/eclipse/jetty.project/tree/jetty-10.0.x/jetty-slf4j-impl</a>><br>
> <br>
> This in turn has encouraged others to adopt slf4j 2.0 as well, including <br>
> the Eclipse IDE itself.<br>
> This means we now have an OSGi manifest requirement that is being worked <br>
> out as I write this.<br>
> <br>
> We have hundreds of thousands of installations of Eclipse Jetty 10+ <br>
> active around the world now, all with slf4j 2.0 running.<br>
> <br>
> However, there's been a slow drum beat of criticism that says slf4j <br>
> looks like a dead project with an absent developer community.<br>
> <br>
> I want to see slf4j survive and continue to be the awesome project we've <br>
> grown to love.<br>
> <br>
> Is there anything you need help with?<br>
> I'll be happy to help.<br>
> Do you need help addressing or verifying anything from the JIRA issues <br>
> to progress?<br>
> <br>
> Thanks again,<br>
> Joakim Erdfelt (Eclipse Jetty committer)<br>
> <br>
<br>
--<br>
Ceki Gülcü<br>
_______________________________________________<br>
slf4j-user mailing list<br>
<a href="mailto:slf4j-user@qos.ch" target="_blank">slf4j-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/listinfo/slf4j-user</a></blockquote></div>