You could try setting the org.ops4j.pax.logging.useBufferingLogFallback property to true. That should give you a PaxLogger that buffers logging events while backend service is not available. No idea how stable that is compared to the default one, so be prepared to fix any issues you might encounter.
Niclas On Wed, Aug 31, 2016 at 9:33 PM, Jayanga Dissanayake <[email protected]> wrote: > Hi All, > > I am trying to update the configuration via > "org.osgi.service.cm.Configuration" > and once I update the configuration, some logs are missing (while the debug > logs are enabled it should log all the bundle "BundleEvent INSTALLED", > "BundleEvent RESOLVED" logs but these are missing in the logs.) > > I temporally add a thread sleep to the BundleActivatior start() after > updating the configuration and then I can see all the bundles that I > install, logging the above-mentioned output. > It seems once I update the Configuration it takes a little time to get > reflected. Has anyone faced the same thing before? > > I tried to register a "SynchronousConfigurationListener" and wait until > the configuration update is received by this bundle. But still, the problem > is there. > > Following is an extract from my code, > > //============================ > ServiceReference reference = bundleContext.getServiceReference( > ConfigurationAdmin.class); > if (reference != null) { > ConfigurationAdmin configurationAdmin = (ConfigurationAdmin) > bundleContext.getService(reference); > Configuration configuration = configurationAdmin. > getConfiguration("org.ops4j.pax.logging", null); > ... > Hashtable loggingProperties; > ... > // Loading the loggingProperties with log4j file location > // "org.ops4j.pax.logging.log4j2.config.file" -> > "[path_to_the_log4j_file]/log4j2.xml" > configuration.update(loggingProperties); > //============================= > > Does anyone has an idea what is happening? Or know how to guarantee that > the configurations are updates before installing the other bundles? > > Thanks, > Jayanga. > > -- > -- > ------------------ > OPS4J - http://www.ops4j.org - [email protected] > > --- > You received this message because you are subscribed to the Google Groups > "OPS4J" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Niclas Hedhman, Software Developer http://zest.apache.org - New Energy for Java -- -- ------------------ OPS4J - http://www.ops4j.org - [email protected] --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
