Commit 512607ee by ping.wu

LogUtil重复修改

parent 91455e8d
......@@ -23,9 +23,7 @@ import cn.freemud.entities.dto.OrderStatusChangeRequestDto;
import cn.freemud.entities.dto.UserLoginInfoDto;
import cn.freemud.entities.dto.WechatReportOrderDto;
import cn.freemud.entities.vo.OrderCallBackRequestVo;
import cn.freemud.entities.vo.OrderInfo;
import cn.freemud.redis.RedisCache;
import cn.freemud.utils.LogUtil;
import com.alibaba.fastjson.JSONObject;
import com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformWxapp;
import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformWxappManager;
......@@ -37,6 +35,7 @@ import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderInfoR
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderItemResp;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderPayItemReqs;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderSettlementResp;
import com.freemud.application.sdk.api.ordercenter.util.LogUtil;
import com.freemud.sdk.api.assortment.orderdistributor.request.DisRequest;
import com.freemud.sdk.api.assortment.orderdistributor.service.OrderDistributionService;
import com.google.common.collect.Lists;
......@@ -375,7 +374,7 @@ public class OrderCallBackMQService {
mqService.convertAndSend(OrderCallBackConfig.TOPIC_EXCHANGE_NAME, OrderCallBackConfig.ZFB_ORDER_SEND_QUEUE_ROUTING_KEY, message);
}
}catch (Exception e){
logUtil.error("sendzfbOrderMQ orderCode:{} ", e,body.getOrderCode());
logUtil.error("","sendzfbOrderMQ orderCode:{} ", e,body.getOrderCode());
}
}
}
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: LogUtil
* @Package cn.freemud.utils
* @Description:
* @author: liming.guo
* @date: 2018/7/3 12:01
* @version V1.0
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
package cn.freemud.utils;
import cn.freemud.base.ApplicationContextWare;
import com.alibaba.fastjson.JSON;
import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.log.ErrorLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.helpers.MessageFormatter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class LogUtil {
@Value("${print-debug-log:false}")
private boolean printDebug;
private static Logger logger = LoggerFactory.getLogger(LogUtil.class);
private static volatile String appName = "NO_APP_NAME";
public void debug(String message, Object... params) {
if (logger.isDebugEnabled()) {
this.info(message, params);
}
}
public void info(String message, Object... params) {
if (printDebug) {
Object[] clone = params != null ? params.clone() : new String[]{};
String param1 = "", param2 = "", param3 = "";
if (params.length > 0) {
param1 = clone[0] instanceof String ? (String) clone[0] : JSON.toJSONString(clone[0]);
}
if (params.length > 1) {
param2 = clone[1] instanceof String ? (String) clone[1] : JSON.toJSONString(clone[1]);
}
if (params.length > 2) {
param3 = clone[2] instanceof String ? (String) clone[2] : JSON.toJSONString(clone[2]);
}
try {
ApiLog.printLog(MessageFormatter.arrayFormat(message, params).getMessage(), param1, param2, param3);
} catch (Exception e) {
ErrorLog.errorDev("","LogUtil.printLog ".concat(message), e, params);
}
}
}
public void error(String message, Exception e, String... params) {
ErrorLog.errorDev("",message, e, params);
}
private static String getAppName() {
if (appName == null) {
appName = ApplicationContextWare.getAppName();
if (appName == null) {
appName = "NO_APP_NAME";
}
}
return appName;
}
public void errorSe(String message, Exception e, String... params) {
ErrorLog.errorSe(message, e, params);
}
}
///**
// * All rights Reserved, Designed By www.freemud.cn
// *
// * @Title: LogUtil
// * @Package cn.freemud.utils
// * @Description:
// * @author: liming.guo
// * @date: 2018/7/3 12:01
// * @version V1.0
// * @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
// * 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
// */
//package cn.freemud.utils;
//
//import cn.freemud.base.ApplicationContextWare;
//import com.alibaba.fastjson.JSON;
//import com.freemud.application.sdk.api.log.ApiLog;
//import com.freemud.application.sdk.api.log.ErrorLog;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.slf4j.helpers.MessageFormatter;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Component;
//
//@Component
//public class LogUtil {
//
// @Value("${print-debug-log:false}")
// private boolean printDebug;
//
// private static Logger logger = LoggerFactory.getLogger(LogUtil.class);
//
// private static volatile String appName = "NO_APP_NAME";
//
// public void debug(String message, Object... params) {
// if (logger.isDebugEnabled()) {
// this.info(message, params);
// }
// }
// public void info(String message, Object... params) {
// if (printDebug) {
// Object[] clone = params != null ? params.clone() : new String[]{};
// String param1 = "", param2 = "", param3 = "";
// if (params.length > 0) {
// param1 = clone[0] instanceof String ? (String) clone[0] : JSON.toJSONString(clone[0]);
// }
// if (params.length > 1) {
// param2 = clone[1] instanceof String ? (String) clone[1] : JSON.toJSONString(clone[1]);
// }
// if (params.length > 2) {
// param3 = clone[2] instanceof String ? (String) clone[2] : JSON.toJSONString(clone[2]);
// }
// try {
// ApiLog.printLog(MessageFormatter.arrayFormat(message, params).getMessage(), param1, param2, param3);
// } catch (Exception e) {
// ErrorLog.errorDev("","LogUtil.printLog ".concat(message), e, params);
// }
// }
// }
// public void error(String message, Exception e, String... params) {
// ErrorLog.errorDev("",message, e, params);
// }
//
// private static String getAppName() {
// if (appName == null) {
// appName = ApplicationContextWare.getAppName();
// if (appName == null) {
// appName = "NO_APP_NAME";
// }
// }
// return appName;
// }
//
//
// public void errorSe(String message, Exception e, String... params) {
// ErrorLog.errorSe(message, e, params);
// }
//}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment