开发者

log in asp.net mvc

开发者 https://www.devze.com 2022-12-13 12:31 出处:网络
In my mvc application开发者_运维技巧 i need to check a condition in action and throw it to the log.

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

精彩评论

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