React to Logging API changes
This commit is contained in:
parent
48519857d2
commit
1f0089f827
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace LocalizationWebsite
|
namespace LocalizationWebsite
|
||||||
{
|
{
|
||||||
|
|
@ -15,6 +16,11 @@ namespace LocalizationWebsite
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
var host = new WebHostBuilder()
|
var host = new WebHostBuilder()
|
||||||
|
.ConfigureLogging((_, factory) =>
|
||||||
|
{
|
||||||
|
factory.AddConsole();
|
||||||
|
factory.AddFilter("Console", level => level >= LogLevel.Warning);
|
||||||
|
})
|
||||||
.UseKestrel()
|
.UseKestrel()
|
||||||
.UseConfiguration(config)
|
.UseConfiguration(config)
|
||||||
.UseStartup("LocalizationWebsite")
|
.UseStartup("LocalizationWebsite")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// 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.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
@ -28,8 +28,6 @@ namespace LocalizationWebsite
|
||||||
IStringLocalizer<StartupResourcesAtRootFolder> startupStringLocalizer,
|
IStringLocalizer<StartupResourcesAtRootFolder> startupStringLocalizer,
|
||||||
IStringLocalizer<Customer> customerStringLocalizer)
|
IStringLocalizer<Customer> customerStringLocalizer)
|
||||||
{
|
{
|
||||||
loggerFactory.AddConsole(minLevel: LogLevel.Warning);
|
|
||||||
|
|
||||||
app.UseRequestLocalization(new RequestLocalizationOptions
|
app.UseRequestLocalization(new RequestLocalizationOptions
|
||||||
{
|
{
|
||||||
DefaultRequestCulture = new RequestCulture("en-US"),
|
DefaultRequestCulture = new RequestCulture("en-US"),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// 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.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
@ -25,8 +25,6 @@ namespace LocalizationWebsite
|
||||||
ILoggerFactory loggerFactory,
|
ILoggerFactory loggerFactory,
|
||||||
IStringLocalizerFactory stringLocalizerFactory)
|
IStringLocalizerFactory stringLocalizerFactory)
|
||||||
{
|
{
|
||||||
loggerFactory.AddConsole(minLevel: LogLevel.Warning);
|
|
||||||
|
|
||||||
var supportedCultures = new List<CultureInfo>()
|
var supportedCultures = new List<CultureInfo>()
|
||||||
{
|
{
|
||||||
new CultureInfo("en-US"),
|
new CultureInfo("en-US"),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// 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.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
@ -31,8 +31,6 @@ namespace LocalizationWebsite
|
||||||
// Namely that english was always being returned if it existed.
|
// Namely that english was always being returned if it existed.
|
||||||
IStringLocalizer<StartupCustomCulturePreserved> customCultureLocalizer)
|
IStringLocalizer<StartupCustomCulturePreserved> customCultureLocalizer)
|
||||||
{
|
{
|
||||||
loggerFactory.AddConsole(minLevel: LogLevel.Warning);
|
|
||||||
|
|
||||||
app.UseRequestLocalization(new RequestLocalizationOptions
|
app.UseRequestLocalization(new RequestLocalizationOptions
|
||||||
{
|
{
|
||||||
DefaultRequestCulture = new RequestCulture("en-US"),
|
DefaultRequestCulture = new RequestCulture("en-US"),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue