-
Notifications
You must be signed in to change notification settings - Fork 64
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
[FEATURE] - easier upgrade from Serilog.Sinks.Elasticsearch #413
Comments
Agreed, almost same issue here, the ElasticsearchSinkOptions class do not contain IndexFormat, ModifyConnectionSettings, AutoRegisterTemplate, CustomFormatter etc. |
So I'm not migrating from Serilog.Sinks.Elasticsearch but I'm unable to find any documentation on how to use this sink with The documentation is very sparse so I'm not sure if those features are not supported or if there just are no documented examples. I've spun up an elk stack following the documentation here https://github.com/sherifabdlnaby/elastdocker and am not finding a way to get data into it unless I use the archived sink. |
I'm trying to migrate from the deprecated Serilog.Sinks.Elasticsearch... but I have to second @runxc1 and @anit3k: Existing documentation is not really helpful for connecting to a TLS-secured selft-hosted ELK-Stack. Also, it is totally unclear to me how to go about the If you want people to use that thing "your" way, you should supply helpful and in-depth documentation and show migration examples at least for best-practice-approaches like TLS-secured connections etc... |
I did finally stumble upon the documentation below which helped me figure out how to connect but it wasn't linked in any way from the documentation on the Sink. If anyone stumbles on this here is an example showing how to use an API key, ignore a certificate or use the certificates fingerprint.
|
In the end it took less time to create a machine on a VPS hosting provider, install and configure the entire ELK stack with a self hosted certificate and configure the memory usage on the machine than it did to read through the ElasticSearch Sink documentation and figure out how to connect and push some logs up to it for testing. |
This is ridiculous... I don't want an extra ElasticSearch nuget package nor do I need it in my projects. I just want to send logentries generated by Serilog to ES. Why does that simple deed need to be so complicated and bloated? |
Many thanks for digging that up, by the way! |
As a part of the same effort, making upgrade from |
Has anyone found a way to write directly to an index? |
A reference to the client package is not needed:
Hopefully the improvements #441 and the new overloads help for more of the common use cases. |
A fallback sink is something I would love to add, currently tracked under #384 |
Writing to indices is not supported with Serilog, it is supported with NLog and Extensions.Logging. I am not opposed to adding this back in for Serilog too. Opened #447 to track this moving forward. |
Closing this as I think the listed opened issues cover the remaining pain points. Please feel free to open more issues as you find them! it really is appreciated 🙏 |
Elastic.Serilog.Sinks
Is your feature request related to a problem? Please describe.
I would like a way to move from Serilog.Sinks.Elasticsearch to Elastic.Serilog.Sinks easily using .net
Describe the solution you'd like
Current way I connect with Elastic.Serilog.Sinks is.
in Appsettings.json
"ElasticConfiguration": {
"Uri": "https://xxxxx.es.privatelink.eastus2.azure.elastic-cloud.com:443",
"Id": "21Sm3o8Bxxxxxxxx",
"ApiKey": "xxxxxxxxx"
},
Then in program.cs I currently have
string indexFormat = "MyFormatXXX";
Log.Logger = new LoggerConfiguration()
.WriteTo.Elasticsearch(ConfigureElasticSink(builder.Configuration, indexFormat))
.Enrich.WithProperty("Environment", builder.Environment.EnvironmentName)
.ReadFrom.Configuration(builder.Configuration)
.CreateLogger();
static ElasticsearchSinkOptions ConfigureElasticSink(IConfigurationRoot configuration, string indexFormat)
{
var elasticConfigurationUrl = new Uri(configuration["ElasticConfiguration:Uri"]!);
}
This allows me to have a file Sink if elastic does not work for any reason. It also allows me to log in with APIKey Authentication.
I dont think this possibility exist on Serilog.Sinks.Elasticsearch. if it does please update documentation
The text was updated successfully, but these errors were encountered: