Identify component for increasing logging level

  • Platform information:
    • Hardware: rpi2
    • openHAB version: 3.2

Are the component names in the log files truncated?

  1. if yes, what is the full name to use with log:set to increase logging level for following entries?
  2. is there are way to get logger to log the full name vs truncated one?
2022-01-11 14:16:01.980 [WARN ] **[e.internal.SseItemStatesEventBuilder]** - Attempting to send a state update of an item which doesn't exist: LocalAirQuality_PM25
2022-01-10 14:14:50.053 [WARN ] **[ab.binding.mqtt.generic.ChannelState]** - Command '' not supported by type 'OnOffValue': No enum constant org.openhab.core.library.types.OnOffType.

To answer your second question: yes, that is possible. For this you need to alter the “PatternLayout” parts of the appender sections in log4j2.xml.

<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n"/>

is the standard. The “36” is the number of characters that are reserved for the class name, you need to increase these numbers.
If you want to learn more about how these settings work, here you will find more information.

Backup the file before experimenting so you can go back to a working version if your amendments result in logfiles that are not helpful anymore :wink:

1 Like

Thanks - this solved the problem. I can see the full class names now after increasing from 36 to 65.