Initialize logback is it is present in CLI

This (empirically) fixes gh-726 using a new utility
(LogbackInitializer) in the loader tools. If anyone has enough
Gradle fu to understand where to put it (after the classpath is established
but before compilation) we could do the same thing in the Gradle plugin
(and that would fix gh-724).
This commit is contained in:
Dave Syer
2014-05-07 07:19:19 -07:00
parent 1ef3d3bda9
commit 894482df1a
3 changed files with 51 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ import org.springframework.boot.cli.command.core.HelpCommand;
import org.springframework.boot.cli.command.core.HintCommand;
import org.springframework.boot.cli.command.core.VersionCommand;
import org.springframework.boot.cli.command.shell.ShellCommand;
import org.springframework.boot.loader.tools.LogbackInitializer;
/**
* Spring Command Line Interface. This is the main entry-point for the Spring command line
@@ -37,6 +38,7 @@ public class SpringCli {
public static void main(String... args) {
System.setProperty("java.awt.headless", Boolean.toString(true));
LogbackInitializer.initialize();
CommandRunner runner = new CommandRunner("spring");
runner.addCommand(new HelpCommand(runner));