[FEATURE]
- 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)**:
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I want a migration guide from Serilog.Sinks.Elasticsearch where we use a in house ElasticSerch server. We configyre the UR and an IndexFormat
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
I want our new implementation write loggs to the server as the old one did
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
The old implementation:
```
public class FastProLogger : IFastProLogger
{
private readonly ILogger _seriLogger;
public FastProLogger(IConfiguration configuration)
{
string elasticSearchIndexFormat = configuration["ElasticSearch:IndexFormat"] ?? throw new ApplicationException($"Konfiguration för ElasticSearch:Uri saknas");
string unused = configuration["Logging:LoggDumpFilePath"] ?? throw new ApplicationException($"Konfiguration för Logging:LoggDumpFilePath saknas");
string elasticSearchUri = configuration["ElasticSearch:Uri"] ?? throw new ApplicationException($"Konfiguration för ElasticSearch:Uri saknas");
IConfigurationSection section = configuration.GetSection("ElasticSearch:IndexFormat");
string? sectionValue = section.Value;
ElasticsearchSinkOptions options = new(new Uri(elasticSearchUri))
{
AutoRegisterTemplate = false, // we do not appear to have enough access rights to register templates
AutoRegisterTemplateVersion = AutoRegisterTemplateVersion.ESv6,
IndexFormat = elasticSearchIndexFormat,
EmitEventFailure = EmitEventFailureHandling.ThrowException,
RegisterTemplateFailure = RegisterTemplateRecovery.FailSink,
CustomFormatter = new ElasticsearchJsonFormatter()
};
_seriLogger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Elasticsearch(options)
.CreateLogger();
}
public void Debug(string messageTemplate, params object[] propertyValues)
{
_seriLogger.Debug(messageTemplate, propertyValues);
}
...
}
```
Contributor guide
Research direction
No target documentation file or test is named. Start by reviewing the ECS integration/library documentation and the existing Serilog.Sinks.Elasticsearch configuration in the issue, then identify where a migration guide belongs. Done means documenting how the new implementation maps the old URI, IndexFormat, template, formatter, and failure-handling settings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, elasticsearch
- Domain
- backend, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100