能夠在application.properties
文件,application.yml
文件,或做爲命令行開關,中指定各類屬性,本附錄提供了一個通用的Spring Boot屬性列表和對使用它們的底層類的引用。java
屬性貢獻能夠來自類路徑上的其餘jar文件,所以不該該將其視爲一個詳盡的列表,此外,還能夠定義本身的屬性。
本示例文件僅做爲指南,不要將整個內容複製粘貼到應用程序中,相反,只選擇你須要的屬性。
# =================================================================== # 通用的 Spring Boot 屬性 # # 這個示例文件是做爲指導方針提供的,不要將其所有複製到你本身的應用程序中 # ^^^ # =================================================================== # ---------------------------------------- # 核心屬性 # ---------------------------------------- debug=false # 啓用 debug 日誌 trace=false # 啓用 trace 日誌.
logging.config= # 日誌記錄配置文件的位置,例如,classpath:logback.xml爲Logback提供 logging.exception-conversion-word=%wEx # 記錄異常時使用的轉換字 logging.file= # 日誌文件的名字 (例如,`myapp.log`),名稱能夠是一個確切的位置或相對於當前目錄 logging.file.max-history=0 # 要保存的歸檔日誌文件的最大值,只支持默認的logback設置 logging.file.max-size=10MB # 最大日誌文件大小,只支持默認的logback設置 logging.level.*= # 日誌級別嚴重性映射,例如,`logging.level.org.springframework=DEBUG` logging.path= # 日誌文件的位置,例如 /var/log logging.pattern.console= # 向控制檯輸出的附加模式,只支持默認的logback設置 logging.pattern.dateformat=yyyy-MM-dd HH:mm:ss.SSS # 日誌日期格式的附加模式,只支持默認的logback設置 logging.pattern.file= # 向文件輸出的Appender模式,只支持默認的logback設置 logging.pattern.level=%5p # 日誌級別的附加模式,只支持默認的logback設置 logging.register-shutdown-hook=false # 當日志系統初始化時,註冊一個關閉hook
spring.aop.auto=true # 添加 @EnableAspectJAutoProxy. spring.aop.proxy-target-class=true # 建立基於子類的(CGLIB)代理(true),不建立基於標準Java接口的代理(false)
spring.application.name= # 應用程序名
spring.application.admin.enabled=false # 是否爲應用程序啓用管理特性 spring.application.admin.jmx-name=org.springframework.boot:type=Admin,name=SpringApplication # 應用程序管理MBean的JMX名稱
spring.autoconfigure.exclude= # 排除的自動配置類
spring.banner.charset=UTF-8 # 橫幅文件編碼 spring.banner.location=classpath:banner.txt # 橫幅文本資源的位置 spring.banner.image.location=classpath:banner.gif # 橫幅圖像文件位置(jpg或png也可使用) spring.banner.image.width=76 # 橫幅圖片的寬度 spring.banner.image.height= # 橫幅圖片在字符中的高度(默認基於圖片高度) spring.banner.image.margin=2 # 圖片左間距 spring.banner.image.invert=false # 圖像是否應該反轉爲黑暗終端主題
spring.beaninfo.ignore=true # 是否跳過對BeanInfo類的搜索.
spring.cache.cache-names= # 若是底層緩存管理器支持,則建立以逗號分隔的緩存名稱列表. spring.cache.caffeine.spec= # 用於建立緩存的規範,有關規範格式的詳細信息,請參閱CaffeineSpec spring.cache.couchbase.expiration=0ms # 條目過時時間,默認狀況下,條目不會過時,注意,這個值最終轉換爲秒 spring.cache.ehcache.config= # 用於初始化EhCache的配置文件的位置 spring.cache.infinispan.config= # 用於初始化Infinispan的配置文件的位置 spring.cache.jcache.config= # 用於初始化緩存管理器的配置文件的位置 spring.cache.jcache.provider= # 用於檢索符合JSR-107的緩存管理器的CachingProvider實現的徹底限定名,只有在類路徑上有多個JSR-107實現時才須要 spring.cache.redis.cache-null-values=true # 容許緩存null值. spring.cache.redis.key-prefix= # Key 的前綴 spring.cache.redis.time-to-live=0ms # 條目過時時間,默認狀況下,條目不會過時 spring.cache.redis.use-key-prefix=true # 在寫入Redis時是否使用 key 前綴 spring.cache.type= # 緩存類型,默認狀況下,根據環境自動檢測
spring.config.additional-location= # 除了默認設置外,還使用配置文件位置 spring.config.location= # 配置文件位置,替換默認值 spring.config.name=application # 配置文件名稱
spring.hazelcast.config= # 用於初始化Hazelcast的配置文件的位置
spring.info.build.location=classpath:META-INF/build-info.properties # 生成的build-info.properties文件的位置 spring.info.git.location=classpath:git.properties # 生成的git.properties文件的位置
spring.jmx.default-domain= # JMX 域名. spring.jmx.enabled=true # 將管理bean公開給JMX域. spring.jmx.server=mbeanServer # MBeanServer bean名稱
spring.mail.default-encoding=UTF-8 # 默認MimeMessage編碼 spring.mail.host= # SMTP服務器主機,例如 smtp.example.com spring.mail.jndi-name= # Session JNDI名稱,設置時,優先於其餘郵件設置 spring.mail.password= # SMTP服務器的登陸密碼 spring.mail.port= # SMTP服務器端口 spring.mail.properties.*= # 額外的JavaMail session屬性 spring.mail.protocol=smtp # SMTP服務器使用的協議 spring.mail.test-connection=false # 是否在啓動時測試郵件服務器是否可用 spring.mail.username= # SMTP服務器的登陸用戶
spring.main.banner-mode=console # 模式用於在應用程序運行時顯示橫幅 spring.main.sources= # 源(類名、包名或XML資源位置)包含在ApplicationContext中 spring.main.web-application-type= # 標記顯式地請求特定類型的web應用程序,若是沒有設置,則基於類路徑自動檢測
spring.mandatory-file-encoding= # 應用程序必須使用的預期字符編碼
spring.messages.always-use-message-format=false # 是否老是應用MessageFormat規則,甚至解析沒有參數的消息 spring.messages.basename=messages # 以逗號分隔的basenames列表(本質上是一個徹底限定的類路徑位置),每一個都遵循ResourceBundle約定,並寬鬆地支持基於斜線的位置 spring.messages.cache-duration= # 加載資源包文件緩存持續時間,當沒有設置時,綁定包將永遠被緩存,若是沒有指定持續時間後綴,則將使用秒 spring.messages.encoding=UTF-8 # 消息包編碼 spring.messages.fallback-to-system-locale=true # 若是沒有找到特定地區的文件,是否返回到系統區域 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.active= # 活動配置文件的逗號分隔的列表,能夠被命令行開關覆蓋 spring.profiles.include= # 無條件地激活指定的以逗號分隔的配置文件列表(或者使用YAML的配置文件列表)
spring.quartz.jdbc.initialize-schema=embedded # 數據庫schema初始化模式 spring.quartz.jdbc.schema=classpath:org/quartz/impl/jdbcjobstore/tables_@@platform@@.sql # 用於初始化數據庫schema的SQL文件的路徑 spring.quartz.job-store-type=memory # Quartz job 存儲類型 spring.quartz.properties.*= # 附加的Quartz Scheduler屬性
spring.reactor.stacktrace-mode.enabled=false # 反應堆是否應該在運行時收集堆棧信息