I have a question about viewing logs.
When I use Frontail (http://openHAB-IP:9001), the contents of event.log and openhab.log are displayed at the same time.
So far so good - and nice.
Now when a few hours or even days have passed and it is no longer visible in Frontail, I can view the two log-files in the /userdata/log folder.
Is there a way to view the two log-files at the same time - just like Frontail does? I would like to see the log entries from both files in one view - and not have to browse through 2 files.
Is there something availale for e.g. Visual Studio Code editor to view both files in one view?
It is generally not that easy of a problem because every log file can have it’s own formatting and the date/time part of each log statement has to be extracted, parsed, and then each line from all the files need to be sorted for interleaved output.
There are lots of tools and approaches, some brittle and others more robust. I’ve tried a few but frankly I find it easier and more flexible to just open the two logs in separate windows/tabs side-by-side and use search to line them up where necessary. A google search should bring up a bunch. Here’s one I’ve not used but was recommended on a Stackoverthrow thread: credible-doc/log-combiner-parent at master · credibledoc/credible-doc · GitHub
If you prefer to always have the contents of the two logs together, change the log4j2.xml file for the openhab.event Logger to use AppenderRef LOGFILE instead of EVENT and all your logs will go to openhab.log and you’ll no longer have two separate files.