ASP.NET应用程序的日志记录框架 [英] Logging Framework for the ASP.NET application

查看:71
本文介绍了ASP.NET应用程序的日志记录框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序需要记录有关用户操作(插入,更新,删除等)和异常的信息,我想在Oracle10上存储日志,因此我正在搜索一些日志框架以供使用. 我读了一些有关:

My application needs to log informations about user actions (inserts, updates, deletes, etc) and exceptions and i want to store de log on Oracle10, so i'am searching some log framework to use. I read a little bit about:

1 -Log4Net

1 -Log4Net

2-记录应用程序块

3-埃尔玛

您对这些日志工具有何看法? 什么是登录我的应用程序的好框架(或实现方式)?

Whats your opinion about these log tools? Whats a good framework (or way to implement) log on my application?

*与项目经理讨论后,记录应用程序块 将是我们的选择,但是,请对此发表评论=)

*After a discussion with the project manager, Logging Application Block will be our choice, but, lets comment about this =)

推荐答案

log4net和Logging Application Block都是有效的选择.我认为ELMAH主要集中在错误日志记录上,因此(您唯一想要的)可能不是.

Both log4net and Logging Application Block are valid choices. I think ELMAH is mostly focused on error logging, so that is probably not (the only thing) that you want.

在工作中,我在几个项目上使用log4net.它稳定,高效且可扩展,我们从未遇到过任何问题.

At work, I use log4net on a couple of projects. It is stable, performant and extensible, and we have never had any problems with it.

我可能会使用log4net进行日志记录,并同时使用ELMAH记录异常.它可以手动记录未处理的异常,并且您可以通过一次调用ELMAH记录在应用程序中捕获和处理的任何异常.这可能看起来像两次记录(它是:-)).但是,当您的应用程序发生意外故障时,拥有ELMAH日志非常有价值.

I would probably do logging with log4net and log exceptions with ELMAH also. It can log unhandled exceptions manually, and any exception you catch and handle in your application can be logged with a single call to ELMAH. This might seem like double-logging (and it is :-)). But it is very valuable to have the ELMAH log when something unexpected has failed in your application.

我听说过有关 NLog项目的好事,但我自己还没有使用过.它似乎比log4net稍微复杂一点,但是确实具有能够添加上下文信息以自动记录消息的额外好处(有点像ELMAH).

I have heard good things about the NLog project, but haven't used it myself. It seems to be a bit more complex that log4net, but does have the added benefit of being able to add contextual information to log messages automatically (a bit like ELMAH).

这篇关于ASP.NET应用程序的日志记录框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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