PerfCounter target
If you want to contribute, please create a user account and contact Jarek to get edit access.
Increments specified performance counter on each write.
Supported in

Configuration Syntax
<targets>
<target xsi:type="PerfCounter"
name="String"
instanceName="String"
counterHelp="String"
counterType="Enum"
autoCreate="Boolean"
categoryName="String"
counterName="String" />
</targets>
Read more about using the Configuration File.<target xsi:type="PerfCounter"
name="String"
instanceName="String"
counterHelp="String"
counterType="Enum"
autoCreate="Boolean"
categoryName="String"
counterName="String" />
</targets>
Parameters
- General Options
- name - Name of the target.
- Performance Counter Options
- instanceName - Performance counter instance name.
- counterHelp - Counter help text.

This parameter is not supported in:
- NLog v1.0 for .NET Framework 1.0
- NLog v1.0 for .NET Framework 1.1
- NLog v1.0 for .NET Framework 2.0
- counterType - Performance counter type. Default: 65536
Possible values: - autoCreate - Indicates whether performance counter should be automatically created.Boolean
- categoryName - Name of the performance counter category. Required.
- counterName - Name of the performance counter. Required.
Remarks
TODO: 1. Unable to create a category allowing multiple counter instances (.Net 2.0 API only, probably) 2. Is there any way of adding new counters without deleting the whole category? 3. There should be some mechanism of resetting the counter (e.g every day starts from 0), or auto-switching to another counter instance (with dynamic creation of new instance). This could be done with layouts.




