开发者

where does a novice begin with error logging in asp.net c#?

i'm a novice teaching myself asp.net in c# via trial and error learn by doing, unfortunately this means lots of errors!

i have a custom errors page now that is basically a 404 so that site visitors don't get that ugly application error message .NET throws, but i WOULD like to be able to see what's going wrong myself as people use the site.

so i'm looking to build or learn from a fairly basic error logging c# class, that will send the same information given in a browser when hitting a .NET error, send this into a TXT file and email me the error at the same t开发者_如何学Pythonime would be great

i don't know where to even begin, can someone give me some pointers? an open source class that does this already that i could plugin and play with would work as well. otherwise some links or guidance on where to start reading would be great too.

i sort of have a mental block on understand msdn info-dump pages though, i'm hoping to find some articles on real people talking about implementing the same thing themselves or something like that

please note i'm not looking to use some extensive or complicated third party service for this, i'm hoping to learn from the process of implementing a concise customized one


There are many logging frameworks, but I recommend you use log4net for code-driven logging and ELMAH for ASP.NET logging. Scott Hanselman's ELMAH blog posting is a great introduction to this fantastic tool.


I recommend starting with ELMAH. Here's an overview from Scott Hanselman.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜