-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Debugger target
Rolf Kristensen edited this page Oct 22, 2023
·
16 revisions
Writes log messages to the attached managed debugger (Ex. Visual Studio Output Window). See also System.Diagnostics.Debugger.Log
Platforms Supported: Limited (Not available for NetStandard1.3 + NetStandard1.5)
<targets>
<target xsi:type="Debugger"
name="String"
footer="Layout"
layout="Layout"
header="Layout" />
</targets>
Read more about using the Configuration File.
- name - Name of the target.
-
layout - Text to be rendered. Layout Required. Default:
${longdate}|${level:uppercase=true}|${logger}|${message:withexception=true}
- header - Layout used to format header-output when initializing. Layout
- footer - Layout used to format footer-output when closing. Layout
From stackoverflow
<targets>
<target name="debugger" xsi:type="Debugger" layout="${logger}::${message}"/>
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="debugger" />
</rules>
Alternative targets for diagnostic output:
-
Trace-target for output to
System.Diagnostics.Trace
-
DebugSystem-target for output to
System.Diagnostics.Debug
-
OutputDebugString-target for output to
OutputDebugString
Win32 API
- Troubleshooting Guide - See available NLog Targets and Layouts: https://nlog-project.org/config
- Getting started
- How to use structured logging
- Troubleshooting
- FAQ
- Articles about NLog
-
All targets, layouts and layout renderers
Popular: - Using NLog with NLog.config
- Using NLog with appsettings.json