Madhava Reddy | 1 Feb 15:04 2003

RE: Hi Guys

Vijay,

I'm splitting logs according to debug levels. It works fine, but I'm not
sure whether it's how it needs to be done.. 

Here is sample of xml confuguration file I'm using.

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

    <appender name="DebugLog"
        class="org.apache.log4j.DailyRollingFileAppender">
        <param name="File"
            value="D:/tomcat4110/logs/Debug.log"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p
            %m%n"/>
        </layout>
    </appender>

    <appender name="InfoLog"
        class="org.apache.log4j.DailyRollingFileAppender">
        <param name="File"
            value="D:/tomcat4110/logs/Info.log"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p
            %m%n"/>
        </layout>
    </appender>
	
    <logger name="Debug">
        <level value="debug"/>
        <appender-ref ref="DebugLog"/>
    </logger>

  <logger name="Info">
        <level value="info"/>
        <appender-ref ref="InfoLog"/>
    </logger>

    <root>
        <priority value="debug"/>
    </root>

</log4j:configuration>

Hope this helps you

regards
Madhav

-----Original Message-----
From: vijay reddy [mailto:vijayreddy50 <at> yahoo.com]
Sent: Friday, January 31, 2003 10:07 PM
To: Log4J Users List
Subject: Hi Guys

Hi,

    Do i need to change programatically or if i change
property file or xml is it going to work.

Thanks,
Vijay

> 
> Anyway, see the Javadoc for
> org.apache.log4j.varia.LevelMatchFilter
> 
> <filter
> class="org.apache.log4j.varia.LevelMatchFilter">
>    <param name="LevelToMatch" value="DEBUG" />
>    <param name="AcceptOnMatch" value="true" />
> </filter> 
> 
> ...or something like that
> 
> []'s
> Daniel Serodio
> 
> On Fri, 2003-01-31 at 17:45, vijay reddy wrote:
> > HI ,
> > 
> >    I want to generate 5 log files depends on
> levels in
> > the same class.
> > (ex:  Logger logger =
> Logger.getLogger("com.abcd");
> >   logger.debug("debug message");
> > 
> > 1. debug message will go to debug.log,
> > 2. error messages will go to error.log, 
> > 3. Info messages will go to info.log,
> > 4. warn messages will go warn.log, 
> > 5. fatal messages will go to fatal.log.
> > Is it possible by using Log4j.Can you suggest me.
> > 
> > Thanks,
> > Vijay
> > 
> > 
> > 
> > 
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> > http://mailplus.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> log4j-user-unsubscribe <at> jakarta.apache.org
> > For additional commands, e-mail:
> log4j-user-help <at> jakarta.apache.org
> -- 
> Daniel Serodio <daniel <at> checkforte.com.br>
> CheckForte
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> log4j-user-unsubscribe <at> jakarta.apache.org
> For additional commands, e-mail:
> log4j-user-help <at> jakarta.apache.org
> 

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

Gmane