NET Logging Library
Logging to a Performance Counter
Basic Tasks > Logging to a Performance Counter

The Performance Counter target is used to simply increment a performance counter

It has these properties that can be configured:

 

//Example runtime configuration, can also use log.config, app.config, or web.config
Log.ResetConfiguration();  
PerfCounterTarget target = new PerfCounterTarget();   
target.CounterName = "ABC Counter";
target.Category = "ABC Category";
target.Type = PerformanceCounterType.NumberOfItems32;
target.Instance = "instance";
Log.Config.Targets.Add(target);

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