Skip to content

Instantly share code, notes, and snippets.

@moo2u2
Created April 8, 2024 00:30
Show Gist options
  • Save moo2u2/91ab04e74f918507b268f10e04471b63 to your computer and use it in GitHub Desktop.
Save moo2u2/91ab04e74f918507b268f10e04471b63 to your computer and use it in GitHub Desktop.
Log OrderCloud SDK HTTP calls through Flurl
FlurlHttp.Configure(settings => settings.BeforeCall = (FlurlCall call) =>
{
app.Logger.LogInformation($"Calling {call.Request.Url} with {call.RequestBody}");
});
FlurlHttp.Configure(settings => settings.OnError = (FlurlCall call) =>
{
app.Logger.LogError(call.Exception, $"Error calling {call.Request.Url}");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment