Skip to content

Commit bf4102b

Browse files
authored
fix: Reduce exception logging on CallVendorApi failures. Resolves #2005 (#2006)
1 parent 2dad8e0 commit bf4102b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Agent/NewRelic/Agent/Core/Utilization/VendorHttpApiRequestor.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,19 @@ public virtual string CallVendorApi(Uri uri, string method, string vendorName, I
4949
{
5050
var statusCode = response.StatusCode.ToString() ?? string.Empty;
5151
var statusDescription = response.StatusDescription ?? string.Empty;
52-
Log.Debug(ex, "CallVendorApi ({0}) failed with WebException with status: {1}; message: {2}", vendorName, statusCode, statusDescription);
52+
// intentionally not passing the exception parameter here
53+
Log.Debug("CallVendorApi ({0}) failed with WebException with status: {1}; message: {2}", vendorName, statusCode, statusDescription);
5354
}
5455
else
5556
{
56-
Log.Debug(ex, "CallVendorApi ({0}) failed", vendorName);
57+
// intentionally not passing the exception parameter here
58+
Log.Debug($"CallVendorApi ({{0}}) failed: {ex.Message}", vendorName);
5759
}
5860
}
5961
else
6062
{
61-
Log.Debug(ex, "CallVendorApi ({0}) failed", vendorName);
63+
// intentionally not passing the exception parameter here
64+
Log.Debug($"CallVendorApi ({{0}}) failed: {ex.Message}", vendorName);
6265
}
6366
return null;
6467
}

0 commit comments

Comments
 (0)