.net - Log4Net Logging Exceptions -
I know that I can log exceptions to the database using Log4Net, but I break up one exception
Does anyone know that it is available, if someone has done it or manually databases Exceptions are easy to log in?
Cheers Anthony
UPDATE:
If it possibly helps to use the following:
- Does anyone Know that it is available?
- I'm following this description:
- Exception type
- Exception message
- Exceptionsource
- Targeted exceptions
- If anyone has done this?
- Is it easy to log exceptions to the database manually?
Perhaps the format changes will help.
- I'm following this description:
As requested, you can use the approach outlined here: possibly log4net and then in its format: It is worth testing / research to see if this thread is secure (name indicates that it is , But it can not hurt to be tested). You also want to ensure that do not include subsequent log messages in their messages (i.e., make sure it is cleared). To use additional custom information about certain exceptions to use custom properties in thread context
public zero log-date exception (log level level) , String message, exception exception) {log4net.ThreadContext.Properties ["exceptionType"] = exception.GetType () AssemblyQualifiedName; // log4net.ThreadContent.Properties.Remove the appropriate logging statement ("exceptionType"); // clean it, so it is not used in future calls)
& lt; Conversion value = "% property {exception exception"} "/>
Comments
Post a Comment