Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsscripting] Logger name missing for UI-based rules #17165

Closed
Mark-VG opened this issue Jul 27, 2024 · 3 comments · Fixed by #17171
Closed

[jsscripting] Logger name missing for UI-based rules #17165

Mark-VG opened this issue Jul 27, 2024 · 3 comments · Fixed by #17171
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@Mark-VG
Copy link

Mark-VG commented Jul 27, 2024

In previous versions (4.2.0.M2) it was possible to set the logging level for individual rules using the syntax log:set DEBUG org.openhab.automation.script.ui.<Rule Name>

However in newer SNAPHOTS (4.3.0.SNAPHOT 4197) this no longer works.

Expected Behavior

When logging is set in a rule the output to the log file should look something like:

19:54:35.512 [DEBUG] [.openhab.automation.script.ui.<Rule Name>] - *** Test Log has Run ***

This then makes it possible to set the log level for each specific rule using the syntax:

log:set DEBUG org.openhab.automation.script.ui.<Rule Name>

The rule used to send the logs is (I use Blockly to test):

console.debug('*** Test Log has Run ***');

Current Behavior

In the current builds (4.3.0.SNAPHOT) the logging is shown as:

20:00:24.040 [INFO ] [org.openhab.automation.script        ] - *** Test Log has Run ***

As you will see the distinguishing part (.ui.<SCRIPT NAME>) is no longer included.

This means that the command required to set individual log levels no longer works.

Possible Solution

Send the full logger name for the rule as was done previoulsy?

Steps to Reproduce (for Bugs)

1.Create a simple logging rule such as:

console.info('*** Test Log has Run ***');

2.Monitor the openhab.log file to see the resulting log statement, this will look something like:

20:00:24.040 [INFO ] [org.openhab.automation.script        ] - *** Test Log has Run ***
  1. Set the logging level using the command:
log:set DEBUG org.openhab.automation.script.ui.<Rule Name>

and change log rule to:

console.info('*** Test Log has Run ***');
  1. Monitoring the openhab.log file will show that nothing gets logged.

Context

My existing rules with log levels set no longer work.
It is no longer possibel to set individual logging elvel per rule as you would have to set the entire org.openhab.automation.script level, so all rules will log at the same level and it is no longer possible to turn off for specific rules.

Your Environment

  • Version used: openHAB 4.3.0 Build [windcentrale] update millId #4197
  • Environment name and version (e.g. Chrome 76, Java 8, Node.js 12.9, ...): Chrome and Andorid App
  • Operating System and version (desktop or mobile, Windows 10, Raspbian Buster, ...): Windows 10 with 17.0.11 (Zulu17.50+19-CA)

This has been discussed on community at: https://community.openhab.org/t/oh4-3-0-snapshot-blockly-log-not-working-debug-and-trace/157449

@Mark-VG Mark-VG added the bug An unexpected problem or unintended behavior of an add-on label Jul 27, 2024
@florian-h05
Copy link
Contributor

This very likely is a side effect/regression from openhab/openhab-core#4289, but it should be no problem to fix that.

@florian-h05 florian-h05 changed the title OH 4.3.0-SNAPHOST logger name changed. No longer able to set logger level per rule [jsscripting] Logger name missing for UI-based rules Jul 27, 2024
@florian-h05 florian-h05 self-assigned this Jul 27, 2024
@florian-h05 florian-h05 transferred this issue from openhab/openhab-js Jul 27, 2024
florian-h05 added a commit to florian-h05/openhab-addons that referenced this issue Jul 28, 2024
Fixes openhab#17165.
Caused by openhab/openhab-core#4289.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@jlaur jlaur closed this as completed in 20251fe Jul 29, 2024
@Mark-VG
Copy link
Author

Mark-VG commented Jul 31, 2024

Thanks for fixing so quickly. Appreciate it.

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/log-level-on-rule/157629/2

digitaldan pushed a commit to digitaldan/openhab-addons that referenced this issue Aug 29, 2024
…UI scripts (openhab#17171)

* [jsscripting] Fix console logger name is missing for UI scripts
* [jsscripting] Fix timer identifier "missing" for setTimeout/setInterval for UI scripts

Fixes openhab#17165.
Caused by openhab/openhab-core#4289.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
pgfeller pushed a commit to pgfeller/openhab-addons that referenced this issue Sep 29, 2024
…UI scripts (openhab#17171)

* [jsscripting] Fix console logger name is missing for UI scripts
* [jsscripting] Fix timer identifier "missing" for setTimeout/setInterval for UI scripts

Fixes openhab#17165.
Caused by openhab/openhab-core#4289.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
joni1993 pushed a commit to joni1993/openhab-addons that referenced this issue Oct 15, 2024
…UI scripts (openhab#17171)

* [jsscripting] Fix console logger name is missing for UI scripts
* [jsscripting] Fix timer identifier "missing" for setTimeout/setInterval for UI scripts

Fixes openhab#17165.
Caused by openhab/openhab-core#4289.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
matchews pushed a commit to matchews/openhab-addons that referenced this issue Oct 18, 2024
…UI scripts (openhab#17171)

* [jsscripting] Fix console logger name is missing for UI scripts
* [jsscripting] Fix timer identifier "missing" for setTimeout/setInterval for UI scripts

Fixes openhab#17165.
Caused by openhab/openhab-core#4289.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
3 participants