TAIL like function for log files

Anywhere there are log files in the HA interface should use something like tail -f and the ability to grep to filter for relevant information. As it is today with HA, most interface logs present require chasing the bottom of the page as you look for something relevant. The command line works just fine, but users unfamiliar with Linux and the command line don’t get to track down issues, as they happen.


I use the Hassbian installation:

tail -f /home/homeassistant/.homeassistant/home-assistant.log


Very interesting is also frontail: https://github.com/mthenw/frontail
outputs tailing logs in a browser window that you may be able to put right back into your home-assistant interface; a little more complex though to set it up

The logs in the HA UI aren’t very useful, especially to users unfamiliar with Linux. You need to keep scrolling to the bottom of the page looking for some particular event. Even tail -f at the command line isn’t necessarily useful since you can have dozens of lines fly by in a few seconds.
I use a 3 line script to capture so many seconds of both home-assistant.log and OZW_Log.txt, pipes it through grep to capture just what I am interested in and writes it to files. That way I get to see what openzwave says and what HA says and perhaps understand what’s happening. Really useful when you are adding a zwave device that doesn’t go as planned.
I just think something similar in the HA UI could be useful to new users try to figure out what went wrong. Being able to capture and post just a tiny snipit of relevant information in the forums could really help isolate and solve issues quicker.

try :
tail -f -n 5 /var/log/syslog

Limiting the tail display to 5 lines isn’t helpful if you have dozens of lines per second. If you have an idea of what you are looking for, even a partial clue, filter tail through grep as in
tail -f /var/log/syslog |grep error
and you will only display lines with error in them

1 Like