You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by pvphuc <pc...@yahoo.com.vn> on 2006/12/12 04:46:30 UTC

Need help about RollingLogfileAppender.

I have read document about Log4Net and I have some info about
RollingLogFileAppender : The new file will be created depend on the size or
date in Config file.

Is it right ?

If it is right, I configured my file Log4Net.Config : 

<appender name="RollingLogFileAppender"    
        type="log4net.Appender.RollingFileAppender">

    <file value="c:/logs/log.txt" />

    <AppendToFile value="true" />
    <datePattern value="yyyyMMdd" />
    <MaximumFileSize value="1KB" />
    <MaxSizeRollBackups value="10" />
    <rollingStyle value="Size" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%d [%t] %-5p %c [%x] - %m%n" />
    </layout>
</appender>

I think a new file will be created in c:/logs with  name is log.txt when
FileSize is over 1KB. If it is created, it it overwrite the old file ?

If I want to create log file everyday, I will set <RollingStyle value="Date"
/>.

Please help me more understand about that !

Thanks in advance !

Phuc

-- 
View this message in context: http://www.nabble.com/Need-help-about-RollingLogfileAppender.-tf2805347.html#a7826900
Sent from the Log4net - Users mailing list archive at Nabble.com.


Re: Need help about RollingLogfileAppender.

Posted by pvphuc <pc...@yahoo.com.vn>.
I have done this problem !

But I have another question about Log4Net.Appender.TraceAppender.

If in my Log4Net.Config file I have :

<appender name="TraceAppender" type="log4net.Appender.TraceAppender" >
    <filter type="log4net.Filter.LevelRangeFilter">
      <acceptOnMatch value="true" />      
    </filter>
    <layout type="log4net.Layout.PatternLayout">
      <ConversionPattern value="%-5p - %m%n"/>
    </layout>
  </appender>

Please tell me where and how it is write Trace Information .

Thanks so much !
-- 
View this message in context: http://www.nabble.com/Need-help-about-RollingLogfileAppender.-tf2805347.html#a7828502
Sent from the Log4net - Users mailing list archive at Nabble.com.