[ 
https://issues.apache.org/jira/browse/LOG4J2-10?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13657062#comment-13657062
 ] 

Timothy Ward commented on LOG4J2-10:
------------------------------------

bq. I've never had a Log4J 1 and 2 scenario that did not require fiddling with 
the classpath, using bundles is not going to change that.

Actually using bundles is designed to change exactly that. Libraries should be 
packaged in such a way as to make them as easy to reuse as possible. Ideally 
they should also be self-describing, which OSGi bundles are. This means that 
well written OSGi applications set up their own class path without having to be 
fiddled with.

To make log4j 2.0 *really* easy to use in OSGi you don't want users to have to 
pull in lots of dependencies they don't need, but you also don't want things to 
look as if they can be used when really they can't. JMS is a good example, the 
JMS API is one part of the story, but you also need a JMS implementation. What 
that means is that the bundle has an Import-Package dependency on javax.jms, 
but also a Generic "Require-Capability" for a JMS provider implementation. You 
really don't want to pull in the JMS API and an implementation all of that in 
all of the time if you're only using a FileAppender, so separating it out makes 
a lot of sense.

Just making everything optional does avoid the initial "Why do I need all of 
these dependencies?" problem. But it does so by introducing the "Why doesn't 
this work?" problem for anyone who does try to use JMS, or Mongo, or any of the 
other extensions that need the extra dependencies. These dependencies aren't 
really optional because parts of the log4j API are broken if the dependencies 
aren't satisfied. If we take the name of this JIRA bug at face value then we 
should be aiming to make log4j 2.0 work well with OSGi, not attempting to treat 
OSGi's modularity as something to be worked around

                
> log4j 2.0 should work well with OSGi and Apache Felix
> -----------------------------------------------------
>
>                 Key: LOG4J2-10
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-10
>             Project: Log4j 2
>          Issue Type: Wish
>            Reporter: Curt Arnold
>         Attachments: reduced-dependency-bundles.patch
>
>
> OSGi and specifically the Apache Felix implementation should be considered 
> for framework services such as internal logging and configuration.
> log4j 2.0 should be able to be a provider of OSGi logging services.
> OSGi package visibility declarations should be used to distinguish between 
> exported and explicitly supported APIs and implementation specific details. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to