springboot配置合集

常用配置

# 配置端口号
server.port=8080

# 配置context-path,一般不配置
#server.context-path=/myblog

# 错误页,指定发生错误时,调整的URL --> BasicErrorController
#server.error.path=/error

#session最大超时时间(分钟),默认30分钟
#server.session-timeout=30

# 绑定的IP地址,一般不配置
# server.address=192.168.0.106


#Profile
#spring.profiles.active=dev

#http encoding
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true

tomcat配置

https://www.malaoshi.top/show_1EF5rw7iAXg6.html

springboot undertow配置

https://www.malaoshi.top/show_1EF5rw8CXG49.html

超时

单位毫秒

spring.mvc.async.request-timeout=20000

springBoot修改上传文件大小配置

https://www.malaoshi.top/show_1EF5rvGodrgG.html

日志配置

#日志
#logging.file=/export/log
#logging.level.root=DEBUG
#logging.level.org.springframework.web=DEBUG
#logging.level.sample.mybatis.mapper=TRACE

数据库配置

#datasource
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8
#spring.datasource.username=test
#spring.datasource.password=123456
#spring.datasource.max-active=10
#spring.datasource.max-idle=5
#spring.datasource.min-idle=0

其他

#banner是否开启,启动时显示的图案
#spring.main.banner-mode=off

原文出处:/show_1EF5rzguDjWH.html