"Microsoft.Extensions.Logging.LoggerExtensions.LogError" is throwing exception
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
Code:
string SomeConstant = "Constant Value";
try
{
//Some Code
}
catch (Exception ex)
{
logger.LogError(ex, ex.Message + " {ValueOne} {ValueTwo} {ValueThree} ", SomeConstant, string.Empty, string.Empty);
return false;
}
All the required parameters for the LogError Method are passed during the function invocation.
Assembly
Microsoft.Extensions.Logging.Abstractions
Version
2.2.0.0
Thanks in advance!
Below seems work fine on my side: