1

i have a asp.net web application written about 2 years ago .It does not have any logging mechanism in it. Ideally I would like to log any errors that happen especially at the database level. I cannot afford to break the application however, and I have limited time.

I have heard about ELMAH. Is it possible to have something that doesn't talk to my code directly and just does its own thing by monitoring the server?

  • It was made in ASP.NET 3.5.
  • It has AJAX as well as heavy use of ViewState.
  • The application also communicates with Excel.
  • It is built in Visual Studio 2008 w/ SQL Server 2005 on the backend.

How do I go about deploying this website with above requirements?

4
  • Is the event viewer not sufficient, or are the errors handled without any sort of logging? Commented Oct 10, 2011 at 18:06
  • the errors are handled ,but there is no logging to know what happened where ,how and why ? Commented Oct 10, 2011 at 18:13
  • If the errors are handled and no exceptions are thrown, I think you'll have to build logging into the application. Commented Oct 10, 2011 at 18:14
  • thanks to everyone for help and advice .. Commented Oct 10, 2011 at 18:16

2 Answers 2

2

Yes.

Added ELAMH to your application - it will log the errors. It's non-invasive.

Once ELMAH is added to your application it hooks into the OnError Event and captures all errors throw by your application. This is assuming that your application does not swallow the errors.

The documentation around ELMAH is through and easy to follow.

Sign up to request clarification or add additional context in comments.

4 Comments

Do you have a helpful link to share as well?
will it log if there is a failed transaction in the database ?do I have to do something to hook it up with the database errors ?
I get the impression that the exceptions are being swallowed.
@ashutoshraina if the exception is throw and not swallowed in a catch statement then yes, it will log the error.
2

There is also log4net -

http://logging.apache.org/log4net/

1 Comment

At minimum you would need to make changes to your web.config and/or global.asax Application_Error()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.