Debugger target

michael-freidgeim-webjet edited this page Mar 22, 2018 · 10 revisions

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>

See Also

There is similar OutputDebugString-Target, that writes to OutputDebugString - that can be monitored by DebugView (And friends)

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.