I'm developing a ASP.NET 2.0 portal and are wondering how to implement some
kind of logging which logs all the exceptions which occur while the website
is running, So the administrator can view the log and discover problems,
like the website trying to access a page on another server, and this server
is down. Then it would be nice if problems like this could be logged!
I've looked into healthmonitoring and the EventLog class, What do you
recommend me to use? I think healthmonitroing is best but it's just that I
don't know how to use it. But I can learn :-)
Regarding healthmonitoring, this code below will of course throw an
exception. How do I know that healthmonitoring will log this error?
try{
int i = null;
int result = 100/i;
}
catch (Exception e) {
}
Best Regards!
JeffHello jeff,
U can just rethrow your errors in catch or dont use the catch, but handle
all error in Application_Error method at global.asax
Health Monitoring is just set of service methods which helps you to write
your errors to the desired source, such as eventLog, or file or send via
email
--
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
jASP.NET 2.0
j>
jI'm developing a ASP.NET 2.0 portal and are wondering how to
jimplement some kind of logging which logs all the exceptions which
joccur while the website is running, So the administrator can view the
jlog and discover problems, like the website trying to access a page
jon another server, and this server is down. Then it would be nice if
jproblems like this could be logged!
j>
jI've looked into healthmonitoring and the EventLog class, What do you
jrecommend me to use? I think healthmonitroing is best but it's just
jthat I don't know how to use it. But I can learn :-)
j>
jRegarding healthmonitoring, this code below will of course throw an
jexception. How do I know that healthmonitoring will log this error?
jtry{
jint i = null;
jint result = 100/i;
j}
jcatch (Exception e) {
j}
jBest Regards!
j>
jJeff
j>
Jeff,
You may want to look at the Enterprise Library at
http://www.codeplex.com/entlib There's a loggin application block that
should do the trick for you and it's very adaptable.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:%23tVbkvwnHHA.596@.TK2MSFTNGP06.phx.gbl...
Quote:
Originally Posted by
ASP.NET 2.0
>
I'm developing a ASP.NET 2.0 portal and are wondering how to implement
some kind of logging which logs all the exceptions which occur while the
website is running, So the administrator can view the log and discover
problems, like the website trying to access a page on another server, and
this server is down. Then it would be nice if problems like this could be
logged!
>
I've looked into healthmonitoring and the EventLog class, What do you
recommend me to use? I think healthmonitroing is best but it's just that I
don't know how to use it. But I can learn :-)
>
Regarding healthmonitoring, this code below will of course throw an
exception. How do I know that healthmonitoring will log this error?
try{
int i = null;
int result = 100/i;
}
catch (Exception e) {
}
>
Best Regards!
>
Jeff
>
0 comments:
Post a Comment