NET Logging Library
LoggingException Property (Log)
Example 



KellermanSoftware.NetLoggingLibrary Namespace > Log Class : LoggingException Property
The last exception that occured while attempting to log. Null, if there is no exception.
Syntax
Public Shared ReadOnly Property LoggingException As Exception
Dim value As Exception
 
value = Log.LoggingException
public static Exception LoggingException {get;}
public:
static property Exception^ LoggingException {
   Exception^ get();
}
Example
//Licensed Mode
//Log.UserName = "User Name From Receipt";
//Log.LicenseKey = "LicenseKey From Receipt";            
 
//Clear all configuration
Log.ResetConfiguration();
 
//Enable fail safe logging (this is the default)
Log.Config.IsFailSafeLoggingEnabled = true;
 
//Set up a file logger with a bad configuration
FileTarget target = new FileTarget("c:\\somepaththatdoesntexist\\log.txt");
Log.Config.Targets.Add(target);
 
//No exception will be thrown because we are in fail safe logging
Log.Debug("This is a test");
 
//There will be an exception placed in this property
Console.WriteLine(Log.LoggingException.ToString());
'Licensed Mode
'Log.UserName = "User Name From Receipt";
'Log.LicenseKey = "LicenseKey From Receipt";            
 
'Clear all configuration
Log.ResetConfiguration()
 
'Enable fail safe logging (this is the default)
Log.Config.IsFailSafeLoggingEnabled = True
 
'Set up a file logger with a bad configuration
Dim target As New FileTarget("c:\somepaththatdoesntexist\log.txt")
Log.Config.Targets.Add(target)
 
'No exception will be thrown because we are in fail safe logging
Log.Debug("This is a test")
 
'There will be an exception placed in this property
Console.WriteLine(Log.LoggingException.ToString())
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Log Class
Log Members