spring-projects / spring-shell

Spring based shell
http://projects.spring.io/spring-shell/
Apache License 2.0
723 stars 395 forks source link

Add configuration for disabling logging of history commands #194

Open bigbasti opened 6 years ago

bigbasti commented 6 years ago

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

ghost commented 6 years ago

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.

renedupont commented 5 years ago

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.

dashaun commented 1 year ago

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.

AbdulcelilCercenazi-TomTom commented 10 months ago

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

dashaun commented 8 months ago

@AbdulcelilCercenazi-TomTom did you try spring.shell.history.enabled=false instead of spring.shell.command.history.enabled=false

dashaun commented 8 months ago

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