Quantcast
Channel: Active questions tagged retry-logic - Stack Overflow
Viewing all articles
Browse latest Browse all 950

How to institute logging from Poly ResiliencePipeline for success after failure

$
0
0

In C# I'm using Polly Version=8.4.1 and a reusable retry ResiliencePipeline via ResiliencePipelineBuilder.

    return new ResiliencePipelineBuilder()        .AddRetry(new RetryStrategyOptions        {            MaxRetryAttempts = 5,            DelayGenerator = {blah(blah, blah);},            ShouldHandle = args => { blahblah(blah); }        }).Build();

I want to be able to add logging for when the operation initially fails but subsequently succeeds. Something like:

{operations} recovered after 3 tries, in 22 seconds

I believe in older versions of Polly this would be accomplished by injecting handling via the OnSuccess operation.

How is this done in v8.x?


Viewing all articles
Browse latest Browse all 950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>