loki
loki copied to clipboard
fix: improve log level detection with case-insensitive matching and priority ordering
trafficstars
What this PR does / why we need it: Improves log level detection by adding case-insensitive matching, priority ordering, and better pattern matching to prevent false positives. Addresses issues where logs with capitalized levels (e.g., "Info", "Error") were missed and where substrings in service names caused incorrect categorization.
Which issue(s) this PR fixes: Fixes #18060
Special notes for your reviewer:
- Added case-insensitive matching using strings.ToLower()
- Reordered priority: FATAL → CRITICAL → ERROR → WARN → DEBUG → INFO
- Added FATAL level support for C#/.NET compatibility
- Improved pattern matching to avoid false positives like "productinformationservice"
- Added comprehensive test coverage
Checklist
- [x] Reviewed the
CONTRIBUTING.mdguide (required) - [ ] Documentation added
- [x] Tests updated
- [x] Title matches the required conventional commits format
- [ ] Changes that require user attention documented in upgrade guide
- [ ] Updated deprecated/deleted config files if applicable