On 8/21/07, ram4servicemix <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
>  I am using log4j.xml in my servicemix component. In the process of logging
> i am trying to have the log files individually for debug & error as
> debug.log and error.log respectively.
>
> I am using Jboss server as my application server.
>
> 1. Is there anything different that has to be followed for servicemix
> 2. Where exactly the log4j.xml has to be resided.
> 3. or Service mix provides anyother options for logging.

Filtering log statements into separate files can be achieved using
Log4J filters which can only be used in a log4j.xml style of
configuraiton. Luckily, ServiceMix uses this style of configuration
via the conf/log4j.xml. Below is an example of an appender for
filtering only the error level:

<appender name="ERROR" class="org.apache.log4j.RollingFileAppender">
  <param name="File" value="data/log/servicemix-error.log" />
  <param name="Append" value="true" />
  <param name="MaxBackupIndex" value="2" />
  <param name="MaxFileSize" value="500KB" />
  <layout class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern" value=""%-5p - %-30c{1} - %m%n" />
  </layout>
  <filter class="org.apache.log4j.varia.LevelRangeFilter">
    <param name="LevelMin" value="error" />
  </filter>
</appender>


What you'll need to do is configure a separate appender for each level
that you'd like to append to its own log file.

Bruce
-- 
perl -e 'print unpack("u30","D0G)[EMAIL 
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/
Castor - http://castor.org/

Reply via email to