private static void ApplyLogValueResolvers(APIGatewayProxyRequest request)
 {
     LogValueResolver.Clear();
     LogValueResolver.Register <RouteTemplateEnrichment>(() => request?.Headers?.GetValueOrDefault(Constants.RouteTemplateHeader));
     LogValueResolver.Register <CorrelationIdEnrichment>(() => request?.Headers?.GetValueOrDefault(Constants.CorrelationIdHeader));
     LogValueResolver.Register <MemberIdEnrichment>(() => request?.RequestContext?.Authorizer?.Claims?.GetValueOrDefault("custom:memberid"));
     LogValueResolver.Register <UserAudienceEnrichment>(() => request?.RequestContext?.Authorizer?.Claims?.GetValueOrDefault("aud"));
     LogValueResolver.Register <RequestPathEnrichment>(() => request?.Path);
 }
        public async Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next)
        {
            var templateRoute = context.ActionDescriptor?.AttributeRouteInfo?.Template?.ToLowerInvariant();
            var proxyRequest  = (APIGatewayProxyRequest)context.HttpContext.Items[AbstractAspNetCoreFunction.LAMBDA_REQUEST_OBJECT];

            proxyRequest?.Headers?.Add(Constants.RouteTemplateHeader, templateRoute);
            LogValueResolver.Register <RouteTemplateEnrichment>(() => templateRoute);

            await next.Invoke();
        }