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);
}
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
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.comwrote:
I'm not sure what you are trying to do, but log4j as slf4j and a
couple more logging framworks are supported by
Hi,
you can add a BundleListener and check if the state of the bundle of ID 0.
Anyway it looks weird to me to define some logic at startup. Why not
using a bootFeature or a startup bundle ?
Regards
JB
On 05/03/2012 05:28 PM, bobshort wrote:
We have bundles that do some intensive
There's no such thing as a 'started' state. The osgi framework is fully
asynchronous and things can even be done on behalf of other bundles. The
only real way to know if 'something' is started is to have this thing
register an osgi service when started and wait for this service to be
registered.
Thanks for the replies!
The main thing I'm trying to accomplish is to not start expensive processing
while the framework is booting. On a embedded ARM device it can take
framework startup times from 2 min to +5 min.
I was thinking of trying a bundle with a very high run level and use it to