开发者

log4net doesn't write log entries until application close

开发者 https://www.devze.com 2023-01-21 03:17 出处:网络
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:

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

精彩评论

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