log4net 文件名重叠解决办法
此为多线程写日志造成
解决办法,在appender节点里添加:
<param name="lockingModel" type="log4net.Appender.FileAppender+MinimalLock" />
完整XML示例:
<log4net> <root> <level value="ALL" /> <appender-ref ref="RollingLogFileAppender" /> </root> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> <param name="File" value="Log/" /> <param name="AppendToFile" value="true" /> <param name="MaxSizeRollBackups" value="10" /> <param name="StaticLogFileName" value="false" /> <param name="DatePattern" value="yyyy-MM-dd".log"" /> <param name="RollingStyle" value="Date" /> <layout type="log4net.Layout.PatternLayout"> <param name="Header" value="----------------------------------------[Header]--------------------------------------

" /> <param name="Footer" value="----------------------------------------[Footer]--------------------------------------

" /> <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n%n" /> </layout> </appender> </log4net>
桂棹兮兰桨,击空明兮溯流光。