This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Shell 3.4.0! |
Logging
By default, a Spring Boot application logs 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 Spring Boot properties.
To completely silence console logging, set the console’s logging pattern to an empty value:
logging:
pattern:
console:
If you need log from a shell then write those into a file:
logging:
file:
name: shell.log
If you need different log levels:
logging:
level:
org:
springframework:
shell: debug
Passing configuration properties as command line options is not supported, but you can use other ways supported by Spring Boot, for example:
$ 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. |