[SOLVED] Debunking an infinte loop- java noob

short version:
How to print a fixed sentence to the event.log from within a rule so that i can spot it with frontail?
something along the lines of “in line 67 now”
I guess it could be as easy as a “hello world” example, but i havent’ managet to make it work.

long version

  • Platform information: Raspi 3B+ with Openhabian
  • working on rules for self regulating dimmers and rollershutters

Hello,

i’m in need of the tiniest(i think) bit of help, i am sorry if it’s written somwhere in the docs , if so, it has escaped me, and i AM a java noob, tho getting used to RulesDSL.

I have been trying to create for myself a self regulation of intensity of dimming/rollershutter height based on internal light conditions, with some situations in which the rollershutter not being completely up denies switching ON the light in the room, and viceversa.

I have set up a series of relays connected to leds that tell me when and how long rules are running(i like empyrical evidence), and so, i’ve spotted that i’ve run into an infinite loop (between different rules- that apparently dont’ have an adverse effect on the system but i guess woudl quickly use up alla vailable threads)
I’m struggling to spot which rules are involved in the loop, tho ofc i have my suspects.

How to print a fixed sentence to the event.log from within a rule so that i can spot it with frontail?
something along the lines of “in line 67 now”
I guess it could be as easy as a “hello world” example, but i havent’ managet to make it work.
If i’d see a line repeating, i’d know straight off the bat which rule is the culprit.

Thanks

The docs are your friend: https://www.openhab.org/docs/configuration/actions.html#logging-actions

1 Like

Thanks

In fact, the logger will only log into openhab.log, not to events.log :wink: But nevertheless you will see it in frontail…