This commit is contained in:
parent
b8423b8530
commit
a7e412ec80
|
|
@ -18,7 +18,7 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static ListenOptions UseConnectionLogging(this ListenOptions listenOptions)
|
public static ListenOptions UseConnectionLogging(this ListenOptions listenOptions)
|
||||||
{
|
{
|
||||||
return listenOptions.UseConnectionLogging(nameof(LoggingConnectionAdapter));
|
return listenOptions.UseConnectionLogging(loggerName: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
public static ListenOptions UseConnectionLogging(this ListenOptions listenOptions, string loggerName)
|
public static ListenOptions UseConnectionLogging(this ListenOptions listenOptions, string loggerName)
|
||||||
{
|
{
|
||||||
var loggerFactory = listenOptions.KestrelServerOptions.ApplicationServices.GetRequiredService<ILoggerFactory>();
|
var loggerFactory = listenOptions.KestrelServerOptions.ApplicationServices.GetRequiredService<ILoggerFactory>();
|
||||||
var logger = loggerFactory.CreateLogger(loggerName ?? nameof(LoggingConnectionAdapter));
|
var logger = loggerName == null ? loggerFactory.CreateLogger<LoggingConnectionAdapter>() : loggerFactory.CreateLogger(loggerName);
|
||||||
listenOptions.ConnectionAdapters.Add(new LoggingConnectionAdapter(logger));
|
listenOptions.ConnectionAdapters.Add(new LoggingConnectionAdapter(logger));
|
||||||
return listenOptions;
|
return listenOptions;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal
|
||||||
}
|
}
|
||||||
|
|
||||||
_options = options;
|
_options = options;
|
||||||
_logger = loggerFactory?.CreateLogger(nameof(HttpsConnectionAdapter));
|
_logger = loggerFactory?.CreateLogger<HttpsConnectionAdapter>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsHttps => true;
|
public bool IsHttps => true;
|
||||||
|
|
|
||||||
|
|
@ -385,7 +385,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
|
||||||
|
|
||||||
public ILogger CreateLogger(string categoryName)
|
public ILogger CreateLogger(string categoryName)
|
||||||
{
|
{
|
||||||
if (categoryName == nameof(HttpsConnectionAdapter))
|
if (categoryName == TypeNameHelper.GetTypeDisplayName(typeof(HttpsConnectionAdapter)))
|
||||||
{
|
{
|
||||||
return FilterLogger;
|
return FilterLogger;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue