kizniche / Mycodo

An environmental monitoring and regulation system
http://kylegabriel.com/projects/
GNU General Public License v3.0
2.95k stars 494 forks source link

Have live logs monitoring with filtering and option for logging only changes #1210

Open lalebarde opened 2 years ago

lalebarde commented 2 years ago

When I debug, I use Mycodo logs, but I have to freshen them often, and many events are useless. At present time, logs run as the following Linux command, with only the choice of the number of lines and the source:

tail -300

I would like a live logs monitoring with regexp filtering, like in:

tail -<number of lines> -f <filename> | grep <keyword or pattern>

I recall the effect: when a new logged event occur, the disply is updated with the new log line automatically.

Also, it would be nice to be able to associate a log description with a value as in a python dictionnary. For example "tank full":True So instead of the today one parameter (string) logger:

self.logger.info(f"Measurement = {value}")

Use two parameters like in a pair the second one being optional to keep today behaviour):

self.logger.info("Measurement", value)

and enable an option selectable via a checkbox to log only changes.

The desired effect is to replace say hundreds of same measurements with same values with only one line, and make logs more readable.

kizniche commented 1 year ago

I like the idea of an (JS-Ajax) auto-refresh (similar to what the dependency install and upgrade logs use) with a user-set duration and keyword search for the UI log view page.