ASP.NET应用程序的日志记录框架

编程入门 行业动态 更新时间:2024-10-15 16:25:25
本文介绍了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应用程序的日志记录框架

本文发布于:2023-11-15 15:59:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1595878.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   框架   日志   ASP   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!