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 Ron Grabowski <ro...@yahoo.com> on 2011/03/01 02:46:32 UTC

Re: Issue with rolling based on date

RollingFileAppender isn't a database. If you have multiple programs logging to the same file I suggest using another appender.



________________________________
From: kshah82 <ki...@persistent.co.in>
To: log4net-user@logging.apache.org
Sent: Tuesday, February 15, 2011 9:02 AM
Subject: Issue with rolling based on date


Hi, 

We are having 10 programs which are rolling into same log file namlely
"logger.log". 

Below is configuration of RollingFileAppender which we are using : 
  <appender name="RollFile" type="log4net.Appender.RollingFileAppender"> 
    <threshold value ="ALL"/> 
    <file value="C:\logger.log" /> 
    
    <appendToFile value="true" /> 
    <maximumFileSize value="1GB" /> 
    <staticLogFileName value="true"/> 
    <maxSizeRollBackups value="5" /> 
    <datePattern value=".yyyy-MM-dd-tt".log""/> 
    <rollingStyle value="Composite" /> 

    
    <layout type="log4net.Layout.PatternLayout"> 

      

    </layout> 
  </appender> 

Our rolling based on date is running at every 12 hour span means at 12 Noon
and 12 Midnight. Now what is happening when multiple programs try to log
into log file at the same time when rolling happens means at 12
noon/midnight, then size of file getting rolled is becoming very small
compare to original file size(i.e Suppose logger.log is around 1 MB at 12
noon, when rolling happens the new rolled file which is get generated is
around 3 KB or somewhat). So, almost data get lost due to this. This is
basically happening when multiple programs try to log into log file at the
same time of when rolling happens(means at 12 noon/midnight). 

Please revert back to us on this ASAP as its very important us to go ahead.

-- 
View this message in context: http://old.nabble.com/Issue-with-rolling-based-on-date-tp30931116p30931116.html
Sent from the Log4net - Users mailing list archive at Nabble.com.

Re: Issue with rolling based on date

Posted by Svante Seleborg <so...@axantum.com>.
The log4net remote logging service
http://log4netremotelogging.codeplex.com/ solves
this issue, and some others too.

Svante