Hi Munish, log4j2 backend with pax-logging doesn't mean you have to use XML configuration format.
Using config.file with XML has two limitations: 1. It doesn't reload automatically when you change the XML, you have to reload pax logging 2. You can't change the XML directly using config:* commands Instead of log4j2 XML, you can use directly the cfg pax logging log4j2 backend: it's what you have by default in Karaf 4.2.x. For instance, here's the default pax logging log4j2 configuration: https://github.com/apache/karaf/blob/master/assemblies/features/base/src/main/resources/resources/etc/org.ops4j.pax.logging.cfg Do you really need log4j2 XML configuration ? Regards JB On 19/02/2019 13:40, munishgupta.asr wrote: > Hi, > > Earlier with Log4J, we used to change "org.ops4j.pax.logging.cfg" for > changing any configuration like compression etc by using karaf commands. > config:edit org.ops4j.pax.logging > property-set <set property here> > config:update > > with Log4J2, now entire configuration is in log4j2.xml and > org.ops4j.pax.logging.cfg has just one entry which is > org.ops4j.pax.logging.log4j2.config.file=etc/log4j2.xml > > I have to enable/disable compression at run time by changing filePattern > defined in log42.XML. > > can i manipulate log42.xml directly by using karaf commands now? > > Regards > Munish > > > > > -- > Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html > -- Jean-Baptiste Onofré [email protected] http://blog.nanthrax.net Talend - http://www.talend.com
