NET Logging Library
Optimizing Performance

Turning Off Features

By default, the .NET Logging Library captures rich information about the environment and process information.  These features can be turned off to enhance performance.

 

By default, reflection is used to gather calling method information.  This can be turned off to increase performance.  When turned off these log fields will be blank: AssemblyName, FileName, ClassName, MethodName, Namespace, LineNumber.

Log.Config.GetCallingMethodDetails = false

 

By default, environmental info is gathered.  This can be turned off to increase performance.  When turned off these log fields will be blank:  UserName, MachineName, Identity, ProcessName.

Log.Config.GetEnvironmentInfo = false

 

Asynchronous Mode

By default, all logging is a synchronous blocking item.  If the target is to a web service or a database, it may make sense to switch the logging mode to asynchronous for that logging target.

FileTarget target = new FileTarget("log.txt");
target.Mode = LoggingMode.Asynchronous;