Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot write log via Elastic.Serilog.Sinks #463

Closed
AndriiDzendzia opened this issue Nov 21, 2024 · 5 comments · Fixed by #464
Closed

[BUG] Cannot write log via Elastic.Serilog.Sinks #463

AndriiDzendzia opened this issue Nov 21, 2024 · 5 comments · Fixed by #464
Labels
bug Something isn't working question Further information is requested

Comments

@AndriiDzendzia
Copy link

AndriiDzendzia commented Nov 21, 2024

ECS integration/library project(s) (e.g. Elastic.CommonSchema.Serilog): Elastic.Serilog.Sinks 8.12.2

ECS schema version (e.g. 1.4.0): 8.12.2

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

Elasticsearch version (if applicable): 8.16.0

.NET framework / OS: 8

Description of the problem, including expected versus actual behavior:

Observed an exception while writing to [data stream]

Steps to reproduce:

SelfLog.Enable(Console.Error);
services.AddSerilog((services, lc) => lc
.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(services.GetService()!.Transport)
{
BootstrapMethod = BootstrapMethod.Failure,
IlmPolicy = "logs-dotnet",
DataStream = new DataStreamName("logs", "dotnet", "quartz")
})
.Enrich.FromLogContext()
.MinimumLevel.Information());

Then in console, you will get the following:

2024-11-21T19:54:51.3495000Z Observed an exception while writing to [data stream]
2024-11-21T19:54:51.3496397Z System.MissingMethodException: Method not found: 'System.Threading.Tasks.Task`1<!!0> Elastic.Transport.TransportExtensions.RequestAsync(Elastic.Transport.ITransport, Elastic.Transport.HttpMethod, System.String, Elastic.Transport.PostData, Elastic.Transport.RequestParameters, System.Threading.CancellationToken)'.
   at Elastic.Ingest.Elasticsearch.ElasticsearchChannelBase`2.ExportAsync(ITransport transport, ArraySegment`1 page, CancellationToken ctx)
   at Elastic.Ingest.Transport.TransportChannelBase`4.ExportAsync(ArraySegment`1 buffer, CancellationToken ctx)
   at Elastic.Channels.BufferedChannelBase`3.ExportBufferAsync(ArraySegment`1 items, IOutboundBuffer`1 buffer)
@AndriiDzendzia AndriiDzendzia added the bug Something isn't working label Nov 21, 2024
@stevejgordon
Copy link
Contributor

@AndriiDzendzia, I suspect this may be due to changes we've made in Transport, which we have yet to pull into this library. Do you reference Elastic.Transport directly or via Elastic.Clients.Elasticsearch? If so, can you confirm which versions of those packages you have referenced?

@stevejgordon stevejgordon added the question Further information is requested label Nov 22, 2024
@AndriiDzendzia
Copy link
Author

@AndriiDzendzia, I suspect this may be due to changes we've made in Transport, which we have yet to pull into this library. Do you reference Elastic.Transport directly or via Elastic.Clients.Elasticsearch? If so, can you confirm which versions of those packages you have referenced?

Firstly, it was Elastic.Transport 0.5.2 via Elastic.Clients.Elasticsearch 8.16.0. Then, I updated it to 8.16.1 and 0.5.5, and both are installed directly.

@stevejgordon
Copy link
Contributor

Ah, okay, thanks for confirming. We'll need to publish an update to this library, taking a dependency on 0.5.5. Until then, can you stick with 8.16.0.

stevejgordon added a commit that referenced this issue Nov 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
- Updated Elastic.Clients.Elasticsearch
- Updated Elastic.Ingest.Elasticsearch
- Updated Microsoft.Extensions.Hosting in examples

Closes #463
@stevejgordon
Copy link
Contributor

@AndriiDzendzia Hopefully, 8.12.3 should fix this issue.

@AndriiDzendzia
Copy link
Author

@stevejgordon Yeah, it works. Great thanks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants