Skip to content

Commit

Permalink
Updated Elasticsearch.Net to ver. 6.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
snakefoot authored and markmcdowell committed Jan 23, 2019
1 parent bc8b093 commit 89b97b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion src/NLog.Targets.ElasticSearch/ElasticSearchTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ static JsonSerializerSettings CreateJsonSerializerSettings()
/// </summary>
public bool DisableAutomaticProxyDetection { get; set; }

/// <summary>
/// Set it to true to disable use of ping to checking if node is alive
/// </summary>
public bool DisablePing { get; set; }

/// <summary>
/// Set it to true to enable HttpCompression (Must be enabled on server)
/// </summary>
public bool EnableHttpCompression { get; set; }

/// <summary>
/// Gets or sets the name of the elasticsearch index to write to.
/// </summary>
Expand Down Expand Up @@ -130,6 +140,12 @@ protected override void InitializeTarget()
if (DisableAutomaticProxyDetection)
config.DisableAutomaticProxyDetection();

if (DisablePing)
config.DisablePing();

if (EnableHttpCompression)
config.EnableHttpCompression();

_client = new ElasticLowLevelClient(config);

if (!string.IsNullOrEmpty(ExcludedProperties))
Expand All @@ -146,7 +162,7 @@ protected override void Write(IList<AsyncLogEventInfo> logEvents)
SendBatch(logEvents);
}

private void SendBatch(IList<AsyncLogEventInfo> logEvents)
private void SendBatch(ICollection<AsyncLogEventInfo> logEvents)
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Elasticsearch.Net" Version="6.0.2" />
<PackageReference Include="Elasticsearch.Net" Version="6.1.0" />
<PackageReference Include="NLog" Version="4.5.0" />
</ItemGroup>

Expand Down

0 comments on commit 89b97b2

Please sign in to comment.