From 8e620f9b25e015857667c9b73636e0667c1c0017 Mon Sep 17 00:00:00 2001 From: Ross Grambo Date: Tue, 9 Jul 2024 12:15:18 -0700 Subject: [PATCH 1/2] Switching log from debug to warning --- .../TargetingHttpContextMiddleware.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.FeatureManagement.AspNetCore/TargetingHttpContextMiddleware.cs b/src/Microsoft.FeatureManagement.AspNetCore/TargetingHttpContextMiddleware.cs index 6103bfa1..8b725673 100644 --- a/src/Microsoft.FeatureManagement.AspNetCore/TargetingHttpContextMiddleware.cs +++ b/src/Microsoft.FeatureManagement.AspNetCore/TargetingHttpContextMiddleware.cs @@ -57,11 +57,11 @@ public async Task InvokeAsync(HttpContext httpContext, ITargetingContextAccessor if (activityFeature == null) { - _logger.LogDebug("The IHttpActivityFeature from the IFeatureCollection was null"); + _logger.LogWarning("The IHttpActivityFeature from the IFeatureCollection was null"); } else if (activityFeature.Activity == null) { - _logger.LogDebug("The Activity on the IHttpActivityFeature was null"); + _logger.LogWarning("The Activity on the IHttpActivityFeature was null"); } else { From bfdba17a85bc24aa9eeddbcebdab80ce6db00e23 Mon Sep 17 00:00:00 2001 From: Ross Grambo Date: Mon, 15 Jul 2024 15:13:10 -0700 Subject: [PATCH 2/2] Adjusted warning logs --- .../TargetingHttpContextMiddleware.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.FeatureManagement.AspNetCore/TargetingHttpContextMiddleware.cs b/src/Microsoft.FeatureManagement.AspNetCore/TargetingHttpContextMiddleware.cs index 8b725673..31c10573 100644 --- a/src/Microsoft.FeatureManagement.AspNetCore/TargetingHttpContextMiddleware.cs +++ b/src/Microsoft.FeatureManagement.AspNetCore/TargetingHttpContextMiddleware.cs @@ -57,11 +57,11 @@ public async Task InvokeAsync(HttpContext httpContext, ITargetingContextAccessor if (activityFeature == null) { - _logger.LogWarning("The IHttpActivityFeature from the IFeatureCollection was null"); + _logger.LogWarning("A request feature required for telemetry, IHttpActivityFeature, was not found in the request's feature collection. Removing this feature from the request's feature collection will cause telemetry emission to fail."); } else if (activityFeature.Activity == null) { - _logger.LogWarning("The Activity on the IHttpActivityFeature was null"); + _logger.LogWarning("A request feature required for telemetry, IHttpActivityFeature, has a null Activity property. If you have updated IHttpActivityFeature, ensure the Activity property is not null. A missing Activity will result in telemetry emission failures."); } else {