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 K Srinivas <ks...@yahoo.co.in> on 2005/09/29 11:44:05 UTC
writing logs into multiple files
Hi,
currently i am writing the whole of the logs of my
application into a single log file.
I want to write the logs into different log files
based
on the log level. or the package level (meaning
classes
in the same package will write to a single log file).
Hence if i have 5 packages in my application, i should
write the logs into 5 log files
can any one please give me a solution for the same?
Thanks in advance
srinivas
__________________________________________________________
Yahoo! India Matrimony: Find your partner online. Go to http://yahoo.shaadi.com
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: writing logs into multiple files
Posted by Antoine TYNEVEZ <at...@patrimoine.com>.
I think you might write something like that :
<appender name="FILE_APP_DEBUG" class="org.apache.log4j.FileAppender">
<param name="File" value="C:/MyDirectory/MyFile" />
<param name="Append" value="false" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="Your
Layout"/>
</layout>
<filter class="org.apache.log4j.varia.*LevelMatchFilter*">
<param name="*LevelToMatch*" value="DEBUG"/>
<param name="AcceptOnMatch" value="true"/>
</filter>
</appender>
and so on for INFO, WARN, ERROR and FATAL
hope it could help
Antoine
K Srinivas a écrit :
>Hi,
>
>currently i am writing the whole of the logs of my
>application into a single log file.
>
>I want to write the logs into different log files
>based
>on the log level. or the package level (meaning
>classes
>in the same package will write to a single log file).
>Hence if i have 5 packages in my application, i should
>
>write the logs into 5 log files
>
>can any one please give me a solution for the same?
>
>Thanks in advance
>srinivas
>
>
>
>
>
>
>
>
>__________________________________________________________
>Yahoo! India Matrimony: Find your partner online. Go to http://yahoo.shaadi.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>
>
>
>
--
*Antoine Tynévez*
/Patrimoine Management & Technologies/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org