loki icon indicating copy to clipboard operation
loki copied to clipboard

fix: improve log level detection with case-insensitive matching and priority ordering

Open SwanHtetAungPhyo opened this issue 5 months ago • 1 comments
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.md guide (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

SwanHtetAungPhyo avatar Jun 16 '25 06:06 SwanHtetAungPhyo

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 16 '25 06:06 CLAassistant