From e3f0ac477e5cc066db2f6f2618b15f015281e21c Mon Sep 17 00:00:00 2001 From: grokky1 Date: Tue, 7 Mar 2017 11:10:06 +0200 Subject: [PATCH] iis-site-name should return app name in ASP.NET Core For ASP.NET Core: IHostingEnvironment.EnvironmentName = "Development", "Production", "Staging", etc. IHostingEnvironment.ApplicationName = the app name The layout renderer for "iis-site-name" is incorrectly rendering the first instead of the second. --- .../LayoutRenderers/IISInstanceNameLayoutRenderer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NLog.Web.AspNetCore/LayoutRenderers/IISInstanceNameLayoutRenderer.cs b/NLog.Web.AspNetCore/LayoutRenderers/IISInstanceNameLayoutRenderer.cs index ae660fd4..94e9b656 100644 --- a/NLog.Web.AspNetCore/LayoutRenderers/IISInstanceNameLayoutRenderer.cs +++ b/NLog.Web.AspNetCore/LayoutRenderers/IISInstanceNameLayoutRenderer.cs @@ -36,7 +36,7 @@ protected override void Append(StringBuilder builder, LogEventInfo logEvent) #if NETSTANDARD_1plus var env = ServiceLocator.ServiceProvider?.GetService(); - builder.Append(env?.EnvironmentName); + builder.Append(env?.ApplicationName); #else builder.Append(HostingEnvironment.SiteName);