logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravi <rav...@cox.net>
Subject Setting the logfile destination within the code
Date Tue, 27 Jan 2009 15:23:14 GMT
Hi: How do I setup the filename to which to send the logs within my code?

my log4j.xml has the following. I guess I have to send the File 
attribute from my code. Can't seem to figure out how to change it using 
the BasicConfigurator.
  <appender name="FileLog" class="org.apache.log4j.RollingFileAppender">
    <param  name="File" value="./logs/mylogs.logs" />
    <param  name="MaxFileSize" value="100KB"/>
    <!-- Keep one backup file -->
    <param  name="MaxBackupIndex" value="1"/>
    <layout class="org.apache.log4j.PatternLayout">
    <param  name="ConversionPattern"
        value="%d %-5p [%t] %C (%F:%L) - %m%n"/>


Thank you,

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

View raw message