My log4j.xml contains a logger config with level=“Info” for the package.
Maybe I misunderstand. I can certainly update the log level in the xml file but isn’t the whole point of the karaf log settings that I do not have to edit files?
Usually when you set the log level from karaf, karaf actually adds a line to the bottom of log4j2.xml. If there is no line added, something went wrong with the command.
All the ways you can change the log level of a logger include:
modify log4j2.xml manually (note that all other methods really just add/change this file)
karaf console log:set
REST API logging endpoint
if it’s a binding, under Settings → Add-on Settings → Binding
in a JS Scripting rule using osgi.getService('org.apache.karaf.log.core.LogService').setLevel(console.loggerName, 'DEBUG');, I suspect jRuby has something similar. Now that because this command causes the log4j2.xml file to be opened and modified if two rules try to change log level at the same time it might blow away your log4j2.xml file entirely so use caution.
In all likelihood you’ve a typo in the logger name or the logger name is something else. I’n the rule add console.info(console.loggerName); That will show the name of the logger you need to set.