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 "Hankey, Chris" <Ch...@Transamerica.com> on 2011/05/03 00:34:30 UTC

Log Files Role Over After 1 Entry

We have an issue where log4net is rolling over log  files after one entry.  So based upon the config below, we end up with 25 1k log files.  This does not always happen.  The pattern seems to be that when we restart the site, log4net either works OK or does not & continues that way until we restart the app pool again.  Any clues?  We are using v 1.2.1



Thanks

Chris


  <log4net>
    <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
      <file value="E:\\Websites\\ABD\\ABDLog\\prodjune10\\TestLog.txt" />
      <appendToFile value="true" />
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
      <RollingStyle value="Composite" />
      <DatePattern value="yyyyMMdd" />
      <maximumFileSize value="8MB" />
      <maxSizeRollBackups value="25" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%level %date %-4timestamp {%thread} [%logger] - %message%newline" />
      </layout>
    </appender>


Re: Log Files Role Over After 1 Entry

Posted by Svante Seleborg <so...@axantum.com>.
You are probably logging from several AppDomains to the same log file. This
is not really supported by Log4Net, not even with the 'minimal' locking
style. Try the http://log4netremotelogging.codeplex.com/ which solves this
and other issues whith several log sources.

Svante

On Tue, May 3, 2011 at 12:34 AM, Hankey, Chris <
Chris.Hankey@transamerica.com> wrote:

> We have an issue where log4net is rolling over log  files after one entry.
> So based upon the config below, we end up with 25 1k log files.  This does
> not always happen.  The pattern seems to be that when we restart the site,
> log4net either works OK or does not & continues that way until we restart
> the app pool again.  Any clues?  We are using v 1.2.1
>
>
>
>
>
>
>
> Thanks
>
>
>
> Chris
>
>
>
>
>
>   <log4net>
>
>     <appender name="RollingLogFileAppender"
> type="log4net.Appender.RollingFileAppender">
>
>       <file value="E:\\Websites\\ABD\\ABDLog\\prodjune10\\TestLog.txt" />
>
>       <appendToFile value="true" />
>
>       <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
>
>       <RollingStyle value="Composite" />
>
>       <DatePattern value="yyyyMMdd" />
>
>       <maximumFileSize value="8MB" />
>
>       <maxSizeRollBackups value="25" />
>
>       <layout type="log4net.Layout.PatternLayout">
>
>         <conversionPattern value="%level %date %-4timestamp {%thread}
> [%logger] - %message%newline" />
>
>       </layout>
>
>     </appender>
>
>
>