Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Commit ad06589

Browse files
committed
[Fixes #4575] Logging ArgumentOutOfRangeException
1 parent 7b2fdcb commit ad06589

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Microsoft.AspNetCore.Mvc.Core/Internal/MvcCoreLoggerExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ internal static class MvcCoreLoggerExtensions
5353
private static readonly Action<ILogger, string, Exception> _noFormatter;
5454
private static readonly Action<ILogger, IOutputFormatter, string, Exception> _formatterSelected;
5555
private static readonly Action<ILogger, string, Exception> _skippedContentNegotiation;
56-
private static readonly Action<ILogger, string, Exception> _noAcceptForNegotiation;
56+
private static readonly Action<ILogger, Exception> _noAcceptForNegotiation;
5757
private static readonly Action<ILogger, IEnumerable<MediaTypeSegmentWithQuality>, Exception> _noFormatterFromNegotiation;
5858

5959
private static readonly Action<ILogger, string, Exception> _redirectResultExecuting;
@@ -174,7 +174,7 @@ static MvcCoreLoggerExtensions()
174174
3,
175175
"Skipped content negotiation as content type '{ContentType}' is explicitly set for the response.");
176176

177-
_noAcceptForNegotiation = LoggerMessage.Define<string>(
177+
_noAcceptForNegotiation = LoggerMessage.Define(
178178
LogLevel.Debug,
179179
4,
180180
"No information found on request to perform content negotiation.");
@@ -369,7 +369,7 @@ public static void SkippedContentNegotiation(this ILogger logger, string content
369369

370370
public static void NoAcceptForNegotiation(this ILogger logger)
371371
{
372-
_noAcceptForNegotiation(logger, null, null);
372+
_noAcceptForNegotiation(logger, null);
373373
}
374374

375375
public static void NoFormatterFromNegotiation(this ILogger logger, IList<MediaTypeSegmentWithQuality> acceptTypes)

src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/MvcJsonLoggerExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
88
{
99
internal static class MvcJsonLoggerExtensions
1010
{
11-
private static readonly Action<ILogger, string, Exception> _jsonInputFormatterCrashed;
11+
private static readonly Action<ILogger, Exception> _jsonInputFormatterCrashed;
1212

1313
private static readonly Action<ILogger, string, Exception> _jsonResultExecuting;
1414

1515
static MvcJsonLoggerExtensions()
1616
{
17-
_jsonInputFormatterCrashed = LoggerMessage.Define<string>(
17+
_jsonInputFormatterCrashed = LoggerMessage.Define(
1818
LogLevel.Debug,
1919
1,
2020
"JSON input formatter threw an exception.");
@@ -27,7 +27,7 @@ static MvcJsonLoggerExtensions()
2727

2828
public static void JsonInputException(this ILogger logger, Exception exception)
2929
{
30-
_jsonInputFormatterCrashed(logger, exception.ToString(), exception);
30+
_jsonInputFormatterCrashed(logger, exception);
3131
}
3232

3333
public static void JsonResultExecuting(this ILogger logger, object value)

0 commit comments

Comments
 (0)