You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Griffith, Bill (ISS Southfield)" <wg...@iss.net> on 2001/04/24 16:29:58 UTC

Adding Appender to AsyncAppender from config file

Hello,
I am relatively new to log4j, so if I'm way off base with this question,
feel free to let me know.  
Currently in my config file I am using the RollingFileAppender with my
Category objects, can I specify from the config file that Category object
use the AsyncAppender which in turn uses the RollingFileAppender?  

Bill

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


Re: Adding Appender to AsyncAppender from config file

Posted by Tom Palmer <to...@interpath.net>.
Works for me.  Here's the config:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE configuration SYSTEM "log4j.dtd">
<!-- "/usr/local/share/java/pkgs/log4j-v0.9.1/org/log4j/xml/log4j.dtd"
-->

<!-- $Id: servletlog-config.xml,v 1.2 2001/01/26 17:42:26 tpalmer Exp $
-->

<configuration configDebug="false">

  <appender name="ASYNC" class="org.log4j.AsyncAppender">
    <appender-ref ref="ROLLFILE"/>
  </appender>

  <appender name="ROLLFILE"
            class="org.log4j.RollingFileAppender">
    <param name="File" value="/web/server/log/servletlog.log"/>
    <param name="MaxFileSize" value="1MB" />
    <param name="MaxBackupIndex" value="24" />
    <layout class="org.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d [%t] %-5p %c %x -
%m\n"/>
    </layout>
  </appender>

  <root>
    <priority value="debug"/>
    <appender-ref ref="ASYNC"/>
  </root>
</configuration>


"Griffith, Bill (ISS Southfield)" wrote:
> 
> Hello,
> I am relatively new to log4j, so if I'm way off base with this question,
> feel free to let me know.
> Currently in my config file I am using the RollingFileAppender with my
> Category objects, can I specify from the config file that Category object
> use the AsyncAppender which in turn uses the RollingFileAppender?
> 
> Bill
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org

-- 
Tom Palmer                                  Interpath Communications
tom.palmer@interpath.net                    1700 Perimeter Park West
919-253-5937                                Morrisville, NC 27560
919-253-6586 (fax)

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