NET Logging Library
LoggingException Property (ConcreteLog)
Example 



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

ConcreteLog Class
ConcreteLog Members