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 ks <ka...@hotmail.com> on 2006/05/09 15:41:55 UTC
Defining fileappender in log4j.xml
I use log4j.xml to log to file as bellow. How can I log to a file in a
directory called "folder" which is a sublevel below default. The below code
only create a file called "folder.workshop_test.log" and not creating the
file "workshop_test.log" inside directory "folder".
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="APPLOGFILE" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="folder.workshop_test.log" />
<param name="Append" value="true" />
<param name="MaxFileSize" value="3000KB" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{DATE} %-5p %-15c{1}: %m%n"/>
</layout>
</appender>
Thanx
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Defining fileappender in log4j.xml
Posted by Norbert Toth-Gati <no...@gmail.com>.
Just simply use:
<param name="File" value="folder/workshop_test.log" />
Regards,
Norbert
On 5/9/06, ks <ka...@hotmail.com> wrote:
>
> I use log4j.xml to log to file as bellow. How can I log to a file in a
> directory called "folder" which is a sublevel below default. The below
> code
> only create a file called "folder.workshop_test.log" and not creating the
> file "workshop_test.log" inside directory "folder".
>
>
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
> <appender name="APPLOGFILE" class="org.apache.log4j.RollingFileAppender
> ">
> <param name="File" value="folder.workshop_test.log" />
> <param name="Append" value="true" />
> <param name="MaxFileSize" value="3000KB" />
> <layout class="org.apache.log4j.PatternLayout">
> <param name="ConversionPattern" value="%d{DATE} %-5p %-15c{1}:
> %m%n"/>
> </layout>
> </appender>
>
>
> Thanx
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>