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

The StringBuilder target writes to a System.Text.StringBuilder

It has these properties that can be configured:

 

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

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

 

//Write out the contents

Console.WriteLine(target.Builder.ToString());