How should I log exceptions? I never tried logging in .NET before. Nor try to dump exceptions to a txt (or binary) file. I dont require a text file, just a way to view the logs with the file and line #.
-edit- using asp.net
How should I log exceptions? I never tried logging in .NET before. Nor try to dump exceptions to a txt (or binary) file. I dont require a text file, just a way to view the logs with the file and line #.
-edit- using asp.net
Not a direct answer, but one thing we've found useful for logging problems with our own code was creating a base exception class (inherited from Exception) and automatically logging the exception details, using Log4Net (or whatever), in all of the derived exceptions.
Obviously this won't log other types of exceptions (BCL, 3rd party) but it is useful.
The other thing about logging exceptions, if you want the full stack trace, use Exception.ToString() rather than just Exception.Message.