React to Logging API changes

This commit is contained in:
BrennanConroy 2017-04-28 08:34:33 -07:00
parent 48519857d2
commit 1f0089f827
4 changed files with 12 additions and 12 deletions

View File

@ -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")

View File

@ -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<StartupResourcesAtRootFolder> startupStringLocalizer,
IStringLocalizer<Customer> customerStringLocalizer)
{
loggerFactory.AddConsole(minLevel: LogLevel.Warning);
app.UseRequestLocalization(new RequestLocalizationOptions
{
DefaultRequestCulture = new RequestCulture("en-US"),

View File

@ -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<CultureInfo>()
{
new CultureInfo("en-US"),

View File

@ -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<StartupCustomCulturePreserved> customCultureLocalizer)
{
loggerFactory.AddConsole(minLevel: LogLevel.Warning);
app.UseRequestLocalization(new RequestLocalizationOptions
{
DefaultRequestCulture = new RequestCulture("en-US"),