Remove obsolete logging API usage (#3953)
This commit is contained in:
parent
7ef549416f
commit
9d570d791f
|
|
@ -26,7 +26,7 @@ namespace ConsoleApplication
|
||||||
var cert = store.Certificates.Find(X509FindType.FindByThumbprint, config["CertificateThumbprint"], false);
|
var cert = store.Certificates.Find(X509FindType.FindByThumbprint, config["CertificateThumbprint"], false);
|
||||||
|
|
||||||
var serviceCollection = new ServiceCollection();
|
var serviceCollection = new ServiceCollection();
|
||||||
serviceCollection.AddLogging();
|
serviceCollection.AddLogging(loggingBuilder => loggingBuilder.AddConsole());
|
||||||
serviceCollection.AddDataProtection()
|
serviceCollection.AddDataProtection()
|
||||||
.PersistKeysToFileSystem(new DirectoryInfo("."))
|
.PersistKeysToFileSystem(new DirectoryInfo("."))
|
||||||
.ProtectKeysWithAzureKeyVault(config["KeyId"], config["ClientId"], cert.OfType<X509Certificate2>().Single());
|
.ProtectKeysWithAzureKeyVault(config["KeyId"], config["ClientId"], cert.OfType<X509Certificate2>().Single());
|
||||||
|
|
@ -34,7 +34,6 @@ namespace ConsoleApplication
|
||||||
var serviceProvider = serviceCollection.BuildServiceProvider();
|
var serviceProvider = serviceCollection.BuildServiceProvider();
|
||||||
|
|
||||||
var loggerFactory = serviceProvider.GetService<ILoggerFactory>();
|
var loggerFactory = serviceProvider.GetService<ILoggerFactory>();
|
||||||
loggerFactory.AddConsole();
|
|
||||||
|
|
||||||
var protector = serviceProvider.GetDataProtector("Test");
|
var protector = serviceProvider.GetDataProtector("Test");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.WebSockets;
|
using System.Net.WebSockets;
|
||||||
|
|
@ -19,13 +19,12 @@ namespace EchoApp
|
||||||
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
|
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
|
services.AddLogging(builder => builder.AddConsole());
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
||||||
{
|
{
|
||||||
loggerFactory.AddConsole(LogLevel.Debug);
|
|
||||||
|
|
||||||
if (env.IsDevelopment())
|
if (env.IsDevelopment())
|
||||||
{
|
{
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue