diff --git a/Agent/Agent.cs b/Agent/Agent.cs index fc3dc5d..9ea4bf9 100644 --- a/Agent/Agent.cs +++ b/Agent/Agent.cs @@ -31,7 +31,7 @@ public virtual async Task Send(Request request) { try { - _logger?.Log(LogLevel.Debug, $"Sending request to {_requestURL}"); + _logger?.Log(LogLevel.Debug, "Sending request to {URL}", _requestURL); var response = await _httpClient.PostAsync(_requestURL, GetPostContent(request)); if (!response.IsSuccessStatusCode) { diff --git a/Agent/QueuedAgent.cs b/Agent/QueuedAgent.cs index 95ad92a..6ed9adc 100644 --- a/Agent/QueuedAgent.cs +++ b/Agent/QueuedAgent.cs @@ -56,7 +56,7 @@ public async Task PostRequests(IReadOnlyCollection requests) _sending = true; try { - _logger?.Log(LogLevel.Debug, $"Sending {requests.Count} request{(requests.Count > 1 ? "s" : "")} to {_requestURL}"); + _logger?.Log(LogLevel.Debug, "Sending {count} request{s} to {URL}", requests.Count, requests.Count > 1 ? "s" : "", _requestURL); var content = GetPostContent(requests); var response = await _httpClient.PostAsync(_requestURL, content); if (!response.IsSuccessStatusCode) @@ -65,7 +65,7 @@ public async Task PostRequests(IReadOnlyCollection requests) } _requestQueue.RemoveAll(requests.Contains); - _logger?.Log(LogLevel.Information, $"Sent {requests.Count} request{(requests.Count > 1 ? "s" : "")} to {_requestURL}"); + _logger?.Log(LogLevel.Information, "Sent {count} request{s} to {URL}", requests.Count, requests.Count > 1 ? "s" : "", _requestURL); } catch (Exception ex) {