SpringBoot所有配置項的中文說明(使用Deepl翻譯),由 SpringBoot中文社區 整理提供。
目錄
- 1. Core properties
- 2. Cache properties
- 3. Mail properties
- 4. JSON properties
- 5. Data properties
- 6. Transaction properties
- 7. Data migration properties
- 8. Integration properties
- 9. Web properties
- 10. Templating properties
- 11. Server properties
- 12. Security properties
- 13. RSocket properties
- 14. Actuator properties
- 15. Devtools properties
- 16. Testing properties
1. Core properties
配置項 | 默認值 | 說明 |
---|---|---|
debug |
false |
啟用調試日志。 |
info.* |
要添加到info端點的任意屬性。 | |
logging.config |
日志配置文件的位置。例如,classpath:logback.xml 代表Logback。 |
|
logging.exception-conversion-word |
%wEx |
記錄異常時使用的轉換詞。 |
logging.file.clean-history-on-start |
false |
是否在啟動時清理存檔日志文件。僅支持默認的logback設置。 |
logging.file.max-history |
7.0 |
存檔日志文件的最大保存天數。僅支持默認的logback設置。 |
logging.file.max-size |
10MB |
最大日志文件大小。僅支持默認的logback設置。 |
logging.file.name |
日志文件名(例如,myapp.log )。名稱可以是確切的位置,也可以是當前目錄的相對位置。 |
|
logging.file.path |
日志文件的位置。例如,/var/log 。 |
|
logging.file.total-size-cap |
0B |
要保存的日志備份的總大小。僅支持默認的logback設置。 |
logging.group.* |
日志組可以同時快速更換多個記錄器。例如,logging.group.db=org.hibernate,org.springframework.jdbc 。 |
|
logging.level.* |
日志等級嚴重性映射。例如,logging.level.org.springframework=DEBUG 。 |
|
logging.pattern.console |
%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} |
輸出到控制台的日志格式。僅支持默認的logback設置。 |
logging.pattern.dateformat |
yyyy-MM-dd HH:mm:ss.SSS |
日志中日期的格式化。僅支持默認的logback設置。 |
logging.pattern.file |
%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} |
輸出到文件的日志格式。僅支持默認的logback設置。 |
logging.pattern.level |
%5p |
日志級別的應用者模式。僅支持默認的logback設置。 |
logging.pattern.rolling-file-name |
${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz |
滾動日志文件名的模式。僅支持默認的logback設置。 |
logging.register-shutdown-hook |
false |
在初始化日志系統時,為其注冊一個關閉鈎子。 |
spring.aop.auto |
true |
添加@EnableAspectJAutoProxy。 |
spring.aop.proxy-target-class |
true |
是否要創建基於子類的(CGLIB)代理(true),而不是基於標准Java接口的代理(false)。 |
spring.application.admin.enabled |
false |
是否啟用應用程序的管理功能。 |
spring.application.admin.jmx-name |
org.springframework.boot:type=Admin,name=SpringApplication |
應用管理MBean的JMX名稱。 |
spring.application.name |
應用名稱。 | |
spring.autoconfigure.exclude |
要排除的自動配置類。 | |
spring.banner.charset |
UTF-8 |
Banner文件編碼。 |
spring.banner.image.bitdepth |
4.0 |
用於ANSI顏色的位深度。支持的值是4(16色)或8(256色)。 |
spring.banner.image.height |
橫幅圖像的高度,單位為chars(默認基於圖像高度)。 | |
spring.banner.image.invert |
false |
暗終端主題的圖片是否應該倒置。 |
spring.banner.image.location |
classpath:banner.gif |
橫幅圖片文件位置(也可使用jpg或png)。 |
spring.banner.image.margin |
2.0 |
左手圖像邊距,單位為字符。 |
spring.banner.image.pixelmode |
TEXT |
渲染圖像時要使用的像素模式。 |
spring.banner.image.width |
76.0 |
橫幅圖像的寬度,單位為chars。 |
spring.banner.location |
classpath:banner.txt |
橫幅文字資源位置。 |
spring.beaninfo.ignore |
true |
是否跳過對BeanInfo類的搜索。 |
spring.codec.log-request-details |
false |
否在DEBUG級別記錄表格數據,在TRACE級別記錄標題。 |
spring.codec.max-in-memory-size |
每當需要聚合輸入流時,可以緩沖的字節數的限制。這僅適用於自動配置的WebFlux服務器和WebClient實例。默認情況下,該選項未被設置,在這種情況下,適用於各個編解碼器的默認值。大多數編解碼器默認限制為256K。 | |
spring.config.additional-location |
除默認值外,還使用的配置文件位置。 | |
spring.config.location |
替換默認值的配置文件位置。 | |
spring.config.name |
application |
配置文件名。 |
spring.info.build.encoding |
UTF-8 |
文件編碼。 |
spring.info.build.location |
classpath:META-INF/build-info.properties |
生成的 build-info.properties 文件的位置。 |
spring.info.git.encoding |
UTF-8 |
文件編碼。 |
spring.info.git.location |
classpath:git.properties |
生成的git.properties文件的位置。 |
spring.jmx.default-domain |
JMX域名。 | |
spring.jmx.enabled |
false |
將管理Bean暴露給JMX域。 |
spring.jmx.server |
mbeanServer |
MBeanServer bean名稱。 |
spring.jmx.unique-names |
false |
是否應保證運行時對象名稱唯一。 |
spring.lifecycle.timeout-per-shutdown-phase |
30s |
任何階段(具有相同 "階段 "值的SmartLifecycle beans組)的關閉超時。 |
spring.main.allow-bean-definition-overriding |
false |
是否允許bean定義覆蓋,通過注冊一個與現有定義同名的定義。 |
spring.main.banner-mode |
console |
應用程序運行時用於顯示橫幅的模式。 |
spring.main.cloud-platform |
覆蓋雲平台自動檢測。 | |
spring.main.lazy-initialization |
false |
是否應該懶惰地進行初始化。 |
spring.main.log-startup-info |
true |
是否在啟動時記錄應用程序的信息。 |
spring.main.register-shutdown-hook |
true |
應用程序是否應該注冊一個關機鈎。 |
spring.main.sources |
要包含在ApplicationContext中的源(類名、包名或XML資源位置)。 | |
spring.main.web-application-type |
用於顯式請求特定類型的Web應用程序的標志,如果沒有設置,則根據classpath自動檢測。如果沒有設置,則根據classpath自動檢測。 | |
spring.mandatory-file-encoding |
應用程序必須使用的預期字符編碼。 | |
spring.messages.always-use-message-format |
false |
是否總是應用MessageFormat規則,甚至解析沒有參數的消息。 |
spring.messages.basename |
messages |
以逗號分隔的基名列表(本質上是一個完全限定的classpath位置),每個基名都遵循ResourceBundle慣例,但對基於斜杠的位置的支持有所放松。如果它不包含包限定符(如 "org.mypackage"),將從classpath根目錄解析。 |
spring.messages.cache-duration |
加載的資源捆綁文件緩存時間。未設置時,捆綁文件將被永遠緩存。如果沒有指定持續時間的后綴,將使用秒。 | |
spring.messages.encoding |
UTF-8 |
信息捆綁編碼。 |
spring.messages.fallback-to-system-locale |
true |
如果關閉了這個功能,唯一的回退將是默認文件(例如 "messages "基名的 "messages.properties")。 |
spring.messages.use-code-as-default-message |
false |
是否使用消息代碼作為默認消息,而不是拋出 "NoSuchMessageException"。僅在開發過程中推薦使用。 |
spring.output.ansi.enabled |
detect |
配置ANSI輸出。 |
spring.pid.fail-on-write-error |
如果使用ApplicationPidFileWriter但不能寫入PID文件,則失敗。 | |
spring.pid.file |
要寫入的PID文件的位置(如果使用ApplicationPidFileWriter)。 | |
spring.profiles |
以逗號分隔的配置文件表達式列表,至少有一個應與之匹配,才能將文件包含在內。 | |
spring.profiles.active |
逗號分隔的活動配置文件列表。可由命令行開關覆蓋。 | |
spring.profiles.include |
無條件激活指定的以逗號分隔的配置文件列表(如果使用YAML,則激活配置文件列表)。 | |
spring.quartz.auto-startup |
true |
是否在初始化后自動啟動調度器。 |
spring.quartz.jdbc.comment-prefix |
[#, --] |
SQL初始化腳本中單行注釋的前綴。 |
spring.quartz.jdbc.initialize-schema |
embedded |
數據庫模式初始化模式。 |
spring.quartz.jdbc.schema |
classpath:org/quartz/impl/jdbcjobstore/tables_@@platform@@.sql |
用於初始化數據庫模式的SQL文件的路徑。 |
spring.quartz.job-store-type |
memory |
石英工作店型。 |
spring.quartz.overwrite-existing-jobs |
false |
配置的作業是否應該覆蓋現有的作業定義。 |
spring.quartz.properties.* |
額外的Quartz Scheduler屬性。 | |
spring.quartz.scheduler-name |
quartzScheduler |
調度器的名稱。 |
spring.quartz.startup-delay |
0s |
初始化完成后調度器啟動的延遲時間。如果在整個應用程序啟動之前不需要運行任何作業,那么設置這個屬性是有意義的。 |
spring.quartz.wait-for-jobs-to-complete-on-shutdown |
false |
是否在關機時等待運行的工作完成。 |
spring.reactor.debug-agent.enabled |
true |
反應堆調試代理是否應該在反應堆工具存在時啟用。 |
spring.task.execution.pool.allow-core-thread-timeout |
true |
是否允許核心線程超時。這樣可以實現池的動態增長和收縮。 |
spring.task.execution.pool.core-size |
8.0 |
核心線程數。 |
spring.task.execution.pool.keep-alive |
60s |
線程在被終止前可以保持空閑的時間限制。 |
spring.task.execution.pool.max-size |
允許的最大線程數。如果任務占滿了隊列,池可以擴展到該大小以適應負載。如果隊列是無約束的,則忽略。 | |
spring.task.execution.pool.queue-capacity |
隊列容量。無限制的容量不會增加隊列池,因此忽略了 "最大容量 "屬性。 | |
spring.task.execution.shutdown.await-termination |
false |
執行者是否應該在關機時等待預定任務完成。 |
spring.task.execution.shutdown.await-termination-period |
執行者應等待剩余任務完成的最長時間。 | |
spring.task.execution.thread-name-prefix |
task- |
用於新創建的線程名稱的前綴。 |
spring.task.scheduling.pool.size |
1.0 |
允許的最大線程數。 |
spring.task.scheduling.shutdown.await-termination |
false |
執行者是否應該在關機時等待預定任務完成。 |
spring.task.scheduling.shutdown.await-termination-period |
執行者應等待剩余任務完成的最長時間。 | |
spring.task.scheduling.thread-name-prefix |
scheduling- |
用於新創建的線程名稱的前綴。 |
trace |
false |
啟用跟蹤日志。 |
查看所有的配置
篇幅有限,配置項實在太多。查看所有的配置可以戳。 https://prop.springboot.io/