开发者

Saving error message and stack on asp.net

I've designed a website that works through my own PC.

I set 开发者_JAVA技巧the IIS to work with Custom Errors in case user ran into some unknown exception.

I've also added a check that the error page will e-mail me whenever it found an error.

Can I somehow get the error information (Stack and description) from the error page?


I encourages you to use Open Source library out there that provided functional need. My recommendation is ELMAH.

With a few line of settings in your web.config, you will all set. result screen looks like this.

Saving error message and stack on asp.net


(source: googlecode.com)


You can use ASP.NET Health monitoring.

http://msdn.microsoft.com/en-us/library/ms998306.aspx


Catch any errors that might be thrown and write them to the event log.

EventLog Logger = new EventLog();
Logger.Source = "ApplictionNme";

Logger.WriteEntry("Writing to event log.");
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜