зеркало из https://github.com/dotnet/aspnetcore.git
Log binary data as a parameter #2860
This commit is contained in:
Родитель
2a610ee1b8
Коммит
32532078d6
|
@ -66,6 +66,7 @@ namespace SampleApp
|
|||
var hostBuilder = new WebHostBuilder()
|
||||
.ConfigureLogging((_, factory) =>
|
||||
{
|
||||
factory.SetMinimumLevel(LogLevel.Debug);
|
||||
factory.AddConsole();
|
||||
})
|
||||
.ConfigureAppConfiguration((hostingContext, config) =>
|
||||
|
|
|
@ -174,13 +174,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
|
|||
builder.Append(" ");
|
||||
}
|
||||
builder.AppendLine();
|
||||
builder.Append("{0}");
|
||||
|
||||
var rawDataBuilder = new StringBuilder();
|
||||
// Write the bytes as if they were ASCII
|
||||
for (int i = 0; i < buffer.Length; i++)
|
||||
{
|
||||
builder.Append((char)buffer[i]);
|
||||
rawDataBuilder.Append((char)buffer[i]);
|
||||
}
|
||||
|
||||
_logger.LogDebug(builder.ToString());
|
||||
_logger.LogDebug(builder.ToString(), rawDataBuilder.ToString());
|
||||
}
|
||||
|
||||
// The below APM methods call the underlying Read/WriteAsync methods which will still be logged.
|
||||
|
|
Загрузка…
Ссылка в новой задаче