You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Matt Sicker (JIRA)" <ji...@apache.org> on 2014/01/27 00:33:38 UTC

[jira] [Updated] (LOG4J2-513) Use more OSGi-friendly class loading mechanisms.

     [ https://issues.apache.org/jira/browse/LOG4J2-513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Sicker updated LOG4J2-513:
-------------------------------

    Attachment: 0002-Refactor-class-loader-usage-in-LogManager.patch
                0001-Fix-weird-usage-of-StatusLogger.patch

Here's what I've got so far. As I mentioned in a TODO comment, the bundle activator part would be better implemented using a declarative service (using the Felix annotations would be the easiest way) or blueprints. However, this is still a significant improvement in OSGi support.

I'm completely open to better names for anything here as LoggerContextFactoryContext seems a bit ridiculous. :)

> Use more OSGi-friendly class loading mechanisms.
> ------------------------------------------------
>
>                 Key: LOG4J2-513
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-513
>             Project: Log4j 2
>          Issue Type: Sub-task
>          Components: API
>    Affects Versions: 2.0-rc1
>         Environment: OSGi
>            Reporter: Matt Sicker
>              Labels: api, bundle, classloader, osgi
>         Attachments: 0001-Fix-weird-usage-of-StatusLogger.patch, 0002-Refactor-class-loader-usage-in-LogManager.patch
>
>
> See for instance [here|http://njbartlett.name/2012/10/23/dreaded-thread-context-classloader.html]. Currently, o.a.l.l.util.ProviderUtil has a findClassLoader() method that depends on using the thread context class loader (TCCL). Now this method may work in certain environments, but once you're in an OSGi environment, class loaders are far more modular thanks to each bundle getting its own class loader. The thread context class loader is oftentimes not the correct one in such an environment.
> I'll do more research on being compatible with OSGi without depending on OSGi. In the meantime, this ticket will have to do.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org