开发环境打印sql
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
package com.chaozhanggui.system.cashierservice.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.annotation.Order;
|
||||||
|
import org.springframework.web.filter.CommonsRequestLoggingFilter;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class RequestLoggingConfig {
|
||||||
|
@Bean
|
||||||
|
@Order(-9999)
|
||||||
|
public CommonsRequestLoggingFilter logFilter() {
|
||||||
|
CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter();
|
||||||
|
// 是否记录请求的查询参数信息
|
||||||
|
filter.setIncludeQueryString(true);
|
||||||
|
// 是否记录请求body内容
|
||||||
|
filter.setIncludePayload(true);
|
||||||
|
filter.setMaxPayloadLength(10000);
|
||||||
|
//是否记录请求header信息
|
||||||
|
filter.setIncludeHeaders(false);
|
||||||
|
// 是否记录请求客户端信息
|
||||||
|
filter.setIncludeClientInfo(true);
|
||||||
|
// 设置日期记录的前缀
|
||||||
|
filter.setBeforeMessagePrefix("\033[32;4m请求开始:");
|
||||||
|
filter.setBeforeMessageSuffix("\033[0m");
|
||||||
|
filter.setAfterMessagePrefix("\033[34m请求结束:");
|
||||||
|
filter.setAfterMessageSuffix("\033[0m");
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,11 @@ spring:
|
|||||||
url: jdbc:p6spy:mysql://rm-bp1kn7h89nz62cno1ro.mysql.rds.aliyuncs.com:3306/fycashier_test?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true
|
url: jdbc:p6spy:mysql://rm-bp1kn7h89nz62cno1ro.mysql.rds.aliyuncs.com:3306/fycashier_test?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true
|
||||||
username: cashier
|
username: cashier
|
||||||
password: Cashier@1@
|
password: Cashier@1@
|
||||||
|
# url: jdbc:mysql://rm-bp1b572nblln4jho2.mysql.rds.aliyuncs.com/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||||
|
# username: root
|
||||||
|
# password: Czg666888
|
||||||
|
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
|
||||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||||
initialSize: 5
|
initialSize: 5
|
||||||
@@ -42,11 +47,10 @@ spring:
|
|||||||
username: admin
|
username: admin
|
||||||
password: Czg666888
|
password: Czg666888
|
||||||
|
|
||||||
mybatis:
|
#mybatis:
|
||||||
configuration:
|
# configuration:
|
||||||
map-underscore-to-camel-case: true
|
# map-underscore-to-camel-case: true
|
||||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
mapper-locations: classpath:mapper/*.xml
|
|
||||||
ysk:
|
ysk:
|
||||||
url: https://gatewaytestapi.sxczgkj.cn/gate-service/
|
url: https://gatewaytestapi.sxczgkj.cn/gate-service/
|
||||||
callBackurl: https://p40312246f.goho.co/cashierService/notify/notifyCallBack
|
callBackurl: https://p40312246f.goho.co/cashierService/notify/notifyCallBack
|
||||||
|
|||||||
@@ -40,11 +40,11 @@ spring:
|
|||||||
username: admin
|
username: admin
|
||||||
password: Czg666888
|
password: Czg666888
|
||||||
|
|
||||||
mybatis:
|
#mybatis:
|
||||||
configuration:
|
# configuration:
|
||||||
map-underscore-to-camel-case: true
|
# map-underscore-to-camel-case: true
|
||||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
mapper-locations: classpath:mapper/*.xml
|
# mapper-locations: classpath:mapper/*.xml
|
||||||
ysk:
|
ysk:
|
||||||
url: https://gateway.api.sxczgkj.cn/gate-service/
|
url: https://gateway.api.sxczgkj.cn/gate-service/
|
||||||
callBackurl: https://cashier.sxczgkj.cn/cashierService/notify/notifyCallBack
|
callBackurl: https://cashier.sxczgkj.cn/cashierService/notify/notifyCallBack
|
||||||
|
|||||||
@@ -64,10 +64,11 @@ pagehelper:
|
|||||||
params: count=countSql
|
params: count=countSql
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
|
org.springframework.web.filter.CommonsRequestLoggingFilter: debug
|
||||||
|
com.chaozhanggui.system.cashierservice.mapper: debug
|
||||||
|
com.chaozhanggui.system.cashierservice.dao: debug
|
||||||
# web日志
|
# web日志
|
||||||
org.springframework.web: debug
|
# org.springframework.web: debug
|
||||||
# mybatis日志
|
|
||||||
org.apache.ibatis: debug
|
|
||||||
charset:
|
charset:
|
||||||
# 输出控制台编码
|
# 输出控制台编码
|
||||||
console: UTF-8
|
console: UTF-8
|
||||||
@@ -101,3 +102,10 @@ aliyun:
|
|||||||
thirdPay:
|
thirdPay:
|
||||||
payType: fushangtong
|
payType: fushangtong
|
||||||
url: https://paymentapi.sxczgkj.cn
|
url: https://paymentapi.sxczgkj.cn
|
||||||
|
|
||||||
|
|
||||||
|
mybatis-plus:
|
||||||
|
global-config:
|
||||||
|
db-config:
|
||||||
|
id-type: auto
|
||||||
|
mapper-locations: classpath:mapper/*.xml
|
||||||
|
|||||||
Reference in New Issue
Block a user