Skip to content
代码片段 群组 项目
未验证 提交 9d570d79 编辑于 作者: Pavel Krymets's avatar Pavel Krymets 提交者: GitHub
浏览文件

Remove obsolete logging API usage (#3953)

上级 7ef54941
No related branches found
No related tags found
无相关合并请求
......@@ -26,7 +26,7 @@ namespace ConsoleApplication
var cert = store.Certificates.Find(X509FindType.FindByThumbprint, config["CertificateThumbprint"], false);
var serviceCollection = new ServiceCollection();
serviceCollection.AddLogging();
serviceCollection.AddLogging(loggingBuilder => loggingBuilder.AddConsole());
serviceCollection.AddDataProtection()
.PersistKeysToFileSystem(new DirectoryInfo("."))
.ProtectKeysWithAzureKeyVault(config["KeyId"], config["ClientId"], cert.OfType<X509Certificate2>().Single());
......@@ -34,7 +34,6 @@ namespace ConsoleApplication
var serviceProvider = serviceCollection.BuildServiceProvider();
var loggerFactory = serviceProvider.GetService<ILoggerFactory>();
loggerFactory.AddConsole();
var protector = serviceProvider.GetDataProtector("Test");
......
using System;
using System;
using System.Collections.Generic;
using System.Linq;
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
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.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(LogLevel.Debug);
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册