集成_2_application.properties数据源配置+logback.xml打印sql

application.properties

#dataSource
spring.datasource.name=mydb  
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource  
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://172.16.24.47:3306/test_s?useUnicode=true&characterEncoding=utf-8
spring.datasource.username=root
[email protected]!@#
spring.datasource.max-active=1000
#spring.datasource.test-on-borrow=true
#spring.datasource.test-on-return=true

#mybatis
mybatis.mapperLocations=classpath*:tutorial/springboot/dao/mapper/*.xml  
mybatis.typeAliasesPackage=tutorial.springboot.model
#log
logging.path=./logs
logging.file=Log

注意:mybatis配置除了上面常见的两项配置,还有:

mybatis.config:mybatis-config.xml配置文件的路径
mybatis.typeHandlersPackage:扫描typeHandlers的包
mybatis.checkConfigLocation:检查配置文件是否存在
mybatis.executorType:设置执行模式(SIMPLE, REUSE, BATCH),默认为SIMPLE

logback.xml



    
    
    
    
        
            [%d{yyyy-MM-dd'T'HH:mm:ss.SSS}] %level - %m%n
        
     
    
    
        
    
    
    
        ${LOG_PATH}/${LOG_FILE}.log
        
            ${LOG_PATH}/%d{yyyy-MM-dd,aux}/${LOG_FILE}-%d{yyyy-MM-dd}.%i.log.zip
            20MB
            180
            2GB
        
        
            [%d{yyyy-MM-dd'T'HH:mm:ss.SSS}] %level ${LOG_FILE} %logger : %message%n
        
    

    
    
        ${LOG_PATH}/${LOG_FILE}-error.log
        
        
          WARN
        
        
            ${LOG_PATH}/%d{yyyy-MM-dd,aux}/${LOG_FILE}-error-%d{yyyy-MM-dd}.%i.log.zip
            20MB
            180
            2GB
        
        
          [%d{yyyy-MM-dd'T'HH:mm:ss.SSS}] %level ${LOG_FILE} %logger : %message%n
        
    
      
      
         
        
      
    
    
    
 

你可能感兴趣的:(集成_2_application.properties数据源配置+logback.xml打印sql)