Best way to find the right class/packge for logging enable

I often find it challenging to identify the correct class name when I want to enhance logging to obtain more detailed information about a warning.

Take, for instance, the following log entry:

2024-03-12 13:37:49.223 [WARN ] [ernal.handler.DeconzBaseThingHandler] - Sending command REFRESH to channel deconz:lightgroup:00212E00C488:33:color_temperature failed: 400 - [{"error":{"address":"/groups/33/action","description":"body contains invalid JSON","type":2}}]

In this entry, the segment “ernal.handler.DeconzBaseThingHandler” suggests that the full class name might be something like “x.y.z.external.handler.DeconzBaseThingHandler.” However, I have been unable to locate any package or class that includes “external.handler.”

How do I find the right packge name in this example in order to do:

log:set DEBUG

First, it is more likely to be ...internal.handler.DeconzBaseThingHandler.

That being said, if you are on OH4, you should be able to simply switch on debug logging for the Deconz binding from MainUI. Go the the specific addon settings page for that. You should find it on the settings page.
You can also set the full binding to debug. That should be org.openhab.binding.deconz.

This is clear to me, I am just wondering why I see an “external” in the actual logs.
The source code where this log is generated is located in the package org.openhab.binding.deconz.internal.handler

The class has been abreviated to ternal.... in your log fragment. That can be internal as well as external. I think it is internal in this case.

shame on me, sure both int/ext share the same “ernal” :slight_smile:

If you look at logging configuration, there is entry to define message pattern. I usually rely on %c alone which prints entire category without trimming.

1 Like

At the binding level it is possible to set the logging level too, for example the deconz binding: