How can i set logging to error for this msg: [WARN ] [moquette.spi.impl.SessionsRepository] - Session does not exist. CId=mosqpub/5629-openHABian

I think this is because of a bug, it’s not a big deal I just want to turn off it so it won’t appear in logs:

[WARN ] [moquette.spi.impl.SessionsRepository] - Session does not exist. CId=mosqpub/5629-openHABian

from karaf I tried:

log:set ERROR moquette.spi.impl.SessionsRepository
log:set ERROR org.eclipse.smarthome.mqttembeddedbroker

I think I can’t find the right package name any ideas?

thanks for your response but I want to turn off the log level for warning so that only errors appear in the log, what you mention here is filtering out the logs which will work as well but I think will be better if someone can tell me what the package name so that I can set the proper logging level with log:set error level, technically warnings shouldn’t be appearing anymore.

I guess it‘s io.moquette.spi.impl.SessionsRepository

thanks it worked perfect, I’m wondering how do you know this ? is there a way to find out which package printing which log msgs?

Google and a good choice of keywords. I agree that the „shortened“ class/package names are really confusing sometimes.

1 Like

This is controlled by the log4j2 config file though, right? Theoretically we should be able to change that so it shows the full package names. Maybe a quick tutorial would be warranted to help users.

Theoretically one could change

log4j2.appender.out.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n

log4j2.appender.out.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%c] - %m%n

and it will print the full class name in the log file. Add a layout pattern line to the OSGi appender and don’t provide any precision parameters to the %c parameter.

@ers, like Jan suggested, I usually search something like “openHAB moquette.spi.impl.SessionsRepository” or “ESH moquette.spi.impl.SessionsRepository” and I usually get the file in it’s github repo right away which tells me the package.

1 Like