Debug logging in JavaScript rules stopped working

Just noticed today that “logger.debug” in my JavaScript rules not logging anything, it was fines since forever and I didn’t change anything logging wise.

Used a simple test like this:

var logger = log('my_logger');

//prints "Hello World!"
logger.debug("Hello {}!", "world");
logger.info("Hello {}!", "world");

.info logs fine, .debug nothing

2026-02-24 01:51:03.783 [INFO ] [ion.jsscripting.openhab-js.my_logger] - Hello world!

org.openhab.automation.openhab-js                  │ DEBUG
org.openhab.automation.script                      │ DEBUG
org.openhab.core.automation                        │ DEBUG

Not sure what am I missing, any ideas?
Also, can somebody drop an example how to enable debug logging per script file? Whatever I’ve tried from the examples didn’t work!

Thanks a lot,

K.

This indicates the log level needs to be set to DEBUG for that logger name.

With openHAB 5.1.0, we aligned the logger names to unify the prefixes used by the add-on, the helper library and user code, so logger names might have changed and you need to set to DEBUG again.

Hi Florian, thank you for your reply!

Still the question which logger is responsible now for JS script events and how to find the list of loggers? I don’t see documentation reflecting this.

Thanks,

K.

Update: Ok, after some troubleshooting, I’ve figured it out, the logger in question should be:

<Logger level="DEBUG" name="org.openhab.automation.jsscripting"/>

It has to be added to a configuration file manually, after that level can be changed through the console. Thanks Florian for pushing me in the right direction!

From JavaScript Scripting - Automation | openHAB

The default logger name consists of the prefix org.openhab.automation.jsscripting and the script’s individual part .file.<filename> , .rule.<ruleUID> , or .transformation.<transformationUID> . This logger name can be changed by assigning a new string to the loggerName property of the console:

Frankly, these logs are only on next.openhab.org and not www.openhab.org, I’ll look into this.

Instead of putting all logging from JS Scripting do debug, I would rather recommend doing this on a per script basis. You should be able to set any log level for any logger through the console.

Thanks a lot, Florian. I did read docs but as you said it is not on regular one!!

1 Like