Kittyfisto / Tailviewer

Open source log file viewer
https://kittyfisto.github.io/Tailviewer/
MIT License
182 stars 38 forks source link

Tailviewer should apply better heuristics to guestimate the log level of a log entry #360

Open Kittyfisto opened 1 year ago

Kittyfisto commented 1 year ago

Current behaviour

Tailviewer applies heuristics to guess the log level of a log entry by searching for very specific strings, namely those that fit the log levels written by log4net (which is the logging framework of choice I use of the time). This is beneficial for myself, but not really beneficial for everyone else that happens to use a different logging framework which happens to use different phrases for the same (or similar) log levels.

At the moment, log levels are only matched if the phrases "FATAL", "ERROR", "WARN", "INFO", "DEBUG" or "TRACE" are found. Any other casing or similar phrases are not matched (for example Error is not detected as error, as mentioned here #350).

Expected behaviour

Tailviewer should, by default, recognize log levels written by many log frameworks, not just log4net. This should at least include the log frameworks that were requested in other issues / discussions, but shouldn't be limited to just those. Obviously there are going to be cases where any heuristic couldn't reasonable make a decision, but it most certainly can be extended to include more than just the limited scope right now.

The following (non exhaustive) list of frameworks should be supported too (where sensible):

Steps to reproduce the problem

Open any log file which uses non capital-letter log levels.