看下spring boot配置文件中的mybatis部分
mybatis-plus:
global-config:
banner: false
db-config:
#主鍵類(lèi)型 0:"數(shù)據(jù)庫(kù)ID自增",1:"該類(lèi)型為未設(shè)置主鍵類(lèi)型", 2:"用戶(hù)輸入ID",3:"全局唯一ID (數(shù)字類(lèi)型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
id-type: AUTO
# 默認(rèn)數(shù)據(jù)庫(kù)表下劃線(xiàn)命名
table-underline: true
configuration:
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
call-setters-on-nulls: true
map-underscore-to-camel-case: true
use-generated-keys: true
default-fetch-size: 100
default-statement-timeout: 30
mapper-locations: classpath*:/**/**Mapper.xml
tenantIgnoreTable: ac_book,ac_book_item,ac_dict,ac_family,ac_friend,zhifou_application
#日志級(jí)別
logging:
level:
root: info
com.xxx: debug
一般配置debug級(jí)別日志粹排,基本日志都能輸出了顽染,之前配置,這個(gè)是標(biāo)準(zhǔn)的輸出盆耽,控制臺(tái)正常輸出,但是不會(huì)寫(xiě)到日志文件中聪铺,所以一旦上傳測(cè)試或生產(chǎn)化焕,自動(dòng)過(guò)濾sql部分日志
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
但是我們也希望在測(cè)試環(huán)境也能看
改成如下配置
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
另外日志級(jí)別改為debug,可以直接
logging:
level:
root: debug
就整體都是debug了
如果需要局部控制铃剔,可以配置多個(gè)level
logging:
level:
root: info
com.xxx: debug
com.aaa: debug
只要是com.xxxx,com.aaa下的日志輸出均是debug