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