C#日志记录。我应该怎么使用? [英] C# Logging. What should I use?

查看:111
本文介绍了C#日志记录。我应该怎么使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待在切换到一个新的统一记录解决方案用于我们的新产品线,我想看看一些人对堆栈溢出的想法。我们需要记录用于各种领域应用的:ASP .NET,Windows服务,Web服务,WPF应用程序等。我们只是一个窗口店

I'm looking at switching to a new unified logging solution for use in our new line of products and I wanted to see what some of the people on Stack Overflow thought. We will need logging for a variety of applicatons: ASP .net, windows services, web services, wpf apps etc. We are a windows shop only.

我们的一些要求为记录解决方案包括:

Some of our requirements for a logging solution include:

1)日志文件管理

- Ability to split files up over a certain size
- Ability to auto archive/delete after certain period of time


$ b一段时间后删除$ b

2)能够发送某些类型的记录(例如错误)

2) Ability to send emails on certain types of messages logged (errors for example)

3)能够将消息写入Windows事件日志<信息的电子邮件/ p>

3) Ability to write messages to the windows event log

- We need to be able to specify where it's being written in the event log. 
  It would also be nice if it would automatically create the event log source if it does exist.



我已经开始寻找n日志,Windows跟踪和log4net的。我不局限于这3只这只是少数想出了很多搜索时。

I've started looking at nLog, windows trace and log4net. I'm not limited to these 3 only it's just a few that came up a lot when searching.

推荐答案

log4net的始终是一个不错的选择。

log4net is always a good choice.

http://logging.apache.org/log4net/

这篇关于C#日志记录。我应该怎么使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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