zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    mysql基础以优化
    Mysql建立索引基础
    Mysql(1)
    SVN学习总结
    Github
    Java Eclipse断点调试
    Java设计模式图文详解
    代理模式
    Java——动态代理技术
    Spring基本概念理解
  • 原文地址:https://www.cnblogs.com/yoyotl/p/6934626.html
Copyright © 2011-2022 走看看