Analyzing memory dump of app we have problems with I noticed
Number of exceptions of this type: 23
Exception MethodTable: 79308b54
Exception object: 017f3f60
Exception type: System.ArgumentNullException
Message: Key cannot be null.
SP IP Function
2FF3B33C 7AAB29F7 System.Collections.Specialized.HybridDictionary.get_Item(System.Object)
2FF3B34C 24F53A3F NLog.LayoutRenderers.EventContextLayoutRenderer.Append(System.Text.StringBuilder, NLog.LogEventInfo)
2FF3B360 24F52DD3 NLog.Layout.GetFormattedMessage(NLog.LogEventInfo)
But logging seems to be working. Has anyone seen those exceptions? I'm not even sure I should care about them. Maybe that's something internal that just throws and catches/handles it.
Ok. I think I know what it is. We don't set all the parameters in MDC every time probably. How bad is this. Sometimes we can't set them because we don't have them. So should I care? Shouldn't NLog check if item in MDC exist instead of reading it and receiving exception (if that's what it happens)