[SOLVED] Karaf Logging: Include bundle name into binding doc

In some cases users are requested to change the log level of a binding in order to get more information.

The problem is, that it is not always clear what the exact name of the binding is.
The only reliable information is either the jar file of the addon or if the person who requests the detailed logs tells the name. At least i don’t know a way other than that
You also can’t see it with

bundle:list

It would be really helpful if the binding doc templates also have a section for the logger name.
Maybe that could also be automated in the build process since the bundle name must exists somewhere there?
If there a issue filed already or shall i create one? And if so: Where? since the binding docs is not in the openhab-doc shall I file this in openhab-addons?

I must be missing something. The log entries include where they originate from. Using your linked page:

20:38:00.031 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Stored 'Temperature_FF_Child' with state '19.1' in rrd4j database
20:38:00.032 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Stored 'Temperature_FF_Bed' with state '19.5' in rrd4j database
20:38:20.463 [DEBUG] [thome.io.rest.core.item.ItemResource] - Received HTTP POST request at 'items/Light_FF_Bath_Ceiling' with value 'ON'.
20:38:21.444 [DEBUG] [thome.io.rest.core.item.ItemResource] - Received HTTP POST request at 'items/Light_FF_Bath_Mirror' with value 'ON'.

The first 2 are from rrd4j, for instance.

But i believe that’s not the always the complete bundle name. (probably because the log tool (log4j2 or how it’s called) is truncating the sources.
As an example:
LogEntry:

2020-06-10 11:51:22.508 [INFO ] [fritzboxtr064.internal.SOAPConnector] - Failed to get Tr064ChannelConfig{channelType=uptime, getAction=GetInfo, dataType='ui4, parameter='null'}: HTTP-Response-Code 500 (Internal Server Error), SOAP-Fault: 401 (Invalid Action)

For changing the loglevel in karaf i need to write:

log:set DEBUG org.openhab.binding.fritzboxtr064

So yes if I know that this is an addon and not e.g. a persistence service i can find our the prefix.(org.openhab.addon)
But i’d prefer to see the name somewhere in the binding docs.

1 Like

But you can see it with (the bundle is not required)…

list -s

And to filter it down a bit…

list -s | grep zwave
1 Like

Thanks - didn’t know that.
Maybe we should add this information into the logging documentation. :slight_smile:
I’ll see if i have the time to do it

1 Like

Tadaaa:


I’m going to mark this as solved

It would be good practice to include a Troubleshooting section in each binding docs.
As well as describing extra logging options, this can also give some minimal advice about e.g. external diagnostic tools for that technology, or important status to check.

Note that some bindings can have multiple packages involved for logging, so the correct place to highlight this is with the binding, not generic docs.

Example for illustration

I think in the actual logging doc, there is an example for setting DEBUG.
It would be helpful to give the example of setting it back to “normal”, because it is not self-evident