Log4J allows you to pass the level you'd like particular loggers in your application to log at from the command line, e.g. "-Dlog4j.logger.com.whatever.MyClass=DEBUG". I can't find any similar facility in Logback. According to the FAQ, all it seems to allow you to do is set the level for the root logger by using variable substitution. Is there something I'm missing or does Logback just not support this? Thanks.
Yes, seems there is no such feature. As I understand, it is partly because that logback configuration is more complex so quite difficult to achieve reasonable configuration flexibility by flat string properties. Partly because, imho, it encourages bad practice - placing too many system properties - leads to bloated run-scripts or command lines, more difficult to manage than separate logging configuration files.
However, I could suggest several options:
${sys.prop.var.name}
substitutions in your logback.xml config file-Dlogback.configurationFile=/path/to/customised/logback.xml
. Keep in mind that "Logback-classic can scan for changes in its configuration file and automatically reconfigure itself when the configuration file changes". So, you even don't need to relaunch your process to change logging levels.