elastic / elastic/ecs-dotnet

[BUG] - Ambiguous reference configuring logging to ElasticCloud

Open
#458 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
HTML
Stars
137
Forks
70
PR merge metrics
No merged PRs in 30d

Description

**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?, Action?, LoggingLevelSwitch?, LogEventLevel)' and 'ElasticsearchSinkExtensions.ElasticCloud(LoggerSinkConfiguration, string, string, string, Action?, Action?, 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.