SpringBoot官方文档翻译(二十三):条件日志&资源排除

20.2.1 Logging changes in condition evaluation(记录条件评估中的更改)

1
2
3
4
By default, each time your application restarts, a report showing     
the condition evaluation delta is logged. The report shows the
changes to your application’s auto-configuration as you make changes
such as adding or removing beans and setting configuration properties.

默认情况下,每次您重启您的应用,一个条件评估的增量日志将被打印在控制台。这个日志展示了您应用自动配置部分修改得内容,注入增加,删除beans或者设置配置属性。

1
To disable the logging of the report, set the following property:

禁用以上的日志报告,如下设置:

1
spring.devtools.restart.log-condition-evaluation-delta=false

20.2.2 Excluding Resources(排除资源)

1
2
3
4
5
6
7
8
Certain resources do not necessarily need to trigger a restart      
when they are changed. For example, Thymeleaf templates can be
edited in-place. By default, changing resources in /META-INF/maven, 
/META-INF/resources, /resources, /static, /public, or /templates 
does not trigger a restart but does trigger a live reload. If you
want to customize these exclusions, you can use
the spring.devtools.restart.exclude property. For example, to exclude
only /static and /public you would set the following property:

某些资源没有必要在修改得时候出发重启。举个例子,Thymeleaf模板能够就地编辑。默认情况下,改变/META-INF/maven,
/META-INF/resources, /resources, /static, /public, 或者 /templates
这些路径下的内容,并不需要触发重启,但会触发重载。如果您想自定义排除这些,您可以使用spring.devtools.restart.exclude 属性。举个例子,仅仅排除/static 和 /public,您可以设置以下属性:

1
spring.devtools.restart.exclude=static/**,public/**

1
2
If you want to keep those defaults and add additional exclusions,    
use the spring.devtools.restart.additional-exclude property instead.

如果您想保留这些默认配置,并增加一些额外的排除项目,使用spring.devtools.restart.additional-exclude属性代替。

分享到