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!
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
j> ASP.NET 2.0
j>
j> I'm developing a ASP.NET 2.0 portal and are wondering how to
j> implement some kind of logging which logs all the exceptions which
j> occur while the website is running, So the administrator can view the
j> log and discover problems, like the website trying to access a page
j> on another server, and this server is down. Then it would be nice if
j> problems like this could be logged!
j>
j> I've looked into healthmonitoring and the EventLog class, What do you
j> recommend me to use? I think healthmonitroing is best but it's just
j> that I don't know how to use it. But I can learn :-)
j>
j> Regarding healthmonitoring, this code below will of course throw an
j> exception. How do I know that healthmonitoring will log this error?
j> try{
j> int i = null;
j> int result = 100/i;
j> }
j> catch (Exception e) {
j> }
j> Best Regards!
j>
j> Jeff
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.NOSPAM> wrote in message
news:%23tVbkvwnHHA.596@.TK2MSFTNGP06.phx.gbl...
> 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
>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment