smq
passworchat 3 weeks ago
parent cadf6741ee
commit eb395e7372

@ -0,0 +1,59 @@
# 项目信息配置
project:
name: dyspringboot
version: 1.0.0
env: development
# WEB服务器配置
server:
#端口
port: 8080
servlet:
#上下文路径
context-path: /springbootzongse
spring:
# 数据源配置
datasource:
# 数据库
url: jdbc:mysql://localhost:3306/gouwulingshispr97023?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
# 数据库用户名,需要改成你自己的
username: root
# 数据库密码,需要改成你自己的
password: 123456
# 数据库驱动按实际选择默认是mysql8 com.mysql.cj.jdbc.Driver(mysql8) 、 com.mysql.jdbc.Driver(mysql8)
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
# JSON返回配置
jackson:
# 默认时区
time-zone: GMT+8
# 默认日期格式化
date-format: yyyy-MM-dd HH:mm:ss
# 静态资源配置
resources:
static-locations: classpath:/static/
# Thymeleaf配置
thymeleaf:
cache: false
servlet:
multipart:
#上传文件时单个文件大小配置
max-file-size: 50MB
#总上传文件大小配置
max-request-size: 50MB
# MyBatis配置
mybatis:
mapper-locations: classpath:/mappers/*.xml
configuration:
map-underscore-to-camel-case: true
# 日志配置
logback:
level: INFO
appender: ${project.env}
# dao层的日志设置为debug方便查看sql
logging:
level:
com.dao: debug

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<springProperty scope="context" name="logbackLevel" source="logback.level"/>
<springProperty scope="context" name="logbackAppender" source="logback.appender"/>
<!-- 开发环境(输出到控制台) -->
<appender name="development" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<!-- 设置日志输出格式 -->
<pattern>%d %p (%file:%line\)- %m%n</pattern>
<!-- 输出编码 -->
<charset>UTF-8</charset>
</encoder>
</appender>
<!-- 测试/线上环境(通过日期分割日志文件) -->
<appender name="production"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/dyspringboot.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 文件名配置 -->
<fileNamePattern>log/dyspringboot-%d.%i.log</fileNamePattern>
<!-- 日志文件保存期限(单位天) -->
<maxHistory>30</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- 设置日志文件大小默认值是10MB-->
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<!-- 设置日志输出格式 -->
<pattern>%d %p (%file:%line\)- %m%n</pattern>
<!-- 输出编码 -->
<charset>UTF-8</charset>
</encoder>
</appender>
<!-- 设置日志级别和输出模式 -->
<root level="${logbackLevel}">
<appender-ref ref="${logbackAppender}" />
</root>
</configuration>
Loading…
Cancel
Save