[logback-dev] [JIRA] Commented: (LBCLASSIC-296) Allow hook/override in PackagingDataCalculator

Chris Dolan (JIRA) noreply-jira at qos.ch
Sat Oct 15 07:16:13 CEST 2011


    [ http://jira.qos.ch/browse/LBCLASSIC-296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12218#action_12218 ] 

Chris Dolan commented on LBCLASSIC-296:
---------------------------------------

I've implemented a patch: https://github.com/chrisdolan/logback/commit/eb1b03ac72f0534d9152279e39d85a81615a5e78

This patch breaks the existing creation of the ClassPackagingData instance into a strategy, and adds a second strategy that constructs that instance via OSGi. If that second strategy fails with NoClassDefFoundError because the org.osgi.framework package is not in the classloader, then that strategy is skipped.

In the test code, I verify that the second strategy loads correctly with the OSGi jars present and fails gracefully if the OSGi jars are absent.


> Allow hook/override in PackagingDataCalculator
> ----------------------------------------------
>
>                 Key: LBCLASSIC-296
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-296
>             Project: logback-classic
>          Issue Type: New Feature
>    Affects Versions: 0.9.29
>            Reporter: Chris Dolan
>            Assignee: Logback dev list
>            Priority: Minor
>         Attachments: PackagingDataCalculator-additions.txt
>
>
> I'm running Logback as my SLF4J implementation in an OSGi container (Karaf). I love the feature of ThrowableProxy that populates stacktraces with the jar/version. Under Karaf, unfortunately, that data is always wrong because Karaf processes the jars into its data/generated-bundles folder before loading.
> So, I forked PackagingDataCalculator in my own code to some class resolution logic (attached). That code is not important because it's too OSGi-specific for inclusion into Logback. But I'd like the ability to inject something like that calculation code into Logback so I don't have to fork PackagingDataCalculator any longer.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list