STSC
(STSC)
November 12, 2023, 8:50am
1
Hello,
I tried to set the logging level for the Modbus binding, but it just has no effect.
First I I tried to set the level by navigating to Settings → Bindings → Binding Name and click the little gear icon in the upper right. In the Modbus binding then I see 7 addons. If I set the first “org.openhab.binding.modbus” to INFO, the 5 of 7 addons are also set to INFO. But whatevery I set, it has no effect. Is there a bug?
Then I went to “openhab-cli console”. Listed everything with “list -s”. Log level of modbus binding like almost other binding set to 80. Then I tried to set it with “log:set INFO org.openhab.binding.modbus”. “list -s” again, but still unchanged.
What am I doing wrong?
opus
(Jürgen Baginski)
November 12, 2023, 11:11am
2
You’d have to use the “log:list” command on the console to see the actually used log-settings!
Setting a binding to INFO won’t show that much, I’d use a higher setting depending what you do need that for.
STSC
(STSC)
November 12, 2023, 11:29am
3
Ok, “log:list” gives the right information. I have set the Modbus binding to INFO: “log:set INFO org.openhab.binding.modbus”.
But I still get a lot of warnings from the binding. Do I need another approach, because it is related to “ing.ModbusSlaveConnectionFactoryImp” or “rt.modbus.internal.ModbusManagerImpl”?
2023-11-12 12:25:13.984 [WARN ] [ing.ModbusSlaveConnectionFactoryImpl]
2023-11-12 12:25:13.985 [WARN ] [ing.ModbusSlaveConnectionFactoryImpl]
2023-11-12 12:25:13.987 [WARN ] [rt.modbus.internal.ModbusManagerImpl]
hmerk
(Hans-Jörg Merk)
November 12, 2023, 12:51pm
4
This sets logging to a really low level. To not see the WARN messages, set the log level to ERROR.
Verbosity is raising
Error
Warn
Info
Debug
Trace
STSC
(STSC)
November 12, 2023, 1:28pm
5
Yes of course. ERROR is right, “log:set ERROR org.openhab.binding.modbus”.
But this does not change anything, I still get all time these warnings
2023-11-12 12:25:13.984 [WARN ] [ing.ModbusSlaveConnectionFactoryImpl]
2023-11-12 12:25:13.985 [WARN ] [ing.ModbusSlaveConnectionFactoryImpl]
2023-11-12 12:25:13.987 [WARN ] [rt.modbus.internal.ModbusManagerImpl]
hmerk
(Hans-Jörg Merk)
November 12, 2023, 3:34pm
6
I guess, you need to set
log:set WARN org.openhab.binding.ModbusSlaveConnectionFactoryImpl
STSC
(STSC)
November 12, 2023, 4:09pm
7
But this is not available. When I call “log:list” I only see:
org.openhab.binding.modbus │ ERROR
org.openhab.binding.modbus.e3dc │ ERROR
org.openhab.binding.modbus.studer │ ERROR
Also in the binding configuration it is not available:
hmerk
(Hans-Jörg Merk)
November 12, 2023, 4:59pm
8
Let me check later with the sourcecode
hmerk
(Hans-Jörg Merk)
November 12, 2023, 5:44pm
9
Your warnings are coming from
org.openhab.core.io.transport.modbus/src/main/java/org/openhab/core/io/transport/modbus/internal/pooling/ModbusSlaveConnectionFactoryImpl.java
So you would need to enter the following on the console
log:set ERROR org.openhab.io.transport.modbus
STSC
(STSC)
November 12, 2023, 6:25pm
10
It’s now set to
org.openhab.io.transport.modbus │ ERROR
But I still get these warnings:
2023-11-12 19:23:55.023 [WARN ] [ing.ModbusSlaveConnectionFactoryImpl]
2023-11-12 19:23:55.025 [WARN ] [ing.ModbusSlaveConnectionFactoryImpl]
2023-11-12 19:23:55.026 [WARN ] [rt.modbus.internal.ModbusManagerImpl]
Any further ideas?
hmerk
(Hans-Jörg Merk)
November 12, 2023, 6:27pm
11
Sorry, now I am completely out of ideas…
Edit: Sorry, typo from my side, missed the core, so it is
org.openhab.core.io.transport.modbus
STSC
(STSC)
November 12, 2023, 6:46pm
12
That’s it, the warnings are gone with this command Thanks!!
log:set ERROR org.openhab.core.io.transport.modbus
Do you know how this can be added to the Modbus Configuration page? Do I need to write an issue for this?
STSC:
hmerk
(Hans-Jörg Merk)
November 12, 2023, 6:48pm
13
You cannot, as this belongs to the core io bundle, which is used in all the different modbus bindings.