当应用程序运行时,log4net adonetappender会锁定日志表吗? [英] Is log4net adonetappender lock the log table while application running?

查看:44
本文介绍了当应用程序运行时,log4net adonetappender会锁定日志表吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的Web应用程序使用Log4Net`AdoNetAppender`。是的,它的工作,但有些事情是错的。





例如我的日志表有两个异常,如果我启动了应用程序并且它记录了一个异常,同时如果我选择了表,它没有显示第三个日志,但我可以在IIS停止运行网站后看到第三个日志。



请建议我,我该如何修复这个?



我尝试了什么:



我推荐了这个链接

log-net-Tutorial

I'm using Log4Net `AdoNetAppender` for my Web Application. Yes its working, but something is wrong.


for example My log table having two exception ,If i started the application and its logging one exception,meanwhile if i select the table,its not showing the third log, but I can able to see the third log after i stop running the website in IIS.

Please suggest me,how do i fix this?

What I have tried:

I referred this link
log-net-Tutorial

推荐答案

不,它没有。



问题可能是缓冲。默认情况下,ADO.NET appender不会在获取它们时将每个日志项写入数据库。它将缓冲它们并将它们分批写入数据库。



在FAQ部分下面的文章中进一步阅读,你会发现:

No, it doesn't.

The problem is probably buffering. The ADO.NET appender will not, by default, write each and every log item to the database as it gets them. It will buffer them and write them to the database in batches.

Read further down that article, under the FAQ section, and you'll find this:
Quote:

为什么我不能让我的ADO.NET appender记录任何东西?如果您查看所有设置并且它们看起来正确,则可能是您遇到了bufferSize配置的痛苦。将bufferSize更改为1,它将尝试立即记录您发送的每条消息。如果这仍然不起作用,则问题是您的配置。


这篇关于当应用程序运行时,log4net adonetappender会锁定日志表吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆