开发者

log in asp.net mvc

In my mvc application开发者_运维技巧 i need to check a condition in action and throw it to the log.

How can i add a info to log info.


To use the event log:

System.Diagnostics.EventLog.WriteEntry()

Or look at a library like log4net or ELMAH.

Kindness,

Dan


Have you tried using EMAB or Log4Net libraries?

Yes...there are built-in classes but instead of building it ground-up the best method is to use established frameworks.

Check this out >>> MS Logging Application Block
And if your needs are at a very basic level the System.IO.Log should suffice.

For unhandled errors ELMAH is the easiest to use.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜