diff --git a/test/LocalizationWebsite/Program.cs b/test/LocalizationWebsite/Program.cs index 39c511fbca..7975594760 100644 --- a/test/LocalizationWebsite/Program.cs +++ b/test/LocalizationWebsite/Program.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; namespace LocalizationWebsite { @@ -15,6 +16,11 @@ namespace LocalizationWebsite .Build(); var host = new WebHostBuilder() + .ConfigureLogging((_, factory) => + { + factory.AddConsole(); + factory.AddFilter("Console", level => level >= LogLevel.Warning); + }) .UseKestrel() .UseConfiguration(config) .UseStartup("LocalizationWebsite") diff --git a/test/LocalizationWebsite/StartupResourcesAtRootFolder.cs b/test/LocalizationWebsite/StartupResourcesAtRootFolder.cs index 47a9e32c88..2d54c02c33 100644 --- a/test/LocalizationWebsite/StartupResourcesAtRootFolder.cs +++ b/test/LocalizationWebsite/StartupResourcesAtRootFolder.cs @@ -1,5 +1,5 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Globalization; @@ -28,8 +28,6 @@ namespace LocalizationWebsite IStringLocalizer startupStringLocalizer, IStringLocalizer customerStringLocalizer) { - loggerFactory.AddConsole(minLevel: LogLevel.Warning); - app.UseRequestLocalization(new RequestLocalizationOptions { DefaultRequestCulture = new RequestCulture("en-US"), diff --git a/test/LocalizationWebsite/StartupResourcesInClassLibrary.cs b/test/LocalizationWebsite/StartupResourcesInClassLibrary.cs index 2f4c42850b..092d09a37b 100644 --- a/test/LocalizationWebsite/StartupResourcesInClassLibrary.cs +++ b/test/LocalizationWebsite/StartupResourcesInClassLibrary.cs @@ -1,5 +1,5 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Globalization; @@ -25,8 +25,6 @@ namespace LocalizationWebsite ILoggerFactory loggerFactory, IStringLocalizerFactory stringLocalizerFactory) { - loggerFactory.AddConsole(minLevel: LogLevel.Warning); - var supportedCultures = new List() { new CultureInfo("en-US"), diff --git a/test/LocalizationWebsite/StartupResourcesInFolder.cs b/test/LocalizationWebsite/StartupResourcesInFolder.cs index 36cc27e927..d4c4f9e028 100644 --- a/test/LocalizationWebsite/StartupResourcesInFolder.cs +++ b/test/LocalizationWebsite/StartupResourcesInFolder.cs @@ -1,5 +1,5 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Globalization; @@ -31,8 +31,6 @@ namespace LocalizationWebsite // Namely that english was always being returned if it existed. IStringLocalizer customCultureLocalizer) { - loggerFactory.AddConsole(minLevel: LogLevel.Warning); - app.UseRequestLocalization(new RequestLocalizationOptions { DefaultRequestCulture = new RequestCulture("en-US"),