diff --git a/src/NLog.Extensions.Logging/Logging/NLogLogger.cs b/src/NLog.Extensions.Logging/Logging/NLogLogger.cs index e008e7b4..2b555d22 100644 --- a/src/NLog.Extensions.Logging/Logging/NLogLogger.cs +++ b/src/NLog.Extensions.Logging/Logging/NLogLogger.cs @@ -52,7 +52,7 @@ public void Log(Microsoft.Extensions.Logging.LogLevel logLevel, EventId private LogEventInfo CreateLogEventInfo(LogLevel nLogLogLevel, EventId eventId, TState state, Exception exception, Func formatter) { - if ((_options.CaptureMessageTemplates || _options.CaptureMessageProperties) && state is IReadOnlyList> messagePropertyList) + if (_options.CaptureMessageProperties && state is IReadOnlyList> messagePropertyList) { if (_options.CaptureMessageTemplates) { @@ -181,7 +181,7 @@ private static bool AllParameterCorrectlyPositionalMapped(NLogMessageParameterLi for (int i = 0; i < messageTemplateParameters.Count; ++i) { - if (!messageParameters[i].Name.Equals(messageTemplateParameters[i].Name)) + if (!messageParameters[i].Name.Equals(messageTemplateParameters[i].Name, StringComparison.Ordinal)) { return false; } @@ -204,7 +204,7 @@ private static object[] CreateStructuredLogEventInfoParameters(NLogMessageParame bool extraProperty = true; for (int j = startPos; j < messageTemplateParameters.Count; ++j) { - if (propertyName.Equals(messageTemplateParameters[j].Name)) + if (propertyName.Equals(messageTemplateParameters[j].Name, StringComparison.Ordinal)) { extraProperty = false; paramsArray[j] = messageParameters[i].Value;