Log binary data as a parameter #2860
This commit is contained in:
parent
2a610ee1b8
commit
32532078d6
|
|
@ -66,6 +66,7 @@ namespace SampleApp
|
||||||
var hostBuilder = new WebHostBuilder()
|
var hostBuilder = new WebHostBuilder()
|
||||||
.ConfigureLogging((_, factory) =>
|
.ConfigureLogging((_, factory) =>
|
||||||
{
|
{
|
||||||
|
factory.SetMinimumLevel(LogLevel.Debug);
|
||||||
factory.AddConsole();
|
factory.AddConsole();
|
||||||
})
|
})
|
||||||
.ConfigureAppConfiguration((hostingContext, config) =>
|
.ConfigureAppConfiguration((hostingContext, config) =>
|
||||||
|
|
|
||||||
|
|
@ -174,13 +174,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
|
||||||
builder.Append(" ");
|
builder.Append(" ");
|
||||||
}
|
}
|
||||||
builder.AppendLine();
|
builder.AppendLine();
|
||||||
|
builder.Append("{0}");
|
||||||
|
|
||||||
|
var rawDataBuilder = new StringBuilder();
|
||||||
// Write the bytes as if they were ASCII
|
// Write the bytes as if they were ASCII
|
||||||
for (int i = 0; i < buffer.Length; i++)
|
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.
|
// The below APM methods call the underlying Read/WriteAsync methods which will still be logged.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue