For the latest stable version, please use Spring Shell 3.3.3!spring-doc.cn

Logging

On default a Spring Boot application will log messages into a console which at minimum is annoying and may also mix output from a shell commands. Fortunately there is a simple way to instruct logging changes via boot properties.spring-doc.cn

Completely silence console logging by defining its pattern as an empty value.spring-doc.cn

logging:
  pattern:
    console:

If you need log from a shell then write those into a file.spring-doc.cn

logging:
  file:
    name: shell.log

If you need different log levels.spring-doc.cn

logging:
  level:
    org:
      springframework:
        shell: debug

Passing contiguration properties as command line options is not supported but you can use any other ways supported by boot, for example.spring-doc.cn

$ java -Dlogging.level.root=debug -jar demo.jar
$ LOGGING_LEVEL_ROOT=debug java -jar demo.jar
In a GraalVM image settings are locked during compilation which means you can’t change log levels at runtime.