How can I change the log level

The log file openhab.log contains by default entries with log level “INFO”. Where can I changed the level to “WARNING”? I have checked several config files but did not find the place where the log level can be set.

Please read this topic for more information:

Or check the new logging chapter in the openHAB 2 documentation.

Thanks for the link, Joerg. Unfortunately this chapter describes only how to change the log level while openHab is running. I would like to have a default log level of WARNING to limit the log file sizes.

Take a look at the file org.ops4j.pax.logging.cfg in the folder {openhab}/runtime/karaf/etc/

Changing one of the lines like:

log4j.logger.smarthome.event = INFO, event

to

log4j.logger.smarthome.event = WARN, event

should do the trick. However, I just started to work with Karaf so not 100% sure of what I am doing… :blush:

When you set the log level using the console, it will persist the setting. So, when you restart OH, it will still be as you set it.

If you update the runtime, then it may be reset to the default, but otherwise, it should do what you want.

Thanks for the info, Chris. Will give it a try.

in openhab-cli console type:

log:set WARN

it enables WARN for all, same with DEBUG, and INFO