NET Logging Library
CloseAllConnections Method (Log)
Example 



KellermanSoftware.NetLoggingLibrary Namespace > Log Class : CloseAllConnections Method
Close all the connections to all targets. Closes all file streams, database connections etc.
Syntax
Public Shared Sub CloseAllConnections() 
Log.CloseAllConnections()
public static void CloseAllConnections()
public:
static void CloseAllConnections(); 
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(Environment.CurrentDirectory + "\\fileLogger.txt");
Log.Config.Targets.Add(fileTarget);
 
//Parameters
string message = "Test Message";
string additionalInfo = "Additional Info";
 
//Log a debug message
Log.Debug(message, additionalInfo);
 
//Close all file and database connections
Log.CloseAllConnections();
'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(Environment.CurrentDirectory & "\fileLogger.txt")
Log.Config.Targets.Add(fileTarget)
 
'Parameters
Dim message As String = "Test Message"
Dim additionalInfo As String = "Additional Info"
 
'Log a debug message
Log.Debug(message, additionalInfo)
 
'Close all file and database connections
Log.CloseAllConnections()
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