History

history 命令显示已执行的命令历史记录。

The history command shows the history of commands that has been executed.

您可以使用一些配置选项来配置历史记录行为。历史记录保存到日志文件中,在默认情况下处于启用状态,可以通过设置 spring.shell.history.enabled 关闭历史记录。日志文件名称从 spring.application.name 解析而来,默认为 spring-shell.log,可以通过设置 spring.shell.history.name 更改此名称。

There are a few configuration options that you can use to configure behavior of a history. History is kept in a log file, which is enabled by default and can be turned off by setting spring.shell.history.enabled. The name of a log file is resolved from spring.application.name and defaults to spring-shell.log, which you can change by setting spring.shell.history.name.

默认情况下,日志文件生成到当前工作目录,您可以通过设置 spring.shell.config.location 指定工作目录。此属性可以包含一个占位符({userconfig}),该占位符解析为公共共享配置目录。

By default, a log file is generated to a current working directory, which you can dictate by setting spring.shell.config.location. This property can contain a placeholder ({userconfig}), which resolves to a common shared config directory.

运行 Spring Shell 应用程序以了解示例应用程序如何使用这些选项工作。

Run the Spring Shell application to see how the sample application works as it uses these options.