Custom appenders can be deployed by using fragments attached to the pax-logging-service bundle fwiw.
On Thu, May 3, 2012 at 1:21 PM, Achim Nierbeck <bcanh...@googlemail.com>wrote: > I'm not sure what you are trying to do, but log4j as slf4j and a > couple more logging framworks are supported by Karaf. > We use Pax Logging for this, log4j is even the underlying > implementation for logging. > If you want to use your own appenders you need to take special care for > this. > > Regards, Achim > > 2012/5/3 maaruks <maris.orbid...@gmail.com>: > > Is it possible to use log4j in karaf ? > > > > I have log4j classes in my bundle but I cant access them: > > > > try { > > Class<?> aClass = Class.forName("org.apache.log4j.Appender"); > > } catch (ClassNotFoundException e) { > > throw new RuntimeException(e); > > } > > > > > > > > java.lang.RuntimeException: java.lang.ClassNotFoundException: > > org.apache.log4j.Appender not found by > org.ops4j.pax.logging.pax-logging-api > > [4] > > ....... > > Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Appender > not > > found by org.ops4j.pax.logging.pax-logging-api [4] > > at > > > org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787) > > at > org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71) > > at > > > org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_26] > > at > > > org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:645) > > at > > org.apache.felix.framework.resolver.WireImpl.getClass(WireImpl.java:99) > > at > > org.apache.felix.framework.ModuleImpl.searchImports(ModuleImpl.java:1390) > > at > > > org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:722) > > at > org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71) > > at > > > org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_26] > > at java.lang.Class.forName0(Native Method)[:1.6.0_26] > > at java.lang.Class.forName(Class.java:169)[:1.6.0_26] > > > > > > -- > > View this message in context: > http://karaf.922171.n3.nabble.com/log4j-tp3958839.html > > Sent from the Karaf - User mailing list archive at Nabble.com. > > > > -- > > Apache Karaf <http://karaf.apache.org/> Committer & PMC > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> > Committer & Project Lead > OPS4J Pax Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home> > Commiter & Project Lead > blog <http://notizblog.nierbeck.de/> > -- ------------------------ Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ FuseSource, Integration everywhere http://fusesource.com