Skip to content

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

Configuration Syntax

${performancecounter:Category=String:Counter=PerformanceCounterType:Instance=String
                    :IncrementValue=Integer:MachineName:string
                     format=String:culture=Culture}

Parameters

Performance Counter Options

  • 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.

Rendering Options

  • 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

Clone this wiki locally