Log viewer for HabPanel or directly in any browser - Without PHP, frontail or any additionals installations

Want to share your solution? Maybe I can add it to the main post.

I can’t tell, but i assume that you reach your openhab server through myopenhab. That doesn’t mean you reach all services on your computer/raspberry or your network. As this logfile viewer is not a part of the openhab server, i can not be shown. I use VPN to connect to my network.

Sure! It’s described here: openHAB - Filtering event logs

I added a REGEX filter in my thing definition (serial binding allows this) which removes the unnecessary new line characters (see link above). This solved the issue for me.

1 Like

Two major changes in v1.4

Entries can be marked in alternately colors.
After using the filter you can jump to the entrie while erasing filter.

I dont know how your log files look like, but mine are pretty confusing in chain reactions. Thats why marking could help a lot.
And sometimes I need to check entries longer ago. Therefore, after using Filter text, a “Jump to” icon will be visible you this will jump to the entrie and disable the filter.

Enjoy.

Edit: Fixed and improved some new functions in 1.41

1 Like

I have it in my BasicUI setup, works like a charm :+1: Thank you very much for your effort

1 Like

Made some fixes and improvements in Version 1.43
See first post.

I have installed this and I would like to see it on BasicUI as well.
Could you explain how did you do this ? I am a beginner
 sorry for the noob quesion.

OK Sorry. I managed.

Also, is threre a way to have it updating automatically without pushing the refresh like with the log:tail command ?

@wlanrouter1 thanks for the great job. It is easy to be installed and avoid the mess of installing other stuff on my PI (it is a Model B and it is already quite stressed by the job it’s making) .

1 Like

Try placing this command in the last script area at the end:
var interval = setInterval(loadData, 10000);

Do you mean like this:

if (searchParams.has('maxentries')) {
		maxentries = searchParams.get("maxentries");
		if (maxentries < 100) entiresstep = maxentries;
		else entiresstep = 100;
		$("#maxentries").val(searchParams.get("maxentries"));
		var interval = setInterval(loadData, 10000);
	}

It seems not doing anything.

At the end:

	}
var interval = setInterval(loadData, 10000);	
</script>
</body>
</html>
1 Like

Thanks. This works as an automatic refresh.

It would be nice to have it as an option to be set instead of editing the script.

First of all, thanks a lot for this script!.
I am trying to use on a OpenHAB over Windows PC. The links only works if I put “hardlinks”, not symbolic ones.

I can see the ln_log_events.html and ln_log_openhab.html on browser (all log on a single row), but nothing is displayed on logs.html, only “Completed openhab.log”:

Please wait

Reading events.log

Reading openhab.log

Completed openhab.log

Any idea?
Thanks in advance.

Ruben
PD: Sorry, edit
 I have changed a name on scripts
 appears “Load 100 more entries” button but nothing is showed.

Set the debug variable to true.[quote=“wlanrouter1, post:1, topic:44090”]
var debug=false;
[/quote]

Maybe this will give you further details.

Same here on Windows. Links created (soft) - whicha re working, but in the logs.html i receive only 3 entries. With “debug” enabled i get the full log with these additional notes over and over in between:

nextTimestampEvents < nextTimestampOpenhab: OpenhabLog is next
OL: nextTimestampOpenhab:1610789610369 # DateTime should be standing here:(2021-01-16 10:33:30.369)
OL: No Skip due datetime found:2021-01-16 10:33:30.369 [INFO ] [org.openhab.rule.9229f1aa1b ] - Info 2:05:30
nextTimestampEvents < nextTimestampOpenhab: OpenhabLog is next
OL: nextTimestampOpenhab:1610789610369 # DateTime should be standing here:(2021-01-16 10:33:30.369)

or

OL: No Skip due datetime found:2021-01-16 10:26:20.237 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID '9229f1aa1b' failed: SyntaxError: Invalid JSON: :1:0 Expected json literal but found N 

so it can read the files and should display me the entries. Is there some kind of datetime problem preventing it from displaying it correctly without debug?

Can you show more detailed? More lines of the original log entry and show me the difference in debug outputs between showed lines and hidden lines.

One question: is this working also in OH3 ? For OH2 was perfect but after update it does not work for me.

Works perfectly under OH3 as it doesn’t uses Openhab librarys at all. Check you paths, some of them has changed. eg.
Openhab2: /etc/openhab2/
Openhab3: /etc/openhab/

2 Likes

It works great. Thanks.

1 Like