-
Notifications
You must be signed in to change notification settings - Fork 196
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
Logs not writing to ElasticSearch from Xamarin Applications #134
Comments
Unfortunately, I m not experienced with Xamarin. Did you try enabling the selflog (https://github.com/serilog/serilog/wiki/Debugging-and-Diagnostics) capabilities of Serilog and see if it outputs some useful information there? |
Hello @mivano, I have enabled SelfLog and it was reporting a not implemented exception in System.Net.Http.HttpClientHandler.set_MaxConnectionsPerServer. After searching in "Issues" inside this repo, I found the solution setting ConnectionLimit to -1. Here is the updated function:
Even with these changes, my Xamarin Application is still unable to send Logs to my Elastic Server. |
After the last update on my function, suddently a bulk was sent to my Elastic Server! |
Good to see it is solved. Make sure to flush when your application closes as it might still have items in the buffer and is unable to deliver when quitting too early. |
This is still an issue. It seems like the managed Somewhere inside of Elasticsearch.NET they write: var handler = new HttpClientHandler() This means, even switching to A way to get around this is to provide your own Log.Logger = configuration
.WriteTo.Elasticsearch(
new ElasticsearchSinkOptions(esUrl)
{
ModifyConnectionSettings = c =>
{
var connection = new MyHttpConnection(handler);
var pool = new SingleNodeConnectionPool(esUrl);
return new ConnectionConfiguration(pool, connection);
}, Where |
thanks for the feedback. Maybe something to raise on the Elasticsearch repo? |
@mivano I've done that here: elastic/elasticsearch-net#3415 |
Does this issue relate to a new feature or an existing bug?
What version of Serilog.Sinks.Elasticsearch is affected? Please list the related NuGet package.
v5.5.0
What is the target framework and operating system? See target frameworks & net standard matrix.
This happens in Specific Platfom: Xamarin.Android and Xamarin.iOS.
Please describe the current behavior?
When I set the configuration from a Console Application project, this is the following code I use:
Using the same NuGet versions, I use the same code for my Xamarin Application, but it does not send any log to my Elastic's Server.
Please describe the expected behavior?
It should send the logs to Elastic, as it is working with the Console Application.
If the current behavior is a bug, please provide the steps to reproduce the issue and if possible a minimal demo of the problem
Inside a Cross-Platform project, copy the code below (where GlobalUrLs.ElasticUrl is a valid IP, such 192.168.1.20:9200):
Log some message using Serilog:
Log.Information("Testing Serilog from Xamarin Application.");
It should post the log to the server, but it does not.
The text was updated successfully, but these errors were encountered: