[ 
https://issues.apache.org/jira/browse/LOG4NET-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13919079#comment-13919079
 ] 

Dominik Psenner commented on LOG4NET-427:
-----------------------------------------

I'm sorry, but I don't know the source problem of this issue. Generally said, 
when a file is locked for writing it means that a process has the file open for 
writing and thus at least two processes try to write to the same file at the 
same time. That could mean that either the website configuration does something 
you don't want it to do (having multiple worker processes) or log4net's locking 
model is configured badly for your situation.

> Missing RollingFileAppender log events
> --------------------------------------
>
>                 Key: LOG4NET-427
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-427
>             Project: Log4net
>          Issue Type: Bug
>          Components: Other
>         Environment: IIS on Win 2008, .NET 4.0
>            Reporter: R Mariotti
>            Priority: Minor
>
> This is my first time using this Jira system so apologies if this post 
> belongs elsewhere:
> I have been using log4net for many years but more recently have been using it 
> for some more critical logging.  I'm noticing that my RollingLogAppender 
> fails to log certain events.  It appears to be random but it's as if the .log 
> file loses "connection" with IIS periodically and stops writing.  
> Particularly on log files that write a single line every few minutes or so.
> Can you point me in the right direction for ways to bulletproof my 
> RollingFileAppender so that it logs all the time?
> // Here's how I initialize the logger
> // log4net 1.2.0.30714
> FileInfo logConfig = new System.IO.FileInfo( logConfigFilePath_ );
> log4net.Config.DOMConfigurator.Configure( logConfig );
> // My log4net.config file:
> <log4net>
>     <root>
>         <level value="INFO" />
>         <appender-ref ref="RollingFileAppender" />
>         <appender-ref ref="ASPNetTraceAppender" />
>         <appender-ref ref="TraceAppender" />
>     </root>
>     <appender name="RollingFileAppender" 
> type="log4net.Appender.RollingFileAppender">
>         <param name="File" value="logs\\MyLogName.log" />
>         <param name="AppendToFile" value="true" />
>         <param name="RollingStyle" value="Size" />
>         <param name="MaxSizeRollBackups" value="200" />
>         <param name="MaximumFileSize" value="1000KB" />
>         <param name="StaticLogFileName" value="true" />
>         <layout type="log4net.Layout.PatternLayout">
>             <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - 
> %m%n" />
>         </layout>
>     </appender>
> </log4net>



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to