serilog-sinks-elasticsearch icon indicating copy to clipboard operation
serilog-sinks-elasticsearch copied to clipboard

Issues with connection to elasticsearch are not visible in logs

Open dzejsien opened this issue 3 years ago • 1 comments

"Serilog.Sinks.Elasticsearch" Version="8.4.1" Elasticsearch image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3 <TargetFramework>net6.0</TargetFramework>

Configuration: .WriteTo.Elasticsearch(new(new Uri(elkUrl)) { AutoRegisterTemplate = true, IndexFormat = $"{appName.ToLower().Replace(".", "-")}-{environment.ToLower().Replace(".", "-")}-{DateTime.UtcNow:yyyy-MM}" })

Description:

I had issues with connection to elastic (lack of credentials). When I connected to pod logs, there was NO into about connection issues to elastic.

Solution: Logs about connection issues must be visible in pod logs by default. Please, if additional cfg is needed, provide info. Thanks

dzejsien avatar Feb 09 '22 10:02 dzejsien

You need to set the EmitEventFailure option, and further, make sure the Serilog self logger is configured, for example

Serilog.Debugging.SelfLog.Enable(msg => Console.WriteLine(msg));

chrismacklin avatar Aug 17 '22 23:08 chrismacklin