NET Logging Library
Synchronous Logging
Basic Tasks > Synchronous Logging

By default, all logging targets are synchronous blocking operations.  Normally this isn’t a problem for performance unless slow logging targets are being used.  If the DefaultLoggingMode has been changed to Asychronous or Buffered, it can be overridden back to Synchronous.  The configuration can be defined using runtime properties, a log.config file, or the app.config/web.config.

Example Runtime Configuration
//Clear all the configuration
Log.Config.ResetConfiguration();

//Make the default Asyncronous
Log.Config.DefaultLoggingMode = LoggingMode.Asynchronous;

//Add a Target and make it Synchronous
FileTarget fileTarget = new FileTarget("log.txt");
fileTarget.LoggingMode = LoggingMode.Synchronous;
Log.Config.Targets.Add(fileTarget);