Debugging with OH2.4 on Synology and Visual Studio Code?

Dear community,

my openhab 2.4 is running smoothly on a Synology DS218. I also defined items and wrote the first rules successfully with Visual Studio Code. But this is a very big try-and-error, since I really don‘t understand how to create and track a debug file… The documentation for me is somehow like „Bohemian villages“ :wink: My simple questions:
-How can I write a text (e.g. „entered if-section A in rule B; variable DATETIME=xxx“) to track my rules?
-And how can I read this output (e.g. there‘s an output window in VSC whichI maybe could use???..)

System:
openHAB 2.4 running on
Synology Diskstation 218
Mac Mini with OSX Catalina and Visual Studio Code

Thank you for your proposals in advance,
Doc MC

P.S. Posting a related topic, I encountered, that my Synology is not capable to run frontail…

It’s written to a file named openhab.log. I don’t know the method that openHAB get’s intsalled on Synology but I would guess that file is located at <where ever openHAB's root folder exists>/userdata/logs.

You will need to ssh to the Synology and tail -f that file to watch it in real time.

Dear Rich,

thank you for the answer. I’ve already checked the loggin section in the documentation, but can’t apply it somehow… What I did:

1.) I’ve written a testrule which should write every 5s a message. To be “safe” I used the command “logInfo” and “logDebug”. (This rule is included in a rule-file with other rules. Since the other rules are working correctly, the file itself seems to be OK.)

rule "Logger test"

when

Time cron "0/5 * * * * ?"

then

logInfo ("events.log", "Test2")

logDebug("events.log", "message")

end

2.) Checking the directory /volume1/public/openHAB/userdata/logs/ of my openhab log files in the Synology, I see the standard log-files “events.log.x” and “openhab.log.x”.

3.) Checking the file “events.log” with “tail -f” , I see that this logger is running (e.g. notes from the Surveillance station are added"… but I don’t see any entries like “Test” or “message” which should appear every 5s.

Any hint what is wrong… or what I have forgotten?

Best regards and thank you in advance,
Doc MC

It’s written to a file named openhab.log

2 Likes

Thank you, Rich, I found it. Now I can speed up with programming rules. And BTW, you should receive the batch “hero of openHAB”, since your tutorials (e.g. Design pattern of Day) are really great and helpful! :slight_smile:

Best regards,
Doc MC.

1 Like