From ff3e7c6665c3a15365221ad296b36e6cdcdf9a9f Mon Sep 17 00:00:00 2001 From: Felix Boers Date: Thu, 5 Apr 2018 20:07:23 +0200 Subject: [PATCH] Log downstream templates in DownstreamRouteFinderMiddleware (#302) Concatenate all downstream templates separated by , (colon) in order to write them to the log. --- .../Middleware/DownstreamRouteFinderMiddleware.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Ocelot/DownstreamRouteFinder/Middleware/DownstreamRouteFinderMiddleware.cs b/src/Ocelot/DownstreamRouteFinder/Middleware/DownstreamRouteFinderMiddleware.cs index c9da50a4..0639135d 100644 --- a/src/Ocelot/DownstreamRouteFinder/Middleware/DownstreamRouteFinderMiddleware.cs +++ b/src/Ocelot/DownstreamRouteFinder/Middleware/DownstreamRouteFinderMiddleware.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using System.Linq; using Ocelot.Configuration; using Ocelot.Configuration.Provider; using Ocelot.DownstreamRouteFinder.Finder; @@ -57,10 +58,10 @@ namespace Ocelot.DownstreamRouteFinder.Middleware SetPipelineError(context, downstreamRoute.Errors); return; - } - - // todo - put this back in - //// _logger.LogDebug("downstream template is {downstreamRoute.Data.ReRoute.DownstreamPath}", downstreamRoute.Data.ReRoute.DownstreamReRoute.DownstreamPathTemplate); + } + + var downstreamPathTemplates = string.Join(", ", downstreamRoute.Data.ReRoute.DownstreamReRoute.Select(r => r.DownstreamPathTemplate.Value)); + _logger.LogDebug($"downstream templates are {downstreamPathTemplates}"); context.TemplatePlaceholderNameAndValues = downstreamRoute.Data.TemplatePlaceholderNameAndValues;