logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Stauffer" <stauffer.ja...@gmail.com>
Subject Re: level based logging into seperate files
Date Tue, 31 Jul 2007 17:59:28 GMT
Here are appenders for DEBUG, INFO, WARN, and ERROR:

  <appender name="DebugApp" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="File" value="${catalina.base}/logs/Debug.txt" />
    <param name="DatePattern" value="'.'yyyy-MM-dd-HH" />
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%p %d{mm:ss.SSS}    %c
      %m%n"  />
    </layout>
  </appender>

  <appender name="OutputApp" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="Threshold" value="info"/>
    <param name="File" value="${catalina.base}/logs/Output.txt" />
    <param name="DatePattern" value="'.'yyyy-MM-dd-HH" />
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%p %d{mm:ss.SSS}    %c
      %m%n"  />
    </layout>
  </appender>

  <appender name="WarnApp" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="Threshold" value="warn"/>
    <param name="File" value="${catalina.base}/logs/Warn.txt" />
    <param name="DatePattern" value="'.'yyyy-MM-dd-HH" />
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%p %d{mm:ss.SSS} %c on
%t: %m%n"  />
    </layout>
  </appender>

  <appender name="ErrorApp" class="sps.log.log4j.DateFormatFileAppender">
    <param name="Threshold" value="error"/>
    <param name="File"
value="'${catalina.base}/logs/'MMM-dd-EEE'/'HH-mm-ss-S'.log'" />
    <param name="Separate" value="true" />
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern"
        value="%p %d{mm:s.SSS}%n   Location   : %C %M%n   Thread     :
%t%n   Category   : %c%n   Run        : %X{run}%n   entry      :
%X{entry}%n   entryParams: %X{entryParams}%n   Client     :
%X{client}%n   SNAL #     : %X{SNAL_Log}%n   Username   :
%X{username}%n   Occured At : %X{occuredAt}%n   docId      :
%X{docId}%n   senderId   : %X{senderId}%n   receiverId :
%X{receiverId}%n   formId     : %X{formId}%n   evisionDocId:
%X{evisionDocId}%n   engineKey  : %X{engineKey}%n   appKey1    :
%X{appKey1}%n   Query      : %X{SQL-Query} %X{SQL-Values}%n   Nested
Context: %x%n%m%n*******%n"
        />
    </layout>
  </appender>

On 7/31/07, Sarvananda <navnith.maudgil@gmail.com> wrote:
>
>
>
> James Stauffer wrote:
> >
> > I have created one appender per level but each appender gets logs of
> > the given level and above.  Do you want to see an example of that?
> >
>
> Yes pleae. Id be grateful for that.
>
> thanks
>
> --
> View this message in context: http://www.nabble.com/level-based-logging-into-seperate-files-tf4150902.html#a11929271
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message