# Fallback is not getting triggered with both the Serilog options implementations FallbackChain/Fallible

**URL:** <https://discuss.elastic.co/t/fallback-is-not-getting-triggered-with-both-the-serilog-options-implementations-fallbackchain-fallible/379446>\
**Category:** Elastic Observability\
**Created:** [June 24, 2025, 6:17pm UTC](https://discuss.elastic.co/t/fallback-is-not-getting-triggered-with-both-the-serilog-options-implementations-fallbackchain-fallible/379446 "2025-06-24T18:17:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rainman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rainman/32/43218_2.png) [@rainman](https://discuss.elastic.co/u/rainman)\
**Post date:** [June 24, 2025, 6:17pm UTC](https://discuss.elastic.co/t/fallback-is-not-getting-triggered-with-both-the-serilog-options-implementations-fallbackchain-fallible/379446/1 "2025-06-24T18:17:01Z")

</div>

Facing issue to handle to log only the loggs when the cluster is down.

I did try with the below implemenation but when the elasticsearch culster is down the loggs are not being logged to the secondary sink.

```auto
var apiKeyElasticSearch = "<strong>";
var elasticUrl = "http://</strong> *:9200";

```

First Example:

```auto
Log.Logger = new LoggerConfiguration()
        .WriteTo.FallbackChain(
             wt => wt.Elasticsearch(
                new[] { new Uri(elasticUrl) },
                options =>
                {
                    options.DataStream = new DataStreamName("errors", "ms", "dev");
                    options.IlmPolicy = "errors-retention-policy";
                    options.TextFormatting = new EcsTextFormatterConfiguration<LogEventEcsDocument>();
                    options.BootstrapMethod = BootstrapMethod.Failure;
                    options.ConfigureChannel = channelOptions =>
                    {
                        channelOptions.BufferOptions = new BufferOptions
                        {
                            ExportMaxConcurrency = 10,
                            ExportMaxRetries = 0
                        };
                    };

                },
                transport =>
                {
                    transport.Authentication(new ApiKey(apiKeyElasticSearch));
                }
            ),
            // Fallback: Windows Event Log
            wt => wt.EventLog("Sample App", manageEventSource: true)
        )
.CreateLogger();

```

**Second Example**

```auto
public class MyFailureListener : ILoggingFailureListener
{
    public void OnLoggingFailed(object sender, LoggingFailureKind kind, string message, IReadOnlyCollection<LogEvent>? events, Exception? exception)
    {
        using (var eventLog = new EventLog("Application") { Source = ".NET Runtime" })
        {
            eventLog.WriteEntry("Testing success", EventLogEntryType.Error, 1000);
        }
    }
}

```

```auto
var listener = new MyFailureListener();

    Log.Logger = new LoggerConfiguration()
       .WriteTo.Fallible(
    wt => wt.Elasticsearch(new[] { new Uri(elasticUrl) },
        options =>
        {
            options.DataStream = new DataStreamName("errors", "ms", "dev");
            options.IlmPolicy = "errors-retention-policy";
            options.TextFormatting = new EcsTextFormatterConfiguration<LogEventEcsDocument>();
            options.BootstrapMethod = BootstrapMethod.Failure;
            options.ConfigureChannel = channelOptions =>
            {
                channelOptions.BufferOptions = new BufferOptions
                {
                    ExportMaxConcurrency = 10,
                    ExportMaxRetries = 0
                };
            };
        },
        transport =>
        {
            transport.Authentication(new ApiKey(apiKeyElasticSearch));
            //transport.ServerCertificateValidationCallback((_, _, _, _) => true);
        }),
    listener
)
.CreateLogger();

```
