NET Logging Library
LoadConfigurationFromAppConfig Method (Log)
Example 



KellermanSoftware.NetLoggingLibrary Namespace > Log Class : LoadConfigurationFromAppConfig Method
Load the configuration from the specified app.config or web.config file
Syntax
Public Shared Sub LoadConfigurationFromAppConfig( _
   ByVal filePath As String _
) 
Dim filePath As String
 
Log.LoadConfigurationFromAppConfig(filePath)
public static void LoadConfigurationFromAppConfig( 
   string filePath
)
public:
static void LoadConfigurationFromAppConfig( 
   String^ filePath
) 

Parameters

filePath
Example
//Licensed Mode
//Log.UserName = "User Name From Receipt";
//Log.LicenseKey = "LicenseKey From Receipt";            
 
//Clear all configuration
Log.ResetConfiguration();
 
//Add a new target, you can also define targets in an xml file, app.config, or web.config
FileTarget fileTarget = new FileTarget("fileLogger.txt");
Log.Config.Targets.Add(fileTarget);
 
//Example saving to app.config or web.config
Log.SaveConfigurationToAppConfigOrWebConfig("web.config");
 
//Load from web.config
Log.LoadConfigurationFromAppConfig("web.config");
'Licensed Mode
'Log.UserName = "User Name From Receipt";
'Log.LicenseKey = "LicenseKey From Receipt";            
 
'Clear all configuration
Log.ResetConfiguration()
 
'Add a new target, you can also define targets in an xml file, app.config, or web.config
Dim fileTarget As New FileTarget("fileLogger.txt")
Log.Config.Targets.Add(fileTarget)
 
'Example saving to app.config or web.config
Log.SaveConfigurationToAppConfigOrWebConfig("web.config")
 
'Load from web.config
Log.LoadConfigurationFromAppConfig("web.config")
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