parent
a7b7836523
commit
659b8c12e1
@ -1,4 +1,5 @@
|
|||||||
key: aa78fcbe21d77af8
|
key: aa78fcbe21d77af8
|
||||||
url: PINN@[b43OeNppIVyLnbWEybBFR7ilgcIOkQz5Mkb2tWtOuugrQoTxjpf3hozwU8LRSpboCAOf4WSAB9eknmbS15qX42/e6g1XmmJCsSAwx3TswOjX9x6BgjcDiWrUcYx4ZiNS9wO79ieCkLdeWRW1AZ6msuFV0JGRQNMpsLaJjwra2BZ4Hldq88EDjyZntBvT2s58EXM/bjMKIQhynkUibEbAhw==]
|
url: PINN@[DeBx+L2NxMoLVRK5aFJal930HSNKNRDjyw8k9SfphiNauMBtB0BVeigeVoA4zncZl8KklrjYq6r7yvnGN/54eCZSa+/ZisvGO8LLywPKP9XXEPs0Ar4cMvX3EDMDgJsitmOUNID4VD7a4tBOEXituKYdBt2d97etv3F2SV6PUALj7i11qqI0sPWmgLcRohpWdZ8heJAmZcRKNGySQLpwWQ==]
|
||||||
username: PINN@[WEciwJ1eT6ZjAMncoppuow==]
|
p6spyurl: PINN@[wwmRkyryca6C99kAK/fCHtJBxYLY++/PKLOLI/ZDZ1v1+2G9qIqtc3jN/WTBbj0vAoITV16e/f/NQ19hu970+zGfVMN37bB0kDfNQ8Jc5qDH0OOfFR1MGL231clxmCUe4TNSyIHh4ti+IiAnaeUPXNWJAxxd/oWQeaKw96GT9F9UlF0upolfNwhhigeQpFLWEC5l6k9B7/2sNAscxoeBQoQEnl8ON7rR]
|
||||||
password: PINN@[YZXfQ+pMtdFaMCxbKy5ey5BfxIG2RQnZ]
|
username: PINN@[cftYM6QehEHfdIe8DCLqxw==]
|
||||||
|
password: PINN@[Yf+zXisp7902VzH2hoHqyvJD5GINf7Xh]
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.ruoyi.common.log.p6spy;
|
||||||
|
|
||||||
|
import com.ruoyi.common.log.aspect.LogAspect;
|
||||||
|
import com.ruoyi.common.log.utils.JansiUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 输出 SQL 日志
|
||||||
|
*
|
||||||
|
* @author hubin
|
||||||
|
* @since 2019-02-20
|
||||||
|
*/
|
||||||
|
public class StdoutLogger extends com.p6spy.engine.spy.appender.StdoutLogger {
|
||||||
|
@Override
|
||||||
|
public void logText(String text) {
|
||||||
|
JansiUtils.info(text);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package com.ruoyi.common.log.utils;
|
||||||
|
|
||||||
|
import com.ruoyi.common.log.aspect.LogAspect;
|
||||||
|
import org.fusesource.jansi.Ansi;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import static org.fusesource.jansi.Ansi.*;
|
||||||
|
import static org.fusesource.jansi.Ansi.Color.*;
|
||||||
|
|
||||||
|
public class JansiUtils {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
|
||||||
|
|
||||||
|
public static void info(String text){
|
||||||
|
info(text,null);
|
||||||
|
}
|
||||||
|
public static void debug(String text){
|
||||||
|
debug(text,null);
|
||||||
|
}
|
||||||
|
public static void warn(String text){
|
||||||
|
warn(text,null);
|
||||||
|
}
|
||||||
|
public static void err(String text){
|
||||||
|
err(text,null);
|
||||||
|
}
|
||||||
|
public static void trace(String text){
|
||||||
|
trace(text,null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void info(String text,Object o){
|
||||||
|
setColor(BLUE);
|
||||||
|
log.info(text,o);
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
public static void debug(String text,Object o){
|
||||||
|
setColor(GREEN);
|
||||||
|
log.debug(text,o);
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
public static void warn(String text,Object o){
|
||||||
|
setColor(YELLOW);
|
||||||
|
log.warn(text,o);
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
public static void err(String text,Object o){
|
||||||
|
setColor(RED);
|
||||||
|
log.error(text,o);
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
public static void trace(String text,Object o){
|
||||||
|
setColor(CYAN);
|
||||||
|
log.trace(text,o);
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置颜色
|
||||||
|
* @param color
|
||||||
|
*/
|
||||||
|
private static void setColor(Ansi.Color color){
|
||||||
|
System.out.print(ansi().eraseScreen().fg(color));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭颜色输出
|
||||||
|
*/
|
||||||
|
private static void reset(){
|
||||||
|
System.out.print(ansi().eraseScreen().reset());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
#3.2.1????
|
||||||
|
modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
|
||||||
|
#3.2.1?????????
|
||||||
|
#modulelist=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory
|
||||||
|
# ???????
|
||||||
|
logMessageFormat=com.ruoyi.common.log.p6spy.P6SpyLogger
|
||||||
|
#????????
|
||||||
|
appender=com.ruoyi.common.log.p6spy.StdoutLogger
|
||||||
|
# ???????? sql
|
||||||
|
# appender=com.p6spy.engine.spy.appender.Slf4JLogger
|
||||||
|
# ?? p6spy driver ??
|
||||||
|
deregisterdrivers=true
|
||||||
|
# ??JDBC URL??
|
||||||
|
useprefix=true
|
||||||
|
# ???? Log ??,????????error,info,batch,debug,statement,commit,rollback,result,resultset.
|
||||||
|
excludecategories=info,debug,result,commit,resultset
|
||||||
|
# ????
|
||||||
|
dateformat=yyyy-MM-dd HH:mm:ss
|
||||||
|
# ???????
|
||||||
|
#driverlist=org.h2.Driver
|
||||||
|
# ?????SQL??
|
||||||
|
outagedetection=true
|
||||||
|
# ?SQL???? 2 ?
|
||||||
|
outagedetectioninterval=2
|
Loading…
Reference in new issue