spring-shell icon indicating copy to clipboard operation
spring-shell copied to clipboard

Add configuration for disabling logging of history commands

Open bigbasti opened this issue 7 years ago • 6 comments

It would be great if there were an easy way of disabling the logging of the executed commands into a file (spring-shell.log).

bigbasti avatar Jan 16 '18 12:01 bigbasti

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.

ghost avatar Apr 21 '18 00:04 ghost

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.

renedupont avatar Jan 31 '19 08:01 renedupont

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.

dashaun avatar Jun 05 '23 14:06 dashaun

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

dashaun avatar Dec 30 '23 02:12 dashaun

Just confirmed this is working as documented in the Spring Shell Reference Docs

dashaun avatar Dec 30 '23 03:12 dashaun