PerformanceCounter Layout Renderer
Rolf Kristensen edited this page Oct 15, 2023
·
27 revisions
Render value retrieved from Windows Performance Counter.
Platforms Supported: Limited - Windows only and requires nuget-package NLog.PerformanceCounter with NLog 5.0
${performancecounter:Category=String:Counter=PerformanceCounterType:Instance=String
:IncrementValue=Integer:MachineName:string
format=String:culture=Culture}
- Counter - Name of the performance counter. Required.
- Category - Name of the counter category. Required.
-
Instance - Name of the performance counter instance. Optional.
NLog 4.6 will automatically use current process as Instance-Id when
Category
= "Process" (Supports multi-instance) - MachineName The name of the machine to read the performance counter from. Optional.
-
Format - Format string for conversion from float to string.
Introduced with NLog v4.6
-
Culture - Culture used for rendering.
Culture
Introduced with NLog v4.6
- Troubleshooting Guide - See available NLog Targets and Layouts: https://nlog-project.org/config
- Getting started
- How to use structured logging
- Troubleshooting
- FAQ
-
All targets, layouts and layout renderers
Popular: - Using NLog with NLog.config
- Using NLog with appsettings.json