diff --git a/src/Serilog.Sinks.Elasticsearch/Sinks/ElasticSearch/ElasticSearchSink.cs b/src/Serilog.Sinks.Elasticsearch/Sinks/ElasticSearch/ElasticSearchSink.cs index fec5d5ff..a49bfe9f 100644 --- a/src/Serilog.Sinks.Elasticsearch/Sinks/ElasticSearch/ElasticSearchSink.cs +++ b/src/Serilog.Sinks.Elasticsearch/Sinks/ElasticSearch/ElasticSearchSink.cs @@ -156,7 +156,7 @@ protected virtual void HandleException(Exception ex, IEnumerable event // Helper function: checks if a given dynamic member / dictionary key exists at runtime private static bool HasProperty(dynamic settings, string name) { - if (settings is System.Dynamic.ExpandoObject) + if (settings is IDictionary) return ((IDictionary)settings).ContainsKey(name); if (settings is System.Dynamic.DynamicObject)