java - How to set a system property for the log4j2 JUL adapter in an OSGi environment -


i want use log4j2 jul adapter in osgi environment. directly used log4j2 osgi bundles , set following system property in 1 of custom osgi bundle mentioned here:

system.setproperty("java.util.logging.manager", "org.apache.logging.log4j.jul.logmanager"); 

it seems system property not setting because logs coming java util framework not going appenders.

the osgi framework i'm using eclipse equinox.

where set system property work osgi?

edit:

as far understood here problem @ begging of jvm start required property i.e. java.util.logging.manager set default value, setting inside osgi environment not effective, cannot set property using -d option because log4j2 osgi bundles not exposed class path, class not found exception occurs.

any highly appreciate on matter.

generally, if setting property through system.setproperty api not work ok (maybe because property has been read before can overwrite it), should try setting jvm start, entering "-d" arguments @ command line:

-djava.util.logging.manager=org.apache.logging.log4j.jul.logmanager 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -