Skip to content

Latest commit

 

History

History
40 lines (33 loc) · 1.2 KB

Debugger-target.md

File metadata and controls

40 lines (33 loc) · 1.2 KB

Writes log messages to the attached managed debugger. See also System.Diagnostics.Debugger.Log

Supported in .NET, Silverlight and Mono

Configuration Syntax

<targets>
  <target xsi:type="Debugger"
          name="String"
          footer="Layout"
          layout="Layout"
          header="Layout" />
</targets>

Read more about using the [[Configuration File]].

Parameters

General Options

  • name - Name of the target.

Layout Options

  • footer - Footer. Layout
  • layout - Text to be rendered. Layout Required. Default: ${longdate}|${level:uppercase=true}|${logger}|${message}
  • header - Header. Layout

Performance Options

  • OptimizeBufferReuse - Reduce logging overhead, by allowing buffer reuse. Default: True

    Introduced with NLog v4.4.2. Default became True with NLog v4.5

Examples

From stackoverflow

<targets>
  <target name="debugger" xsi:type="Debugger" layout="${logger}::${message}"/>
</targets>

<rules>
  <logger name="*" minlevel="Trace" writeTo="debugger" />
</rules>