首页 > 代码库 > spring boot几个初始配置文件
spring boot几个初始配置文件
一、gradle
// https://mvnrepository.com/artifact/com.squareup.okhttp/okhttp compile group: ‘com.squareup.okhttp‘, name: ‘okhttp‘, version: ‘2.7.5‘ // https://mvnrepository.com/artifact/commons-codec/commons-codec compile group: ‘commons-codec‘, name: ‘commons-codec‘, version: ‘1.9‘ compile("org.springframework.boot:spring-boot-starter-web:1.5.3.RELEASE")
二、application.properties
logging.level.root=WARN logging.level.org.springframework.web=DEBUG logging.level.org.hibernate=ERROR logging.level.com.vvhi=DEBUG
三、logback.xml
<?xml version="1.0" encoding="UTF-8"?> <configuration> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} %level [%thread][%file:%line] - %msg%n</pattern> <charset>utf-8</charset> </encoder> </appender> <appender name="baselog" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>/var/log/proxy.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>/var/log/proxy.log.%d.%i</fileNamePattern> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> <!-- or whenever the file size reaches 64 MB --> <maxFileSize>64 MB</maxFileSize> </timeBasedFileNamingAndTriggeringPolicy> </rollingPolicy> <encoder> <pattern> %date{yyyy-MM-dd HH:mm:ss.SSS} %level [%thread][%file:%line] - %msg%n </pattern> <charset>UTF-8</charset> <!-- 此处设置字符集 --> </encoder> </appender> <root level="info"> <appender-ref ref="STDOUT" /> </root> <logger name="com.vvhi" level="DEBUG"> <appender-ref ref="baselog" /> </logger> </configuration>
spring boot几个初始配置文件
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。