diff --git a/dotnet/src/webdriver/Remote/HttpCommandExecutor.cs b/dotnet/src/webdriver/Remote/HttpCommandExecutor.cs index f529b2aa0dbf1..251c6bca78fe1 100644 --- a/dotnet/src/webdriver/Remote/HttpCommandExecutor.cs +++ b/dotnet/src/webdriver/Remote/HttpCommandExecutor.cs @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; @@ -417,7 +418,11 @@ protected override async Task SendAsync(HttpRequestMessage var responseTask = base.SendAsync(request, cancellationToken); StringBuilder requestLogMessageBuilder = new(); - requestLogMessageBuilder.AppendFormat(">> {0}", request); + requestLogMessageBuilder.AppendFormat(">> {0} RequestUri: {1}, Content: {2}, Headers: {3}", + request.Method, + request.RequestUri?.ToString() ?? "null", + request.Content?.ToString() ?? "null", + request.Headers?.Count()); if (request.Content != null) { @@ -430,7 +435,7 @@ protected override async Task SendAsync(HttpRequestMessage var response = await responseTask.ConfigureAwait(false); StringBuilder responseLogMessageBuilder = new(); - responseLogMessageBuilder.AppendFormat("<< {0}", response); + responseLogMessageBuilder.AppendFormat("<< StatusCode: {0}, ReasonPhrase: {1}, Content: {2}, Headers: {3}", (int)response.StatusCode, response.ReasonPhrase, response.Content, response.Headers?.Count()); if (!response.IsSuccessStatusCode && response.Content != null) {