Open HeikoWrede opened 1 month ago
Elastic.Extensions.Logging (NuGet v8.11.1 dotnet 8):
Steps to reproduce:
<PackageReference Include="Elastic.Extensions.Logging" Version="8.11.1" />
string apiKeyString = "cGo5c0I1 -- MY VALID API KEY -- FVEQzBDUQ=="; Uri[] nodeUris = [new("https://localhost:9200")]; TransportConfiguration transportConfiguration = new TransportConfiguration(new StaticNodePool(nodeUris)) .ServerCertificateValidationCallback((_, _, _, _) => true) .Authentication(new ApiKey(apiKeyString)) .OnRequestDataCreated(details => { Console.WriteLine($"OnRequestDataCreated > {details}"); }) .OnRequestCompleted(details => { Console.WriteLine($"OnRequestCompleted > {details}"); }); ILoggerFactory loggerFactory = LoggerFactory.Create(builder => { builder.SetMinimumLevel(LogLevel.Trace); builder.AddConsole(); builder.AddElasticsearch(c => { c.IsEnabled = true; //c.BootstrapMethod = BootstrapMethod.Failure; c.Transport = new DistributedTransport(transportConfiguration); c.DataStream = new DataStreamNameOptions { Type = "logs", DataSet = "myapp", Namespace = "test" }; //c.Index = new IndexNameOptions { Format = "logs-myapp-test"}; }); }); ILogger logger = loggerFactory.CreateLogger<Program>(); logger.LogInformation("Logging information.");
Console Output is:
info: ElasticClient.Program[0] Logging information.
That should work, right?
But no message arrives at Kibana and I'm missing output from OnRequestDataCreated.
Is there something wrong with my code or is there a but at Elastic.Extensions.Logging ?
I would appreciate any help
Elastic.Extensions.Logging (NuGet v8.11.1 dotnet 8):
Steps to reproduce:
<PackageReference Include="Elastic.Extensions.Logging" Version="8.11.1" />
Console Output is:
That should work, right?
But no message arrives at Kibana and I'm missing output from OnRequestDataCreated.
Is there something wrong with my code or is there a but at Elastic.Extensions.Logging ?
I would appreciate any help