refactor(log): 调整日志记录策略并优化相关代码
- 在多个插件的 executeBusiness 方法中添加触发调用的日志记录 - 注释掉部分冗余的日志记录代码,以提高性能 - 修改 logback-spring.xml 配置,暂时移除 ALL_FILE 日志输出
This commit is contained in:
parent
14a21b3168
commit
d12b204b9d
|
@ -138,6 +138,7 @@ public class ConsignmachiningIn extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
logger.info("触发调用:{}" + getPluginName());
|
||||
try {
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -140,6 +140,7 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
logger.info("触发调用:{}" + getPluginName());
|
||||
try {
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -137,6 +137,7 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
logger.info("触发调用:{}" + getPluginName());
|
||||
try {
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -131,6 +131,7 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
logger.info("触发调用:{}" + getPluginName());
|
||||
try {
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -134,6 +134,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
logger.info("触发调用:{}" + getPluginName());
|
||||
try {
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -115,6 +115,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
logger.info("触发调用:{}" + getPluginName());
|
||||
try {
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -119,6 +119,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
logger.info("触发调用:{}" + getPluginName());
|
||||
try {
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -104,6 +104,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
logger.info("触发调用:{}" + getPluginName());
|
||||
try {
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -103,6 +103,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
logger.info("触发调用:{}" + getPluginName());
|
||||
try {
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
@ -142,7 +143,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
}
|
||||
}, "执行插件:" + getPluginName());
|
||||
thread.start();
|
||||
|
||||
|
||||
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
|
||||
try {
|
||||
thread.join();
|
||||
|
|
|
@ -160,14 +160,15 @@
|
|||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="WARN_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="ALL_FILE"/>
|
||||
<!-- <appender-ref ref="ALL_FILE"/>-->
|
||||
</root>
|
||||
|
||||
<!-- ERROR 级别-->
|
||||
<root level="ERROR">
|
||||
<!-- 按照每天生成日志文档 -->
|
||||
<appender-ref ref="INFO_FILE"/>
|
||||
<appender-ref ref="WARN_FILE"/>
|
||||
<appender-ref ref="ERROR_FILE"/>
|
||||
<appender-ref ref="ALL_FILE"/>
|
||||
</root>
|
||||
<!-- <root level="ERROR">-->
|
||||
<!-- <!– 按照每天生成日志文档 –>-->
|
||||
<!-- <appender-ref ref="INFO_FILE"/>-->
|
||||
<!-- <appender-ref ref="WARN_FILE"/>-->
|
||||
<!-- <appender-ref ref="ERROR_FILE"/>-->
|
||||
<!-- <appender-ref ref="ALL_FILE"/>-->
|
||||
<!-- </root>-->
|
||||
</configuration>
|
||||
|
|
|
@ -138,10 +138,11 @@ public class EntranceServiceImpl implements IEntranceService {
|
|||
}
|
||||
JsonResultEntity jsonResultEntity;
|
||||
try {
|
||||
//先注释掉,观察调用的性能
|
||||
// logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>请求的参数:jsonObject:" + jsonObject.toJSONString());
|
||||
logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
// logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
jsonResultEntity = (JsonResultEntity) m.invoke(object, jsonObject);
|
||||
logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
// logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
return jsonResultEntity;
|
||||
} catch (Exception e) {
|
||||
logger.error("METHOD doBusiness invokeException{}", e.getMessage());
|
||||
|
|
Loading…
Reference in New Issue