CallActivityWithRetryAsync ability to impact logging behavior
See original GitHub issueLet’s suppose that I have an acivity that I expect to fail pretty often because it’s relying on a “not so great” API. Now calling that activity I leverage the CallActivityWithRetryAsync method to make sure my orchestration is more likely to execute properly.
However each failed attempt is logging everything as errors which clutters my telemetry with “exceptions”. In that scenario I’d like to be able to provide a callback that handles logging, it’d be up to my code to determine whether or not to log the failed attempts and if yes, at which level.
That callback definition could be on the RetryOptions object, a property like public Action<Exception, int, bool, ILogger> HandleLogging {get;set;} (the exception happening, the number of attempts, is it the last attempt or not based on the options, logger to leverage)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:15 (4 by maintainers)

Top Related StackOverflow Question
I like this feature request
Thanks for the suggestion. The idea seems reasonable to me.
The challenge is that while we can control logging done by the Durable extension, we don’t have control over the logging behavior of the Functions runtime. This means someone would have to change both the extension and the host to make this scenario work the way you want. It’s probably doable, but I think we’d need to get a good number of votes for this capability or rely on an externally contributed PR since I expect it will be difficult to prioritize.
Let me know if you think there is a compromise that could result in a simpler fix.