Repository navigation
feat(elasticsearch): ReplicasAfterRollover and MinimumLevelOverrides options - #35
Merged
Merged
Conversation
…options Two opt-in SwLogger settings to keep log volume within the cluster: - ElasticsearchReplicasAfterRollover adds a warm phase to the managed retention policy that sets the replica count right after a monthly rollover (migrate disabled: the clusters have no warm tier). The index being written keeps its replicas. - MinimumLevelOverrides sets per-source minimum levels from configuration, e.g. Microsoft.EntityFrameworkCore at Warning, which the Elasticsearch logger had no way to do (the console logger already hardcodes it). Unset, both leave behaviour unchanged.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
mmalkhatib
approved these changes
Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The shared Elastic cluster filled to 94% (flood stage), turning 159 indices read-only for ~27h: app logs were lost and audit writes failed. Online-selling's production app logs alone were 392 GB — mostly one EF Core
Executed DbCommandline per query — and every index kept a replica.Two opt-in
SwLoggersettings (unset = no behaviour change for other apps):ElasticsearchReplicasAfterRollover— adds awarmphase to the managed retention policy:allocate.number_of_replicasright after the monthly rollover, withmigratedisabled (no warm tier on these clusters). The index being written keeps its replicas, so node restarts don't stop logging.MinimumLevelOverrides— per-source minimum levels from configuration, e.g.{ "Microsoft.EntityFrameworkCore": 3 }. The Elasticsearch logger had no way to do this; the console logger already hardcodes EF Core/AspNetCore to Warning.Tests: 5 new (policy JSON with/without the warm phase, negative value ignored, overrides filter only the configured source). Full suite 25 passed. The new policy shape was also validated against the cluster (ES 9.0.1) with a throwaway policy, since deleted.
README documents both options. Publishes 8.1.x on merge.