.NET logging framework [closed]

2020-01-28 02:39发布

In java world you have log4j and a a pretty decent logging framework, is there anything like that for C#/.NET?

标签: c# logging
16条回答
We Are One
2楼-- · 2020-01-28 03:04

NLog is a good option.

查看更多
贪生不怕死
3楼-- · 2020-01-28 03:06

Is there anything that the Windows Event Log + Log Parser can't do for you?

查看更多
该账号已被封号
4楼-- · 2020-01-28 03:09

Actually, if you don't need sophisticated logging options straight out of the box, I would suggest writing a thin interface that defines your logging needs (such as log.debug(), log.error(), etc). This will give you flexibility if you need to change latter, or find problems with your current implementation.

While this doesn't seem like a big gain, it was a big win for us recently when we ported our framework to the Windows Compact Framework, and none of the logging options worked. We were able to slide in a null logger, which saved us on that platform. Of course, evaluate for your specific project and needs.

查看更多
forever°为你锁心
5楼-- · 2020-01-28 03:11

log4net would be the obvious answer.

查看更多
登录 后发表回答