Skip to content

Commit

Permalink
ExcludedProperties - Use HashSet instead of List
Browse files Browse the repository at this point in the history
  • Loading branch information
snakefoot authored and markmcdowell committed Jan 23, 2019
1 parent 89b97b2 commit 815d9d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NLog.Targets.ElasticSearch/ElasticSearchTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace NLog.Targets.ElasticSearch
public class ElasticSearchTarget : TargetWithLayout, IElasticSearchTarget
{
private IElasticLowLevelClient _client;
private List<string> _excludedProperties = new List<string>(new[] { "CallerMemberName", "CallerFilePath", "CallerLineNumber", "MachineName", "ThreadId" });
private HashSet<string> _excludedProperties = new HashSet<string>(new[] { "CallerMemberName", "CallerFilePath", "CallerLineNumber", "MachineName", "ThreadId" });
private readonly JsonSerializerSettings _jsonSerializerSettings = CreateJsonSerializerSettings();

static JsonSerializerSettings CreateJsonSerializerSettings()
Expand Down Expand Up @@ -149,7 +149,7 @@ protected override void InitializeTarget()
_client = new ElasticLowLevelClient(config);

if (!string.IsNullOrEmpty(ExcludedProperties))
_excludedProperties = ExcludedProperties.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();
_excludedProperties = new HashSet<string>(ExcludedProperties.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
}

protected override void Write(AsyncLogEventInfo logEvent)
Expand Down

0 comments on commit 815d9d7

Please sign in to comment.