Skip to content

FallbackGroup target

Rolf Kristensen edited this page Nov 23, 2021 · 12 revisions

Provides fallback-on-error.

Platforms Supported: All

Configuration Syntax

<targets>
  <target xsi:type="FallbackGroup" name="String" returnToFirstOnSuccess="Boolean">
    <target xsi:type="wrappedTargetType" ... />
    <target xsi:type="wrappedTargetType" ... />
    ...
    <target xsi:type="wrappedTargetType" ... />
  </target>
</targets>

Parameters

General Options

  • name - Name of the target.

Fallback Options

  • returnToFirstOnSuccess - Indicates whether to return to the first target after any successful write. Boolean. Default false

Example

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>
Clone this wiki locally