enapps-enorman opened a new pull request, #18: URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/18
Increasingly more libraries have been migrating to slf4j 2.x (for example logback 1.3+, tika 2.5+ and jetty 10+) To be compatible with those, the sling commons log bundle should migrate to slf4j v2.x and logback v1.5.x The changes proposed here is an attempt to do the refactoring to migrate to the newer versions. Here are some differences in the proposal: ----- 1. Per: https://www.slf4j.org/faq.html#changesInVersion200 SLF4J 2.x has switched to use the java.util.ServiceLoader to locate the logging implementation so we now require a service loader mediator implementation in order for the slf4j-api to find the logback implementation. 2. I have tried to avoid embedding the slf4j and logback classes inside of the org.apache.sling.commons.log bundle and instead just use the bundles that were already provided by those other organizations. That approach mostly worked, but I did encounter one classloading (visiblity) problem from our MaskingMessageUtil customizations where the class names were being passed to logback and loaded via reflection. I was also able to create a temporary workaround by forking and updating the logback PatternLayout (and related) classes to additionally pass a Supplier instead of a classname for that. I proposed a change to logback that would make my forked workaround unnecessary which is tracked at: https://github.com/qos-ch/logback/issues/803 3. There still exists a problem with some of the OAK bundles importing the org.slf4j.event with an old version that is not exported in the SLF4j 2.x implementation. I was able to workaround this by creating a fragment bundle that is attached to slf4j-api and exports the 1.7.36 version of the org.slf4j.event bundle. Hopefully OAK can be modified to remove the dependency on org.slf4j.event? I believe this is tracked as: https://issues.apache.org/jira/browse/OAK-10339 The result of this problem is errors reported by the feature analyzer like this: [ERROR] [bundle-packages] org.apache.jackrabbit:oak-lucene:1.60.0: Bundle is importing package org.slf4j.event;version=[1.7,2) with start order 15 but no bundle is exporting these for that start order in the required version range. [ERROR] [bundle-packages] org.apache.jackrabbit:oak-store-document:1.60.0: Bundle is importing package org.slf4j.event;version=[1.7,2) with start order 15 but no bundle is exporting these for that start order in the required version range. [ERROR] [bundle-packages] org.apache.jackrabbit:oak-commons:1.60.0: Bundle is importing package org.slf4j.event;version=[1.7,2) with start order 15 but no bundle is exporting these for that start order in the required version range. [ERROR] [bundle-packages] org.apache.jackrabbit:oak-core:1.60.0: Bundle is importing package org.slf4j.event;version=[1.7,2) with start order 15 but no bundle is exporting these for that start order in the required version range. [ERROR] [bundle-packages] org.apache.jackrabbit:oak-query-spi:1.60.0: Bundle is importing package org.slf4j.event;version=[1.7,2) with start order 15 but no bundle is exporting these for that start order in the required version range. 4. Integrating this into the starter (or other sling based application) requires this set of bundles in the boot.json feature descriptor: { "id":"org.ow2.asm:asm-analysis:${asm.version}", "start-order":"1" }, { "id":"org.ow2.asm:asm-commons:${asm.version}", "start-order":"1" }, { "id":"org.ow2.asm:asm-tree:${asm.version}", "start-order":"1" }, { "id":"org.ow2.asm:asm-util:${asm.version}", "start-order":"1" }, { "id":"org.ow2.asm:asm:${asm.version}", "start-order":"1" }, { "id":"org.apache.aries.spifly:org.apache.aries.spifly.dynamic.bundle:1.3.7", "start-order":"1" }, { "id":"org.apache.sling:org.apache.sling.commons.log:6.0.0-SNAPSHOT", "start-order":"1" }, { "id":"ch.qos.logback:logback-core:${logback.version}", "start-order":"1" }, { "id":"ch.qos.logback:logback-classic:${logback.version}", "start-order":"1" }, { "id":"org.slf4j:jul-to-slf4j:${slf4j.version}", "start-order":"1" }, { "id":"org.slf4j:jcl-over-slf4j:${slf4j.version}", "start-order":"1" }, { "id":"org.slf4j:log4j-over-slf4j:${slf4j.version}", "start-order":"1" }, { "id":"enapps.net:slf4j1x-compatibility:0.9-SNAPSHOT", "start-order":"1" }, { "id":"org.slf4j:slf4j-api:${slf4j.version}", "start-order":"1" }, -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
