logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bender Heri" <HBen...@Ergonomics.ch>
Subject RE: Defining fileappender in log4j.xml
Date Tue, 09 May 2006 14:31:03 GMT
    <param name="File"   value="folder/workshop_test.log" />
should do the trick (slash instead of '.'). Log4j does not create folders if they do not exist.
So must assure this folder exists before initializing log4j.
Heri

> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of ks
> Sent: Tuesday, May 09, 2006 3:42 PM
> To: log4j-user@logging.apache.org
> Subject: 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
> 
> 

---------------------------------------------------------------------
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