# Ambiguous reference configuring logging to ElasticCloud in Elastic.Serilog.Sinks

**URL:** <https://discuss.elastic.co/t/ambiguous-reference-configuring-logging-to-elasticcloud-in-elastic-serilog-sinks/368372>\
**Category:** Elasticsearch\
**Created:** [October 7, 2024, 7:07pm UTC](https://discuss.elastic.co/t/ambiguous-reference-configuring-logging-to-elasticcloud-in-elastic-serilog-sinks/368372 "2024-10-07T19:07:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kabcampbell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kabcampbell/32/137695_2.png) [@kabcampbell](https://discuss.elastic.co/u/kabcampbell)\
**Post date:** [October 7, 2024, 7:07pm UTC](https://discuss.elastic.co/t/ambiguous-reference-configuring-logging-to-elasticcloud-in-elastic-serilog-sinks/368372/1 "2024-10-07T19:07:55Z")

</div>

I'm following the documentation for adding the logging configuration for writing to elastic using the Elastic.Serilog.Sinks and when I try to use the logging configuration extension method xxx.WriteTo.ElasticCloud(xxxx) I get the following error:

> 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)

Is this a bug or am I configuring something incorrectly?

---

<div class="post-metadata">

**Author:** ![vboufleur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vboufleur/32/141929_2.png) [@vboufleur](https://discuss.elastic.co/u/vboufleur)\
**Post date:** [March 10, 2025, 6:44pm UTC](https://discuss.elastic.co/t/ambiguous-reference-configuring-logging-to-elasticcloud-in-elastic-serilog-sinks/368372/2 "2025-03-10T18:44:46Z")

</div>

I'm having the same error! @kabcampbell have you managed to find a fix?

---

<div class="post-metadata">

**Author:** ![kabcampbell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kabcampbell/32/137695_2.png) [@kabcampbell](https://discuss.elastic.co/u/kabcampbell)\
**Post date:** [March 10, 2025, 7:12pm UTC](https://discuss.elastic.co/t/ambiguous-reference-configuring-logging-to-elasticcloud-in-elastic-serilog-sinks/368372/3 "2025-03-10T19:12:04Z")

</div>

I wasn't able to solve the ambiguous reference with that particular method signature, however I switch to authenticating with an API key instead of a username and password and that method signature worked for me:

```auto
config.WriteTo.ElasticCloud(elasticCloudID, elasticApiKey, opts =>
{
    opts.DataStream = new Elastic.Ingest.Elasticsearch.DataStreams.DataStreamName(dataStream_Type, dataStream_DataSet, dataStream_Namespace);
});

```
