Additional fixes for #4604
This commit is contained in:
parent
9db92dc6a7
commit
db2d9ee56f
|
|
@ -182,7 +182,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
_objectResultExecuting = LoggerMessage.Define<string>(
|
||||
LogLevel.Information,
|
||||
1,
|
||||
"Executing ObjectResult, writing value {Value}.");
|
||||
"Executing ObjectResult, writing value of type '{Type}'.");
|
||||
|
||||
_formatterSelected = LoggerMessage.Define<IOutputFormatter, string>(
|
||||
LogLevel.Debug,
|
||||
|
|
@ -447,7 +447,8 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
{
|
||||
if (logger.IsEnabled(LogLevel.Information))
|
||||
{
|
||||
_objectResultExecuting(logger, Convert.ToString(value), null);
|
||||
var type = value == null ? "null" : value.GetType().FullName;
|
||||
_objectResultExecuting(logger, type, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
|
|||
_jsonResultExecuting = LoggerMessage.Define<string>(
|
||||
LogLevel.Information,
|
||||
1,
|
||||
"Executing JsonResult, writing value type {Value}.");
|
||||
"Executing JsonResult, writing value of type '{Type}'.");
|
||||
}
|
||||
|
||||
public static void JsonInputException(this ILogger logger, Exception exception)
|
||||
|
|
@ -32,8 +32,8 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
|
|||
|
||||
public static void JsonResultExecuting(this ILogger logger, object value)
|
||||
{
|
||||
var stringValue = value == null ? "null" : Convert.ToString(value.GetType());
|
||||
_jsonResultExecuting(logger, stringValue, null);
|
||||
var type = value == null ? "null" : value.GetType().FullName;
|
||||
_jsonResultExecuting(logger, type, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
|
|||
public async Task ExecuteAsync_NonNullResult_LogsResultType()
|
||||
{
|
||||
// Arrange
|
||||
var expected = "Executing JsonResult, writing value type System.String.";
|
||||
var expected = "Executing JsonResult, writing value of type 'System.String'.";
|
||||
var context = GetActionContext();
|
||||
var logger = new StubLogger();
|
||||
var executer = CreateExcutor(logger);
|
||||
|
|
@ -203,7 +203,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
|
|||
public async Task ExecuteAsync_NullResult_LogsNull()
|
||||
{
|
||||
// Arrange
|
||||
var expected = "Executing JsonResult, writing value type null.";
|
||||
var expected = "Executing JsonResult, writing value of type 'null'.";
|
||||
var context = GetActionContext();
|
||||
var logger = new StubLogger();
|
||||
var executer = CreateExcutor(logger);
|
||||
|
|
|
|||
Loading…
Reference in New Issue