spring-shell
spring-shell copied to clipboard
Add configuration for disabling logging of history commands
It would be great if there were an easy way of disabling the logging of the executed commands into a file (spring-shell.log).
To anyone else who might be looking for a workaround in the interim:
@Component
public class NoSaveHistory extends DefaultHistory {
@Override
public void save() throws IOException {
}
}
This will noop the save operation and not write to a log file.
There is this property you can set:
spring.shell.command.history.enabled=false
It stops writing commands into the log, but unfortunately the log file will still be created. To avoid the creation of the log file completely I also use the workaround from @tomcooperca mentioned above.
I think this can be closed. At least, since version 3.0.x
spring.shell.history.enabled=false
And it no longer creates a file, so no need for the workaround.
There is this property you can set:
spring.shell.command.history.enabled=false
It stops writing commands into the log, but unfortunately the log file will still be created. To avoid the creation of the log file completely I also use the workaround from @tomcooperca mentioned above.
This doesn't seem to work in spring shell 3.1.4
@AbdulcelilCercenazi-TomTom did you try
spring.shell.history.enabled=false
instead of spring.shell.command.history.enabled=false
Just confirmed this is working as documented in the Spring Shell Reference Docs