ecs-dotnet icon indicating copy to clipboard operation
ecs-dotnet copied to clipboard

[BUG] - Ambiguous reference configuring logging to ElasticCloud

Open raanam opened this issue 1 year ago • 0 comments

ECS integration/library project(s) (e.g. Elastic.CommonSchema.Serilog): Elastic.Serilog.Sinks - Version - 8.12.*

ECS schema version (e.g. 1.4.0):

ECS .NET assembly version (e.g. 1.4.2):

Elasticsearch version (if applicable):

.NET framework / OS: 8

Description of the problem, including expected versus actual behavior:

Trying to configure Elastic Search Sink in following way

Log.Logger = new LoggerConfiguration() .Enrich.FromLogContext() .WriteTo.ElasticCloud("***", "***","***") .CreateLogger()

Results in following compilation error

Severity Code Description Project File Line Suppression State Error (active) CS0121 The call is ambiguous between the following methods or properties: 'ConfigSinkExtensions.ElasticCloud(LoggerSinkConfiguration, string, string, string, Action<ElasticsearchSinkOptions>?, Action<TransportConfiguration>?, LoggingLevelSwitch?, LogEventLevel)' and 'ElasticsearchSinkExtensions.ElasticCloud(LoggerSinkConfiguration, string, string, string, Action<ElasticsearchSinkOptions>?, Action<TransportConfiguration>?, LoggingLevelSwitch?, LogEventLevel)' Wellzio.TestConnectivity C:\Repositories\Wellzio\Wellzio.TestConnectivity\Wellzio.TestConnectivity\Program.cs 13

Steps to reproduce:

  1. Create a .net 8 web api project
  2. Reference Elastic.Serilog.Sinks - package - 8.12.*
  3. Configure logger as mentioned above to see compile time error This problem is also reported here - https://discuss.elastic.co/t/ambiguous-reference-configuring-logging-to-elasticcloud-in-elastic-serilog-sinks/368372

raanam avatar Oct 25 '24 12:10 raanam