0

I'm trying to log all exceptions to a sql server database through log4net, and I've seen some posts here explaining how to properly configure the web.config file, but my question is: do it is enough to get the exception logged (the application will log automatically, but in this case it does not work on my app), or do I have to call the logger from code-behind into try/catch statement?

Any suggestion would be appreciated!

Thanks a lot, Epros

Robert Gould
  • 68,773
  • 61
  • 187
  • 272

3 Answers3

1

You can user Application_Error in global.asax. This is called when an unhandler error occurs.

Sascha
  • 10,231
  • 4
  • 41
  • 65
0

This might help.

Community
  • 1
  • 1
Arnis Lapsa
  • 45,880
  • 29
  • 115
  • 195
0

There is nothing to auto-catch, you need to hook up your unhandled exception to do the logging (in the same way you'd hook it up to do any other global exception management).

Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249