NET Logging Library
Logging to a DataTable
Basic Tasks > Logging to a DataTable

The Datatable target is used to log to an in memory DataTable

It has these properties that can be configured:

 

 

//Example runtime configuration, can also use log.config, app.config, or web.config
Log.ResetConfiguration();   
DataTableTarget target = new DataTableTarget ();       
Log.Config.Targets.Add(target);

Log.Debug("This is a test");

Console.WriteLine(target.DataTable.Rows.Count);