Merge branch 'rel/2.0.0-preview1' into dev

This commit is contained in:
BrennanConroy 2017-05-03 10:39:46 -07:00
commit e96096e760
11 changed files with 38 additions and 23 deletions

View File

@ -7,6 +7,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.SignalR.Test.Server namespace Microsoft.AspNetCore.SignalR.Test.Server
{ {
@ -15,6 +16,12 @@ namespace Microsoft.AspNetCore.SignalR.Test.Server
public static void Main(string[] args) public static void Main(string[] args)
{ {
var host = new WebHostBuilder() var host = new WebHostBuilder()
.ConfigureLogging(factory =>
{
factory.AddConsole();
factory.AddFilter("Console", level => level >= LogLevel.Information);
factory.AddDebug();
})
.UseKestrel() .UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration() .UseIISIntegration()

View File

@ -17,11 +17,8 @@ namespace Microsoft.AspNetCore.SignalR.Test.Server
services.AddEndPoint<EchoEndPoint>(); services.AddEndPoint<EchoEndPoint>();
} }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{ {
loggerFactory.AddConsole();
loggerFactory.AddDebug(LogLevel.Trace);
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();

View File

@ -3,6 +3,7 @@
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Logging;
namespace ChatSample namespace ChatSample
{ {
@ -11,6 +12,12 @@ namespace ChatSample
public static void Main(string[] args) public static void Main(string[] args)
{ {
var host = new WebHostBuilder() var host = new WebHostBuilder()
.ConfigureLogging((context, factory) =>
{
factory.UseConfiguration(context.Configuration.GetSection("Logging"));
factory.AddConsole();
factory.AddDebug();
})
.UseKestrel() .UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration() .UseIISIntegration()

View File

@ -13,7 +13,6 @@ using Microsoft.AspNetCore.SignalR.Redis;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace ChatSample namespace ChatSample
{ {
@ -74,11 +73,8 @@ namespace ChatSample
} }
// 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)
{ {
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();

View File

@ -1,12 +1,9 @@
// 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;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Logging;
namespace SocialWeather namespace SocialWeather
{ {
@ -15,6 +12,11 @@ namespace SocialWeather
public static void Main(string[] args) public static void Main(string[] args)
{ {
var host = new WebHostBuilder() var host = new WebHostBuilder()
.ConfigureLogging(factory =>
{
factory.AddConsole();
factory.AddFilter("Console", level => level >= LogLevel.Information);
})
.UseKestrel() .UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration() .UseIISIntegration()

View File

@ -25,10 +25,8 @@ namespace SocialWeather
services.AddSingleton<FormatterResolver>(); services.AddSingleton<FormatterResolver>();
} }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{ {
loggerFactory.AddConsole();
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();

View File

@ -4,6 +4,7 @@
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace SocketsSample namespace SocketsSample
{ {
@ -17,6 +18,10 @@ namespace SocketsSample
var host = new WebHostBuilder() var host = new WebHostBuilder()
.UseConfiguration(config) .UseConfiguration(config)
.ConfigureLogging(factory =>
{
factory.AddConsole();
})
.UseKestrel() .UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration() .UseIISIntegration()

View File

@ -36,10 +36,8 @@ namespace SocketsSample
} }
// 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)
{ {
loggerFactory.AddConsole(LogLevel.Trace);
app.UseFileServer(); app.UseFileServer();
if (env.IsDevelopment()) if (env.IsDevelopment())

View File

@ -176,8 +176,9 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
private static LoggerFactory CreateLogger() private static LoggerFactory CreateLogger()
{ {
var loggerFactory = new LoggerFactory(); var loggerFactory = new LoggerFactory();
loggerFactory.AddConsole(_verbose ? LogLevel.Trace : LogLevel.Error); loggerFactory.AddConsole();
loggerFactory.AddDebug(LogLevel.Trace); loggerFactory.AddFilter("Console", level => level >= (_verbose ? LogLevel.Trace : LogLevel.Error));
loggerFactory.AddDebug();
return loggerFactory; return loggerFactory;
} }

View File

@ -4,6 +4,7 @@
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace WebSocketsTestApp namespace WebSocketsTestApp
{ {
@ -17,6 +18,11 @@ namespace WebSocketsTestApp
var host = new WebHostBuilder() var host = new WebHostBuilder()
.UseConfiguration(config) .UseConfiguration(config)
.ConfigureLogging(factory =>
{
factory.AddConsole();
factory.AddFilter("Console", level => level >= LogLevel.Debug);
})
.UseKestrel() .UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration() .UseIISIntegration()

View File

@ -26,8 +26,6 @@ namespace WebSocketsTestApp
// 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, PipeFactory PipeFactory) public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, PipeFactory PipeFactory)
{ {
loggerFactory.AddConsole(LogLevel.Debug);
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();