NET Logging Library
TotalLogCount Property (Log)
Example 



KellermanSoftware.NetLoggingLibrary Namespace > Log Class : TotalLogCount Property
The total number of messages that have been logged for all targets
Syntax
Public Shared ReadOnly Property TotalLogCount As Long
Dim value As Long
 
value = Log.TotalLogCount
public static long TotalLogCount {get;}
public:
static property int64 TotalLogCount {
   int64 get();
}
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");
 
//Add it to the targets
Log.Config.Targets.Add(fileTarget);
 
for (int i = 0; i < 1000; i++)
    Log.Debug("This is a test " + i);
 
//This will be 1000
Console.WriteLine(Log.TotalLogCount);
'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")
 
'Add it to the targets
Log.Config.Targets.Add(fileTarget)
 
For i As Integer = 0 To 999
    Log.Debug("This is a test " & i)
Next i
 
'This will be 1000
Console.WriteLine(Log.TotalLogCount)
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