NET Logging Library
Error(String) Method
Example 



KellermanSoftware.NetLoggingLibrary Namespace > Log Class > Error Method : Error(String) Method
Log an error message
Syntax
Public Overloads Shared Function Error( _
   ByVal message As String _
) As LogResponse
Dim message As String
Dim value As LogResponse
 
value = Log.Error(message)
public static LogResponse Error( 
   string message
)
public:
static LogResponse^ Error( 
   String^ message
) 

Parameters

message
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);
 
Log.Error("Test Message");
'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)
 
Log.Error("Test Message")
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
Overload List