-
Notifications
You must be signed in to change notification settings - Fork 1.4k
FallbackGroup target
Rolf Kristensen edited this page Nov 23, 2021
·
12 revisions
Provides fallback-on-error.
Platforms Supported: All
<targets>
<target xsi:type="FallbackGroup" name="String" returnToFirstOnSuccess="Boolean">
<target xsi:type="wrappedTargetType" ... />
<target xsi:type="wrappedTargetType" ... />
...
<target xsi:type="wrappedTargetType" ... />
</target>
</targets>
- name - Name of the target.
-
returnToFirstOnSuccess - Indicates whether to return to the first target after any successful write.
Boolean
. Defaultfalse
Fallback to another mail if the mailserver is down
<target xsi:type="FallbackGroup"
name="mail"
returnToFirstOnSuccess="true">
<target xsi:type="Mail"
name="mailserver1"
subject="Layout"
to="Layout"
from="Layout"
smtpServer="mx1.example.com"
smtpPort="Integer"
layout="Layout" />
<target xsi:type="Mail"
name="mailserver2"
subject="Layout"
to="Layout"
from="Layout"
smtpServer="mx2.example.com"
smtpPort="Integer"
layout="Layout" />
</target>
<rules>
<logger name="*" minlevel="Trace" writeTo="mail" />
</rules>
- 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