开发者

log4net doesn't write log entries until application close

I want log4net to开发者_运维百科 write to my ADO log immediately but it doesn't seem to do it until the application exists, how can I remedy this?


You have to configure the buffer size like this:

<bufferSize value="1" />


In my case I had to configure my appender by adding a parameter to it as follows:

<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
  [...]
  <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
  [...]
</appender>

I just set the locking model to minimal lock, and that did the job.

HTH

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜