mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-03 18:56:39 +08:00
modify
This commit is contained in:
parent
83ac894413
commit
c010409b3b
@ -22,10 +22,13 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!--springboot starter dependency begin -->
|
<!--springboot starter dependency begin -->
|
||||||
|
<!--
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-log4j2</artifactId>
|
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-aop</artifactId>
|
<artifactId>spring-boot-starter-aop</artifactId>
|
||||||
@ -51,7 +54,26 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
<!-- 去除内嵌tomcat -->
|
||||||
|
<!--
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
-->
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 去除内嵌tomcat后,添加servlet的依赖-->
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||||
@ -263,6 +285,9 @@
|
|||||||
<systemPath>${basedir}/lib/commons-logging-1.1.1.jar</systemPath>
|
<systemPath>${basedir}/lib/commons-logging-1.1.1.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
@ -317,6 +342,15 @@
|
|||||||
<testFailureIgnore>true</testFailureIgnore>
|
<testFailureIgnore>true</testFailureIgnore>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<!-- fix web.xml is missing -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
||||||
</build>
|
</build>
|
||||||
|
@ -26,4 +26,9 @@ public class SmartAdminApplication {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(SmartAdminApplication.class, args);
|
SpringApplication.run(SmartAdminApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||||
|
// return builder.sources(this.getClass());
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
import net.lab1024.smartadmin.common.anno.OperateLog;
|
import net.lab1024.smartadmin.common.anno.OperateLog;
|
||||||
import net.lab1024.smartadmin.common.domain.ResponseDTO;
|
import net.lab1024.smartadmin.common.domain.ResponseDTO;
|
||||||
import net.lab1024.smartadmin.common.heartbeat.StringUtil;
|
import net.lab1024.smartadmin.common.heartbeat.StringUtil;
|
||||||
|
@ -30,29 +30,6 @@ public class GoodService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private FlowDao flowDao;
|
private FlowDao flowDao;
|
||||||
|
|
||||||
|
|
||||||
public OrdersEntity getOrderById(String OrderNo){
|
|
||||||
return ordersDao.findByOrderId(OrderNo);
|
|
||||||
}
|
|
||||||
|
|
||||||
public GoodsEntity getGoodsById(String productCode){
|
|
||||||
return goodsDao.findByProductCode(productCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int updateOrderStatus(String out_trade_no,String total_amount){
|
|
||||||
return ordersDao.updateOrderStatus(out_trade_no,total_amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int addOrder(OrdersEntity ordersEntity){
|
|
||||||
return ordersDao.insert(ordersEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ResponseDTO<String> batchAddFlow(List<FlowEntity> flowEntities){
|
|
||||||
flowDao.batchInsert(flowEntities);
|
|
||||||
return ResponseDTO.succ();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<GoodsEntity> listGoodsByNameBankNameTagUsedAge(String title){
|
public List<GoodsEntity> listGoodsByNameBankNameTagUsedAge(String title){
|
||||||
return goodsDao.selectRoleIdByGoodsNameBankNameTagUsedAge(title);
|
return goodsDao.selectRoleIdByGoodsNameBankNameTagUsedAge(title);
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,6 @@ public class WXPayReport {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (config.shouldAutoReport()) {
|
if (config.shouldAutoReport()) {
|
||||||
WXPayUtil.getLogger().info("report worker num: {}", config.getReportWorkerNum());
|
|
||||||
for (int i = 0; i < config.getReportWorkerNum(); ++i) {
|
for (int i = 0; i < config.getReportWorkerNum(); ++i) {
|
||||||
executorService.execute(new Runnable() {
|
executorService.execute(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -142,7 +141,6 @@ public class WXPayReport {
|
|||||||
try {
|
try {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
String firstMsg = reportMsgQueue.take();
|
String firstMsg = reportMsgQueue.take();
|
||||||
WXPayUtil.getLogger().info("get first report msg: {}", firstMsg);
|
|
||||||
String msg = null;
|
String msg = null;
|
||||||
sb.append(firstMsg); //会阻塞至有消息
|
sb.append(firstMsg); //会阻塞至有消息
|
||||||
int remainNum = config.getReportBatchSize() - 1;
|
int remainNum = config.getReportBatchSize() - 1;
|
||||||
@ -150,7 +148,6 @@ public class WXPayReport {
|
|||||||
WXPayUtil.getLogger().info("try get remain report msg");
|
WXPayUtil.getLogger().info("try get remain report msg");
|
||||||
// msg = reportMsgQueue.poll(); // 不阻塞了
|
// msg = reportMsgQueue.poll(); // 不阻塞了
|
||||||
msg = reportMsgQueue.take();
|
msg = reportMsgQueue.take();
|
||||||
WXPayUtil.getLogger().info("get remain report msg: {}", msg);
|
|
||||||
if (msg == null) {
|
if (msg == null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -163,7 +160,6 @@ public class WXPayReport {
|
|||||||
WXPayReport.httpRequest(sb.toString(), DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_READ_TIMEOUT_MS);
|
WXPayReport.httpRequest(sb.toString(), DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_READ_TIMEOUT_MS);
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
WXPayUtil.getLogger().warn("report fail. reason: {}", ex.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -198,7 +194,6 @@ public class WXPayReport {
|
|||||||
firstDomain, primaryDomain, firstConnectTimeoutMillis, firstReadTimeoutMillis,
|
firstDomain, primaryDomain, firstConnectTimeoutMillis, firstReadTimeoutMillis,
|
||||||
firstHasDnsError, firstHasConnectTimeout, firstHasReadTimeout);
|
firstHasDnsError, firstHasConnectTimeout, firstHasReadTimeout);
|
||||||
String data = reportInfo.toLineString(config.getKey());
|
String data = reportInfo.toLineString(config.getKey());
|
||||||
WXPayUtil.getLogger().info("report {}", data);
|
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
reportMsgQueue.offer(data);
|
reportMsgQueue.offer(data);
|
||||||
}
|
}
|
||||||
@ -218,7 +213,6 @@ public class WXPayReport {
|
|||||||
httpRequest(data, DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_READ_TIMEOUT_MS);
|
httpRequest(data, DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_READ_TIMEOUT_MS);
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
WXPayUtil.getLogger().warn("report fail. reason: {}", ex.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
@ -143,7 +143,6 @@ public class WXPayRequest {
|
|||||||
exception = ex;
|
exception = ex;
|
||||||
firstHasDnsErr = true;
|
firstHasDnsErr = true;
|
||||||
elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs;
|
elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs;
|
||||||
WXPayUtil.getLogger().warn("UnknownHostException for domainInfo {}", domainInfo);
|
|
||||||
WXPayReport.getInstance(config).report(
|
WXPayReport.getInstance(config).report(
|
||||||
uuid,
|
uuid,
|
||||||
elapsedTimeMillis,
|
elapsedTimeMillis,
|
||||||
@ -160,7 +159,6 @@ public class WXPayRequest {
|
|||||||
exception = ex;
|
exception = ex;
|
||||||
firstHasConnectTimeout = true;
|
firstHasConnectTimeout = true;
|
||||||
elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs;
|
elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs;
|
||||||
WXPayUtil.getLogger().warn("connect timeout happened for domainInfo {}", domainInfo);
|
|
||||||
WXPayReport.getInstance(config).report(
|
WXPayReport.getInstance(config).report(
|
||||||
uuid,
|
uuid,
|
||||||
elapsedTimeMillis,
|
elapsedTimeMillis,
|
||||||
@ -177,7 +175,6 @@ public class WXPayRequest {
|
|||||||
exception = ex;
|
exception = ex;
|
||||||
firstHasReadTimeout = true;
|
firstHasReadTimeout = true;
|
||||||
elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs;
|
elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs;
|
||||||
WXPayUtil.getLogger().warn("timeout happened for domainInfo {}", domainInfo);
|
|
||||||
WXPayReport.getInstance(config).report(
|
WXPayReport.getInstance(config).report(
|
||||||
uuid,
|
uuid,
|
||||||
elapsedTimeMillis,
|
elapsedTimeMillis,
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package net.lab1024.smartadmin.module.system.wxpay.sdk;
|
package net.lab1024.smartadmin.module.system.wxpay.sdk;
|
||||||
|
|
||||||
import net.lab1024.smartadmin.module.system.wxpay.sdk.WXPayConstants.SignType;
|
import net.lab1024.smartadmin.module.system.wxpay.sdk.WXPayConstants.SignType;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
|
|
||||||
@ -20,6 +18,7 @@ import java.io.StringWriter;
|
|||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
|
||||||
public class WXPayUtil {
|
public class WXPayUtil {
|
||||||
@ -57,7 +56,6 @@ public class WXPayUtil {
|
|||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
WXPayUtil.getLogger().warn("Invalid XML, can not convert to map. Error message: {}. XML content: {}", ex.getMessage(), strXML);
|
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,7 +323,7 @@ public class WXPayUtil {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static Logger getLogger() {
|
public static Logger getLogger() {
|
||||||
Logger logger = LoggerFactory.getLogger("wxpay java sdk");
|
Logger logger = Logger.getLogger("WXpayUtil");
|
||||||
return logger;
|
return logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,97 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
status : 这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,会看到log4j2内部各种详细输出
|
|
||||||
monitorInterval : Log4j能够自动检测修改配置文件和重新配置本身, 设置间隔秒数。
|
|
||||||
-->
|
|
||||||
<Configuration status="INFO" monitorInterval="30">
|
|
||||||
<Properties>
|
|
||||||
<Property name="log-path">/home/logs/smart-admin/dev/logs</Property>
|
|
||||||
</Properties>
|
|
||||||
<Appenders>
|
|
||||||
<Console name="Console" target="SYSTEM_OUT">
|
|
||||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
</Console>
|
|
||||||
<RollingFile name="debug" fileName="${log-path}/debug/smart-admin_debug.log"
|
|
||||||
filePattern="${log-path}/debug/smart-admin_debug_%d{yyyy-MM-dd}-%i.log">
|
|
||||||
<Filters>
|
|
||||||
<ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/>
|
|
||||||
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
</Filters>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
|
||||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="30">
|
|
||||||
<Delete basePath="${log-path}/debug" maxDepth="1">
|
|
||||||
<IfFileName glob="smart-admin_debug_*.log"/>
|
|
||||||
<IfLastModified age="15d"/>
|
|
||||||
</Delete>
|
|
||||||
</DefaultRolloverStrategy>
|
|
||||||
</RollingFile>
|
|
||||||
<RollingFile name="info" fileName="${log-path}/info/smart-admin_info.log"
|
|
||||||
filePattern="${log-path}/info/smart-admin_info_%d{yyyy-MM-dd}-%i.log">
|
|
||||||
<Filters>
|
|
||||||
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
|
|
||||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
</Filters>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
|
||||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="30">
|
|
||||||
<Delete basePath="${log-path}/info" maxDepth="1">
|
|
||||||
<IfFileName glob="smart-admin_info_*.log"/>
|
|
||||||
<IfLastModified age="15d"/>
|
|
||||||
</Delete>
|
|
||||||
</DefaultRolloverStrategy>
|
|
||||||
</RollingFile>
|
|
||||||
<RollingFile name="warn" fileName="${log-path}/warn/smart-admin_warn.log"
|
|
||||||
filePattern="${log-path}/warn/smart-admin_warn_%d{yyyy-MM-dd}-%i.log">
|
|
||||||
<Filters>
|
|
||||||
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
|
|
||||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
</Filters>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
|
||||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="30">
|
|
||||||
<Delete basePath="${log-path}/warn" maxDepth="1">
|
|
||||||
<IfFileName glob="smart-admin_warn_*.log"/>
|
|
||||||
<IfLastModified age="15d"/>
|
|
||||||
</Delete>
|
|
||||||
</DefaultRolloverStrategy>
|
|
||||||
</RollingFile>
|
|
||||||
<RollingFile name="error" fileName="${log-path}/error/smart-admin_error.log"
|
|
||||||
filePattern="${log-path}/error/smart-admin_error_%d{yyyy-MM-dd}-%i.log">
|
|
||||||
<Filters>
|
|
||||||
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
|
|
||||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
</Filters>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
|
||||||
<SizeBasedTriggeringPolicy size="10 MB"/>
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="30">
|
|
||||||
<Delete basePath="${log-path}/error" maxDepth="1">
|
|
||||||
<IfFileName glob="smart-admin_error_*.log"/>
|
|
||||||
<IfLastModified age="15d"/>
|
|
||||||
</Delete>
|
|
||||||
</DefaultRolloverStrategy>
|
|
||||||
</RollingFile>
|
|
||||||
</Appenders>
|
|
||||||
<Loggers>
|
|
||||||
<Root level="debug">
|
|
||||||
<AppenderRef ref="Console"/>
|
|
||||||
<AppenderRef ref="debug"/>
|
|
||||||
<AppenderRef ref="info"/>
|
|
||||||
<AppenderRef ref="warn"/>
|
|
||||||
<AppenderRef ref="error"/>
|
|
||||||
</Root>
|
|
||||||
</Loggers>
|
|
||||||
</Configuration>
|
|
@ -1,97 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
status : 这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,会看到log4j2内部各种详细输出
|
|
||||||
monitorInterval : Log4j能够自动检测修改配置文件和重新配置本身, 设置间隔秒数。
|
|
||||||
-->
|
|
||||||
<Configuration status="INFO" monitorInterval="30">
|
|
||||||
<Properties>
|
|
||||||
<Property name="log-path">/home/logs/smart-admin/dev/logs</Property>
|
|
||||||
</Properties>
|
|
||||||
<Appenders>
|
|
||||||
<Console name="Console" target="SYSTEM_OUT">
|
|
||||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
</Console>
|
|
||||||
<RollingFile name="debug" fileName="${log-path}/debug/smart-admin_debug.log"
|
|
||||||
filePattern="${log-path}/debug/smart-admin_debug_%d{yyyy-MM-dd}-%i.log">
|
|
||||||
<Filters>
|
|
||||||
<ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/>
|
|
||||||
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
</Filters>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
|
||||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="30">
|
|
||||||
<Delete basePath="${log-path}/debug" maxDepth="1">
|
|
||||||
<IfFileName glob="smart-admin_debug_*.log"/>
|
|
||||||
<IfLastModified age="15d"/>
|
|
||||||
</Delete>
|
|
||||||
</DefaultRolloverStrategy>
|
|
||||||
</RollingFile>
|
|
||||||
<RollingFile name="info" fileName="${log-path}/info/smart-admin_info.log"
|
|
||||||
filePattern="${log-path}/info/smart-admin_info_%d{yyyy-MM-dd}-%i.log">
|
|
||||||
<Filters>
|
|
||||||
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
|
|
||||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
</Filters>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
|
||||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="30">
|
|
||||||
<Delete basePath="${log-path}/info" maxDepth="1">
|
|
||||||
<IfFileName glob="smart-admin_info_*.log"/>
|
|
||||||
<IfLastModified age="15d"/>
|
|
||||||
</Delete>
|
|
||||||
</DefaultRolloverStrategy>
|
|
||||||
</RollingFile>
|
|
||||||
<RollingFile name="warn" fileName="${log-path}/warn/smart-admin_warn.log"
|
|
||||||
filePattern="${log-path}/warn/smart-admin_warn_%d{yyyy-MM-dd}-%i.log">
|
|
||||||
<Filters>
|
|
||||||
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
|
|
||||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
</Filters>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
|
||||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="30">
|
|
||||||
<Delete basePath="${log-path}/warn" maxDepth="1">
|
|
||||||
<IfFileName glob="smart-admin_warn_*.log"/>
|
|
||||||
<IfLastModified age="15d"/>
|
|
||||||
</Delete>
|
|
||||||
</DefaultRolloverStrategy>
|
|
||||||
</RollingFile>
|
|
||||||
<RollingFile name="error" fileName="${log-path}/error/smart-admin_error.log"
|
|
||||||
filePattern="${log-path}/error/smart-admin_error_%d{yyyy-MM-dd}-%i.log">
|
|
||||||
<Filters>
|
|
||||||
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
|
|
||||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
</Filters>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
|
||||||
<SizeBasedTriggeringPolicy size="10 MB"/>
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="30">
|
|
||||||
<Delete basePath="${log-path}/error" maxDepth="1">
|
|
||||||
<IfFileName glob="smart-admin_error_*.log"/>
|
|
||||||
<IfLastModified age="15d"/>
|
|
||||||
</Delete>
|
|
||||||
</DefaultRolloverStrategy>
|
|
||||||
</RollingFile>
|
|
||||||
</Appenders>
|
|
||||||
<Loggers>
|
|
||||||
<Root level="warn">
|
|
||||||
<AppenderRef ref="Console"/>
|
|
||||||
<AppenderRef ref="debug"/>
|
|
||||||
<AppenderRef ref="info"/>
|
|
||||||
<AppenderRef ref="warn"/>
|
|
||||||
<AppenderRef ref="error"/>
|
|
||||||
</Root>
|
|
||||||
</Loggers>
|
|
||||||
</Configuration>
|
|
@ -1,97 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
status : 这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,会看到log4j2内部各种详细输出
|
|
||||||
monitorInterval : Log4j能够自动检测修改配置文件和重新配置本身, 设置间隔秒数。
|
|
||||||
-->
|
|
||||||
<Configuration status="INFO" monitorInterval="30">
|
|
||||||
<Properties>
|
|
||||||
<Property name="log-path">/home/logs/smart-admin/dev/logs</Property>
|
|
||||||
</Properties>
|
|
||||||
<Appenders>
|
|
||||||
<Console name="Console" target="SYSTEM_OUT">
|
|
||||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
</Console>
|
|
||||||
<RollingFile name="debug" fileName="${log-path}/debug/smart-admin_debug.log"
|
|
||||||
filePattern="${log-path}/debug/smart-admin_debug_%d{yyyy-MM-dd}-%i.log">
|
|
||||||
<Filters>
|
|
||||||
<ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/>
|
|
||||||
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
</Filters>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
|
||||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="30">
|
|
||||||
<Delete basePath="${log-path}/debug" maxDepth="1">
|
|
||||||
<IfFileName glob="smart-admin_debug_*.log"/>
|
|
||||||
<IfLastModified age="15d"/>
|
|
||||||
</Delete>
|
|
||||||
</DefaultRolloverStrategy>
|
|
||||||
</RollingFile>
|
|
||||||
<RollingFile name="info" fileName="${log-path}/info/smart-admin_info.log"
|
|
||||||
filePattern="${log-path}/info/smart-admin_info_%d{yyyy-MM-dd}-%i.log">
|
|
||||||
<Filters>
|
|
||||||
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
|
|
||||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
</Filters>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
|
||||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="30">
|
|
||||||
<Delete basePath="${log-path}/info" maxDepth="1">
|
|
||||||
<IfFileName glob="smart-admin_info_*.log"/>
|
|
||||||
<IfLastModified age="15d"/>
|
|
||||||
</Delete>
|
|
||||||
</DefaultRolloverStrategy>
|
|
||||||
</RollingFile>
|
|
||||||
<RollingFile name="warn" fileName="${log-path}/warn/smart-admin_warn.log"
|
|
||||||
filePattern="${log-path}/warn/smart-admin_warn_%d{yyyy-MM-dd}-%i.log">
|
|
||||||
<Filters>
|
|
||||||
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
|
|
||||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
</Filters>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
|
||||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="30">
|
|
||||||
<Delete basePath="${log-path}/warn" maxDepth="1">
|
|
||||||
<IfFileName glob="smart-admin_warn_*.log"/>
|
|
||||||
<IfLastModified age="15d"/>
|
|
||||||
</Delete>
|
|
||||||
</DefaultRolloverStrategy>
|
|
||||||
</RollingFile>
|
|
||||||
<RollingFile name="error" fileName="${log-path}/error/smart-admin_error.log"
|
|
||||||
filePattern="${log-path}/error/smart-admin_error_%d{yyyy-MM-dd}-%i.log">
|
|
||||||
<Filters>
|
|
||||||
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
|
|
||||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
|
||||||
</Filters>
|
|
||||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
|
||||||
<SizeBasedTriggeringPolicy size="10 MB"/>
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="30">
|
|
||||||
<Delete basePath="${log-path}/error" maxDepth="1">
|
|
||||||
<IfFileName glob="smart-admin_error_*.log"/>
|
|
||||||
<IfLastModified age="15d"/>
|
|
||||||
</Delete>
|
|
||||||
</DefaultRolloverStrategy>
|
|
||||||
</RollingFile>
|
|
||||||
</Appenders>
|
|
||||||
<Loggers>
|
|
||||||
<Root level="info">
|
|
||||||
<AppenderRef ref="Console"/>
|
|
||||||
<AppenderRef ref="debug"/>
|
|
||||||
<AppenderRef ref="info"/>
|
|
||||||
<AppenderRef ref="warn"/>
|
|
||||||
<AppenderRef ref="error"/>
|
|
||||||
</Root>
|
|
||||||
</Loggers>
|
|
||||||
</Configuration>
|
|
Loading…
Reference in New Issue
Block a user