Skip to content

Commit

Permalink
test(elasticstack): fill test settings
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicGD committed Mar 1, 2023
1 parent 466ce2b commit 6e0a6a9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/Sitko.Core.ElasticStack.Tests/ElasticStackScope.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Serilog.Sinks.Elasticsearch;
using Sitko.Core.App.Web;
using Sitko.Core.Xunit;

Expand All @@ -19,6 +20,12 @@ public ElasticStartup(IConfiguration configuration, IHostEnvironment environment

public class ElasticApplication : WebApplication<ElasticStartup>
{
public ElasticApplication(string[] args) : base(args) => this.AddElasticStack();
public ElasticApplication(string[] args) : base(args) => this.AddElasticStack(options =>
{
options.ElasticSearchUrls = new List<Uri> { new("http://localhost:9200") };
options.LoggingTemplateVersion = AutoRegisterTemplateVersion.ESv8;
options.LoggingIndexFormat = "logs-test";
options.EmitEventFailure = EmitEventFailureHandling.WriteToSelfLog | EmitEventFailureHandling.RaiseCallback;
options.FailureCallback = e => Console.WriteLine("Unable to submit event to elastic: " + e.MessageTemplate);
});
}

0 comments on commit 6e0a6a9

Please sign in to comment.