diff --git a/src/DataProtection/samples/AzureKeyVault/Program.cs b/src/DataProtection/samples/AzureKeyVault/Program.cs index 7d6299f3e5..7da515fa95 100644 --- a/src/DataProtection/samples/AzureKeyVault/Program.cs +++ b/src/DataProtection/samples/AzureKeyVault/Program.cs @@ -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().Single()); @@ -34,7 +34,6 @@ namespace ConsoleApplication var serviceProvider = serviceCollection.BuildServiceProvider(); var loggerFactory = serviceProvider.GetService(); - loggerFactory.AddConsole(); var protector = serviceProvider.GetDataProtector("Test"); diff --git a/src/WebSockets/samples/EchoApp/Startup.cs b/src/WebSockets/samples/EchoApp/Startup.cs index 729716693c..1fc4caafb4 100644 --- a/src/WebSockets/samples/EchoApp/Startup.cs +++ b/src/WebSockets/samples/EchoApp/Startup.cs @@ -1,4 +1,4 @@ -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();