chore: implements Debug Logging for request and response including body

This commit is contained in:
Matthias Langhard
2021-06-15 11:58:40 +02:00
parent 51f464bad0
commit 14bcf19ba8
3 changed files with 52 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Net.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Novaloop.PaymoApi.Extensions;
using Novaloop.PaymoApi.Shared;
@@ -11,7 +12,7 @@ namespace Novaloop.PaymoApi.Tests
{
public static ApiClient GeneratePaymoApiClient()
{
return new ApiClient(new HttpClient {BaseAddress = new Uri("https://app.paymoapp.com/")});
return new ApiClient(new HttpClient(new LoggingHandler(new HttpClientHandler(), new NullLogger<LoggingHandler>())) {BaseAddress = new Uri("https://app.paymoapp.com/")});
}
public static IOptions<ApiOptions> GenerateOptions()