Re: Log4j2 in osgi-bundle

2019-05-30 Thread Jean-Baptiste Onofré
Hi, OK, I think you need some "background" about OSGi. To avoid to pollute the mailing list, please ping me in private message, I will explain deeply. Regards JB On 30/05/2019 15:20, Matthias Wegner wrote: > SLF4J > > = > > Adding to the pom > > >             org.slf4j >            

Re: Log4j2 in osgi-bundle

2019-05-30 Thread Matthias Wegner
SLF4J = Adding to the pom             org.slf4j             slf4j-api             1.7.26         and using in java logger with     private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass().getSimpleName()); works like charm in the bundle, than

Re: Log4j2 in osgi-bundle

2019-05-30 Thread Jean-Baptiste Onofré
Hi, you should not embed log4j as private: you should import the log4j packages provided by pax-logging. However, the log4j2 packages versions is 2.8.2, not 2.11.0. So, I recommend to use Import-Package with [2,3). You can see the packages using package:exports|grep -i log4j command. Regards J

Re: Log4j2 in osgi-bundle

2019-05-30 Thread francois.papon
Hi,The easy way is to use slf4j.regards,FrancoisEnvoyé depuis mon smartphone Samsung Galaxy. Message d'origine De : matthiaw Date : 30/05/2019 14:45 (GMT+04:00) À : user@karaf.apache.org Objet : Log4j2 in osgi-bundle I want to use log4j2 in my osgi-bundle for karaf. W

Log4j2 in osgi-bundle

2019-05-30 Thread matthiaw
I want to use log4j2 in my osgi-bundle for karaf. When i add log4j into the pom, compile it and load it into karaf, then the exception Unresolved requirements: [[... [56](R 56.0)] osgi.wiring.package; (&(osgi.wiring.package=*org.apache.logging.log4j*)(version>=2.11.0)(!(version>=3.0.0)))] is thro