NET Logging Library
Quick Start C#

Step 1: Configure the logger


You can configure the logger using runtime properties or using the config editor.  The config editor is an easy to use GUI.  The config editor has the ability to create an external log.config which is an XML file or can edit your app.config/web.config file.  The two most important properties to know are the MessageFormat and the DateFormat.

Example run time property configuration:

//Clear all configuration
Log.ResetConfiguration();

//Add a New Target
FileTarget fileTarget = new FileTarget("log.txt");
Log.Config.Targets.Add(fileTarget);

//Example saving to Log.Config XML file
Log.SaveConfigurationToXmlFile("log.config");

//Example saving to app.config or web.config
Log.SaveConfigurationToAppConfigOrWebConfig("web.config);

Step 2:  Start Logging


The configuration is loaded automatically when first used.  It will look for the log.config in the current directory then it will look in the app.config or web.config

//Licensed Mode
//Log.UserName = "User Name From Receipt";
//Log.LicenseKey = "LicenseKey From Receipt"; 
   
//Option 1: Use built in static logger
Log.Debug("This is a test");

//Option 2: Create a concrete implementation
ConcreteLog logger = new ConcreteLog()
logger.Debug("This is a test");