Hi,

by default, SMX use the conf/log4j.xml file.

You can change the appender, log category, log level, etc directly in this file.

If you want to use an alternate log4j file (XML or properties), you can :
1/ add the directory that contains your log4j.xml in the classpath. For 
example, the log4j.xml file is in the /var/lib/smx/conf directory. You add this 
directory in the SMX classpath using the servicemix.conf file :
[app]
   load /var/lib/smx/conf
   load ${servicemix.home}/conf
   load ${servicemix.home}/lib/*.jar
   load ${servicemix.home}/lib/optional/*.jar

As your log4j.xml will be the first in the classpath, it will take in place of 
the default one.

2/ another way is to use the LogServiceMBean via a JMX client. The 
LogServiceMBean defines a LogConfigUrl attribute where you can define your own 
log4j.xml. After invoke the reconfigure() method to take care. The advantage of 
this solution is that it can be done on the fly (without restarted SMX) but the 
configuration is loose if you restart SMX.

Regards
JB

On Friday 27 February 2009 - 04:21, Chandran R wrote:
> 
> Hi All,
> 
> I am a new-bie to servicemix.How do we configure servicemix to pick a
> different log4j.xml other than the default. 
> I want it to pick for ex "customized-log4j.xml". 
> Thanks in advance,
> 
> Regards,
> R Chandran
> 
> -- 
> View this message in context: 
> http://www.nabble.com/customized-log4j-file-tp22244857p22244857.html
> Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
> 

-- 
Jean-Baptiste Onofré
---------------------------------
 HomePage
http://www.nanthrax.net
---------------------------------
 Contacts
[email protected]
[email protected]
---------------------------------
 OpenSource
BuildProcess/AutoDeploy
http://buildprocess.sourceforge.net
Apache ServiceMix
http://servicemix.apache.org
-----------------------------------
PGP : 17D4F086

Reply via email to