NET Logging Library
Logging to Null
Basic Tasks > Logging to Null

The NullTarget is purely for performance testing.  It logs to nowhere.

 

Log.ResetConfiguration();

//Turn off some options to get the most performance
Log.Config.GetCallingMethodDetails = false;
Log.Config.GetEnvironmentInfo = false;
Log.Config.IgnoreDuplicates = false;

Log.Config.Targets.Add(new NullTarget());

Stopwatch watch = new Stopwatch();
watch.Start();
for (int i=0;i<10000;i++)
 Log.Debug("This is a test");

watch.Stop();

Console.WriteLine("Elapsed Milliseconds: " + watch.ElapsedMilliseconds.ToString());