Commit f2af037c by ping.wu

日志修改

parent bef298c7
......@@ -60,13 +60,13 @@ public class ShoppingSdkLogUtil implements BeanFactoryAware {
try {
ApiLog.printLog(MessageFormatter.arrayFormat(message, params).getMessage(), param1, param2, param3);
} catch (Exception e) {
com.freemud.application.sdk.api.log.ErrorLog.errorDev("LogUtil.printLog ".concat(message), e, params);
com.freemud.application.sdk.api.log.ErrorLog.errorDev("","LogUtil.printLog ".concat(message), e, params);
}
}
}
public void error(String message, Exception e, Object... params) {
com.freemud.application.sdk.api.log.ErrorLog.errorDev(message, e, params);
com.freemud.application.sdk.api.log.ErrorLog.errorDev("",message, e, params);
}
public void errorSe(String message, Exception e, Object... params) {
......
......@@ -53,12 +53,12 @@ public class LogUtil {
try {
ApiLog.printLog(MessageFormatter.arrayFormat(message, params).getMessage(), param1, param2, param3);
} catch (Exception e) {
ErrorLog.errorDev("LogUtil.printLog ".concat(message), e, params);
ErrorLog.errorDev("","LogUtil.printLog ".concat(message), e, params);
}
}
}
public void error(String message, Exception e, String... params) {
ErrorLog.errorDev(message, e, params);
ErrorLog.errorDev("",message, e, params);
}
private static String getAppName() {
......
......@@ -4383,7 +4383,7 @@ public class OrderAdapter {
payTurnoffRefund = assortmentOpenPlatformPartnerConfig.getPartnerValue();
}
} catch (Exception e) {
AppLogUtil.debugLotsParams("getPayTurnoffRefund error:{}", e.getMessage());
AppLogUtil.errorLog("getPayTurnoffRefund",null,null, e);
}
return payTurnoffRefund;
}
......
......@@ -60,7 +60,7 @@ public class OrderReportJobHandler {
// 数据推送之后的 redis 缓存数据 清理
redisCache.updateTTL(key, 1, TimeUnit.DAYS);
} catch (Exception e) {
AppLogUtil.errorLog("上报门店支付情况 error", null, JSON.toJSONString(e));
AppLogUtil.errorLog("上报门店支付情况 error", null, null,e);
}
}
}
......
......@@ -788,7 +788,7 @@ public abstract class CheckOrderUniversal {
deliveryStartDate = hhmmss.parse(startDateTimeStr);
deliveryEndDate = hhmmss.parse(endDateTimeStr);
} catch (ParseException e) {
AppLogUtil.errorLog("getStoreDeliveryInfo_error", endDateTimeStr, e.getMessage());
AppLogUtil.errorLog("getStoreDeliveryInfo_error", endDateTimeStr, null,e);
}
}
if (deliveryStartDate == null || deliveryEndDate == null) {
......
......@@ -36,7 +36,6 @@ public class OrderCheckAdapter {
AppLogUtil.infoLog("商户:{} shopId:{},没有配置预约单",vo.getPartnerId(),vo.getShopId());
return;
}
AppLogUtil.debugLotsParams("门店:{},外卖预约单状态:{},自提预约单状态:{}", vo.getShopId(), configuration.getDeliveryAppoint(), configuration.getSelfMentionSwitch());
for (OrderCheck orderCheck : orderCheckList) {
if (orderCheck.support(vo.getOrderType())) {
orderCheck.check(vo, storeResponse);
......
......@@ -259,7 +259,7 @@ public class PlatformCouponRelationServiceImpl implements CouponRelationService
MQMessage<OrderResourcePushLogMsgDto> message = new MQMessage<>(header, dto);
mqService.convertAndSend(ORDER_RESOURCE_PUSH_LOG_EXCHANGE, ORDER_RESOURCE_PUSH_LOG_ROUTING_KEY, message);
} catch (Exception e) {
AppLogUtil.errorLog(trackingNo, "sendMessage COUPON_VERIFICATION error!!! routingKey = order-resource-push-log-routing-key", JSONObject.toJSONString(dto), null, e);
AppLogUtil.errorLog( "sendMessage COUPON_VERIFICATION error!!! routingKey = order-resource-push-log-routing-key", JSONObject.toJSONString(dto), null, e);
}
}
}
......@@ -572,7 +572,6 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
sendMessageRequest.setOrderStatus(desc);
sendMessageRequest.setUtcTime(unusualTime);
SendMessageResponse sendMessageResponse = ecologyAdminApplicationClient.sendTemplateMessage(sendMessageRequest);
AppLogUtil.debugLotsParams("调用生态返回参数,订单编号:{},返回信息:{}", orderId, JSONObject.toJSONString(sendMessageResponse));
}
......
......@@ -185,7 +185,7 @@ public class BuriedPointServiceImpl implements BuriedPointService {
}
paySuccessBuridPointDto.setSkus(skus);
AppLogUtil.debugLotsParams("paySuccessBuridPoint {}" + paySuccessBuridPointDto);
// AppLogUtil.debugLotsParams("paySuccessBuridPoint {}" + paySuccessBuridPointDto);
// Integer str = buriedPointClient.returnSubmit(paySuccessBuridPointDto);
} catch (Exception e) {
AppLogUtil.errorLog("paySuccessBuridPoint error" ,null,null, e);
......
......@@ -476,7 +476,7 @@ public class CheckOrder {
deliveryStartDate = hhmmss.parse(startDateTimeStr);
deliveryEndDate = hhmmss.parse(endDateTimeStr);
} catch (ParseException e) {
AppLogUtil.errorLog("getStoreDeliveryInfo_error", endDateTimeStr, e.getMessage());
AppLogUtil.errorLog("getStoreDeliveryInfo_error", endDateTimeStr, null,e);
}
}
if (deliveryStartDate == null || deliveryEndDate == null) {
......
......@@ -218,10 +218,8 @@ public class CollageOrderServiceImpl implements CollageOrderService {
getAuthorizerRequestDto.setAuthorizerAppid(userInfo.getWxAppId());
// 通过partnerId以及appid获取access_token
logUtil.debug("collage access_token request partnerId:{} appId:{}", requestVo.getPartnerId(), userInfo.getWxAppId());
GetTokenResponseDto getTokenResponseDto = ecologyAdminApplicationClient.getAuthorizerAccessToken(getAuthorizerRequestDto);
String accessToken = getTokenResponseDto.getResult().getAccessToken();
logUtil.debug("collage access_token response access_token:{}", accessToken);
// 构造群收款订单创建请求对象
GroupBuyRequest groupBuyRequest = new GroupBuyRequest();
......@@ -289,9 +287,7 @@ public class CollageOrderServiceImpl implements CollageOrderService {
desc.setText_desc(order.getShopName() + DateUtil.getCurrentDate(DateUtil.FORMAT_yyyyMMdd));
groupBuyRequest.setDesc(desc);
logUtil.debug("collage groupBuy request param:{}", groupBuyRequest);
GroupBuyResponse groupBuyResponse = weChatClient.groupBuyCreateOrder(accessToken, groupBuyRequest);
logUtil.debug("collage groupBuy response return:{}", groupBuyResponse);
if (null != groupBuyResponse && groupBuyResponse.getErrcode() == 0) {
GroupBuyResp groupBuyResp = new GroupBuyResp();
......
......@@ -121,7 +121,7 @@ public class CouponServiceImpl implements CouponService {
getMemberCouponListRequestDto.setPageNum(1);
getMemberCouponListRequestDto.setPageSize(Integer.MAX_VALUE);
GetMemberCouponListResponseDto.Result result = getMemberCouponList(getMemberCouponListRequestDto);
AppLogUtil.debugLog("CouponServiceImpl_getMemberCouponList", JSON.toJSONString(getMemberCouponListRequestDto), JSON.toJSONString(result));
AppLogUtil.infoLog("CouponServiceImpl_getMemberCouponList", JSON.toJSONString(getMemberCouponListRequestDto), JSON.toJSONString(result));
List<GetMemberCouponListResponseDto.Result.MemberCoupon> memberCoupons = Lists.newArrayList();
// 过滤优惠券得点餐方式
if (!Objects.isNull(result) && CollectionUtils.isNotEmpty(result.getMemberCoupons())) {
......
......@@ -327,7 +327,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
if (StringUtils.isEmpty(oid)) {
return;
}
AppLogUtil.debugLotsParams("backOrdersStatusChange oid:{} orderStatus:{}", oid, String.valueOf(orderStatus));
// AppLogUtil.debugLotsParams("backOrdersStatusChange oid:{} orderStatus:{}", oid, String.valueOf(orderStatus));
OrderStatusChangeRequestDto requestDto = new OrderStatusChangeRequestDto();
requestDto.setOid(oid);
requestDto.setOrderStatus(orderStatus);
......@@ -697,7 +697,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
orderPayResponse.setOrderId(orderBean.getOid());
return orderPayResponse;
} catch (Exception e) {
AppLogUtil.errorLog("getPreOrderPay_error", JSONObject.toJSONString(orderBean), JSONObject.toJSONString(paymentRequest));
AppLogUtil.errorLog("getPreOrderPay_error", JSONObject.toJSONString(orderBean), JSONObject.toJSONString(paymentRequest),e);
//TODO 邮件告警
return null;
}
......@@ -1363,12 +1363,9 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
BaseOrderResponse baseOrderResponse = orderCenterSdkService.orderRefund(orderRefundRequest);
if (baseOrderResponse == null || baseOrderResponse.getData() == null || !ObjectUtils.equals(ResponseConstant.SUCCESS_RESPONSE_CODE, baseOrderResponse.getErrcode())) {
AppLogUtil.errorLog("mcCafeRefundNotifyCallback", orderRefundRequest, baseOrderResponse);
AppLogUtil.infoLog("mcCafeRefundNotifyCallback", orderRefundRequest, baseOrderResponse);
return refundFailedMessage("create after sale order failed");
}
return newSendPaySuccessNoticeMessage();
}
......@@ -1552,7 +1549,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
queryOrdersRequest2.setTrackingNo(LogThreadLocal.getTrackingNo());
queryOrderResponse = orderCenterSdkService.queryMCCafeOrders(queryOrdersRequest2);
} catch (Exception e) {
AppLogUtil.errorLog("queryOrders_error", gson.toJson(queryOrdersDto), e);
AppLogUtil.errorLog("queryOrders_error", gson.toJson(queryOrdersDto), null,e);
return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR);
}
if (queryOrderResponse == null || !RESPONSE_SUCCESS_CODE.equals(queryOrderResponse.getErrcode())) {
......@@ -1825,7 +1822,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
baseResponseDto.setErrmsg(deliveryBaseResponse.getMsg());
if (deliveryBaseResponse == null || !ResponseConstant.SUCCESS_RESPONSE_CODE.equals(deliveryBaseResponse.getCode())) {
AppLogUtil.errorLog("申请取消配送单失败", cancelDeliveryRequest, deliveryBaseResponse);
AppLogUtil.infoLog("申请取消配送单失败", cancelDeliveryRequest, deliveryBaseResponse);
return baseResponseDto;
}
}
......@@ -1847,7 +1844,6 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
* @param orderBean
*/
public void sendApplyRefundSubscriptionNotice(OrderBean orderBean,OrderRefundVo request) {
AppLogUtil.debugLog("sendApplyRefundSubscriptionNotice", JSONObject.toJSONString(request), null);
String partnerId = orderBean.getCompanyId();
String shopId = orderBean.getShopId();
if(orderBean.getExtInfo() == null){
......@@ -1988,7 +1984,6 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
* @param request
*/
public void asynchronousPrint(OrderPrintDto request) {
AppLogUtil.debugLog("OrderPrintDto", JSONObject.toJSONString(request), null);
Header header = new Header(MQAction.INSERT.getAction(), "asynchronous-print-api", request.getOid() + "", cloudPrintQueue);
MQMessage<OrderPrintDto> message = new MQMessage<>(header, request);
mqService.convertAndSend(cloud_print_exchange, cloudPrintQueue, message);
......@@ -2023,7 +2018,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
request.setThirdPartyMemberId(thirdPartyMemberId);
SendCouponForqujiaDtoResponseDto responseDto = customerExtendClient.sendCouponForqujia(request);
if(!Objects.equals(responseDto.getCode(), ResponseResult.SUCCESS.getCode())){
AppLogUtil.errorLog("sendCouponForqujia", JSON.toJSONString(request), JSON.toJSONString(responseDto));
AppLogUtil.infoLog("sendCouponForqujia", JSON.toJSONString(request), JSON.toJSONString(responseDto));
return false;
}
......@@ -2047,7 +2042,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
McdNetBatchQueryResponse mcdNetBatchQueryResponse = couponClientService.batchQuery(mcCafeCouponRequest);
if (mcdNetBatchQueryResponse == null || !ResponseCodeConstant.RESPONSE_SUCCESS.equals(mcdNetBatchQueryResponse.getStatusCode())
|| CollectionUtils.isEmpty(mcdNetBatchQueryResponse.getCouponlist())) {
AppLogUtil.errorLog("获取优惠券详情失败,发券失败", mcCafeCouponRequest, mcdNetBatchQueryResponse);
AppLogUtil.infoLog("获取优惠券详情失败,发券失败", mcCafeCouponRequest, mcdNetBatchQueryResponse);
return false;
}
Map<String, Integer> cardStatusMap = mcdNetBatchQueryResponse.getCouponlist().stream()
......@@ -2138,7 +2133,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
SendCouponForqujiaDtoResponseDto responseDto = customerExtendClient.sendCouponForqujia(request);
if(!Objects.equals(responseDto.getCode(), ResponseResult.SUCCESS.getCode())
|| responseDto.getData() == null || CollectionUtils.isEmpty(responseDto.getData().getCard_list())){
AppLogUtil.errorLog("发券异常",JSON.toJSONString(request) ,JSON.toJSONString(responseDto));
AppLogUtil.infoLog("发券异常",JSON.toJSONString(request) ,JSON.toJSONString(responseDto));
continue;
}
......@@ -2158,7 +2153,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
McdNetBatchQueryResponse mcdNetBatchQueryResponse = couponClientService.batchQuery(mcCafeCouponRequest);
if (mcdNetBatchQueryResponse == null || !ResponseCodeConstant.RESPONSE_SUCCESS.equals(mcdNetBatchQueryResponse.getStatusCode())
|| CollectionUtils.isEmpty(mcdNetBatchQueryResponse.getCouponlist())) {
AppLogUtil.errorLog("获取优惠券详情失败,发券失败" , JSON.toJSONString(mcCafeCouponRequest) , JSON.toJSONString(mcdNetBatchQueryResponse));
AppLogUtil.infoLog("获取优惠券详情失败,发券失败" , JSON.toJSONString(mcCafeCouponRequest) , JSON.toJSONString(mcdNetBatchQueryResponse));
return false;
}
......@@ -2174,7 +2169,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
Optional<McdNetBatchQueryResponse.Coupon> couponOptional = mcdNetBatchQueryResponse.getCouponlist().stream()
.filter(o -> ResponseCodeConstant.RESPONSE_SUCCESS.equals(o.getStatusCode())).findFirst();
if(!couponOptional.isPresent()) {
AppLogUtil.errorLog("没有有效的优惠券,更新失败" , JSON.toJSONString(mcCafeCouponRequest) , JSON.toJSONString(mcdNetBatchQueryResponse));
AppLogUtil.infoLog("没有有效的优惠券,更新失败" , JSON.toJSONString(mcCafeCouponRequest) , JSON.toJSONString(mcdNetBatchQueryResponse));
continue;
} else {
couponCode = couponOptional.get().getCode();
......@@ -2184,14 +2179,14 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
Optional<McdNetBatchQueryResponse.Coupon> couponOptional = mcdNetBatchQueryResponse.getCouponlist().stream()
.filter(o -> ResponseCodeConstant.RESPONSE_SUCCESS.equals(o.getStatusCode())).findFirst();
if(!couponOptional.isPresent()) {
AppLogUtil.errorLog("没有有效的优惠券,更新失败" , JSON.toJSONString(mcCafeCouponRequest) , JSON.toJSONString(mcdNetBatchQueryResponse));
AppLogUtil.infoLog("没有有效的优惠券,更新失败" , JSON.toJSONString(mcCafeCouponRequest) , JSON.toJSONString(mcdNetBatchQueryResponse));
continue;
} else {
couponCode = couponOptional.get().getCode();
}
}
if(StringUtils.isBlank(couponCode)) {
AppLogUtil.errorLog("没有匹配的优惠券,更新失败" , JSON.toJSONString(mcCafeCouponRequest) , JSON.toJSONString(mcdNetBatchQueryResponse));
AppLogUtil.infoLog("没有匹配的优惠券,更新失败" , JSON.toJSONString(mcCafeCouponRequest) , JSON.toJSONString(mcdNetBatchQueryResponse));
continue;
}
UpdateCouponCodeReq.CouponUpdateInfo couponUpdateInfo = new UpdateCouponCodeReq.CouponUpdateInfo();
......
......@@ -392,7 +392,7 @@ public class MallOrderServiceImpl implements MallOrderService {
putDelMq(request.getPartnerId(), request.getStoreId(), responseBase.getData().getFmId(), orderBean.getOid());
return orderPayResponse;
} catch (Exception e) {
AppLogUtil.errorLog("getPreOrderPay_error", JSONObject.toJSONString(orderBean), JSONObject.toJSONString(paymentRequest));
AppLogUtil.errorLog("getPreOrderPay_error", JSONObject.toJSONString(orderBean), JSONObject.toJSONString(paymentRequest),e);
//TODO 邮件告警
return null;
}
......@@ -567,7 +567,7 @@ public class MallOrderServiceImpl implements MallOrderService {
AppLogUtil.infoLog("paySuccessCallback_acceptOrder_faild", gson.toJson(confirmOrderDto), gson.toJson(payAccessResponse));
}
}catch (Exception e){
AppLogUtil.errorLog("paySuccessCallback_acceptOrder_error",orderId,e);
AppLogUtil.errorLog("paySuccessCallback_acceptOrder_error",orderId,null,e);
}
}
}
......
......@@ -380,12 +380,10 @@ public class OrderAdapterServiceImpl implements OrderAdapterService {
// 通过交易号从缓存中拿订单号,如果有数据则实际订单号为其value值
String orderId = redisCache.getValue(RedisUtil.getPaymentTransIdOrderKey(confirmOrderDto.getOrderId()));
if (StringUtils.isNotBlank(orderId)) {
AppLogUtil.debugLotsParams("从缓存中获取的订单数据,trackingNo:{},transId:{},orderId:{}", LogThreadLocal.getTrackingNo(), confirmOrderDto.getOrderId(), orderId);
confirmOrderDto.setOrderId(orderId);
}
Map<String, QueryOrdersResponseDto.DataBean.OrderBean> orderBeans = orderService.getOrderBeanByOrderId(confirmOrderDto.getOrderId());
if (MapUtils.isEmpty(orderBeans)) {
AppLogUtil.debugLotsParams("paySuccessCallback_queryOrderById_faild, trackingNo:{},PaysuccessNoticeMessage:{}", LogThreadLocal.getTrackingNo(), gson.toJson(message));
return gson.toJson(message);
}
QueryOrdersResponseDto.DataBean.OrderBean orderBean = orderBeans.get(OrderBeanType.SAASORDER.getCode());
......
......@@ -148,7 +148,7 @@ public class OrderCommonService {
orderExtInfoDto.setPrePayTransId(request.getTransId());
} catch (Exception e) {
AppLogUtil.errorLog("getPreOrderPay_error", JSONObject.toJSONString(orderBean), JSONObject.toJSONString(paymentRequest));
AppLogUtil.errorLog("getPreOrderPay_error", JSONObject.toJSONString(orderBean), JSONObject.toJSONString(paymentRequest),e);
//给出支付失败提示
return null;
}
......
......@@ -671,7 +671,7 @@ public class OrderServiceImpl implements Orderservice {
}
// 尝试开通会员卡失败三次
if (i >= count) {
AppLogUtil.errorLog("尝试开通会员卡失败" + count + "次", JSON.toJSONString(purchasePaidRequestDto), JSON.toJSONString(baseResponse));
AppLogUtil.infoLog("尝试开通会员卡失败" + count + "次", JSON.toJSONString(purchasePaidRequestDto), JSON.toJSONString(baseResponse));
}
}
}
......@@ -2374,7 +2374,7 @@ public class OrderServiceImpl implements Orderservice {
} else {
productDto.setCustomerCode("");
productDto.setProductCode("");
AppLogUtil.errorLog("getProducts_exception", JSONObject.toJSONString(pids), JSONObject.toJSONString(products));
AppLogUtil.infoLog("getProducts_exception", JSONObject.toJSONString(pids), JSONObject.toJSONString(products));
}
//套餐子商品
if (CollectionUtils.isNotEmpty(productDto.getComboProduct())) {
......@@ -3064,7 +3064,6 @@ public class OrderServiceImpl implements Orderservice {
* @param orderBean
*/
public void sendApplyRefundSubscriptionNotice(OrderBean orderBean, OrderRefundVo request) {
AppLogUtil.debugLog("sendApplyRefundSubscriptionNotice", JSONObject.toJSONString(request), null);
// String partnerId = orderBean.getCompanyId();
// String shopId = orderBean.getShopId();
// if (orderBean.getExtInfo() == null) {
......@@ -3876,7 +3875,7 @@ public class OrderServiceImpl implements Orderservice {
totalOrders = null == orderInfoReqs.getTotalNum() ? 0 : orderInfoReqs.getTotalNum();
result.put("totalOrders", totalOrders);
} catch (Exception e) {
AppLogUtil.errorLog("queryTodayOrders", gson.toJson(queryOrderByConditionsRequestVo), e);
AppLogUtil.errorLog("queryTodayOrders", gson.toJson(queryOrderByConditionsRequestVo),null, e);
return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR);
}
return ResponseUtil.success(result);
......
......@@ -804,7 +804,7 @@ public class SellCouponOrderServiceImpl {
// 订单支付成功
PayAccessResponse payAccessResponse = orderBusinessService.payAccess(var1);
}catch (Exception e){
AppLogUtil.errorLog(LogThreadLocal.getTrackingNo(),"sdkPayAccessError",JSONObject.toJSONString(var1),null,e);
AppLogUtil.errorLog("sdkPayAccessError",JSONObject.toJSONString(var1),null,e);
}
//支付成功直接完成
OrderChangeStateReq request = new OrderChangeStateReq();
......
......@@ -1121,7 +1121,7 @@ public abstract class UniversalOrderService {
}
} catch (Exception e) {
AppLogUtil.errorLog("getPreOrderPay_error", JSONObject.toJSONString(orderBean), JSONObject.toJSONString(paymentRequest));
AppLogUtil.errorLog("getPreOrderPay_error", JSONObject.toJSONString(orderBean), JSONObject.toJSONString(paymentRequest),e);
//TODO 邮件告警
orderPayResponse = new OrderPayResponse();
orderPayResponse.setMsg("getPreOrderPay_error");
......
......@@ -385,7 +385,7 @@ public class SaasMallOrderService extends UniversalOrderService {
orderPayResponse.setOrderId(orderBean.getOid());
return orderPayResponse;
} catch (Exception e) {
AppLogUtil.errorLog("getPreOrderPay_error", JSONObject.toJSONString(orderBean), JSONObject.toJSONString(paymentRequest));
AppLogUtil.errorLog("getPreOrderPay_error", JSONObject.toJSONString(orderBean), JSONObject.toJSONString(paymentRequest),e);
//TODO 邮件告警
return null;
}
......
......@@ -61,18 +61,19 @@ public class AppLogUtil implements BeanFactoryAware {
private static volatile String appName = "NO_APP_NAME";
public void debug(String message, Object... params) {
if (logger.isDebugEnabled()) {
logUtil.info(message, params);
}
}
// public void debug(String message, Object... params) {
// if (logger.isDebugEnabled()) {
// logUtil.info(message, params);
// }
// }
public void info(String message, Object... params) {
logUtil.info(message,params);
}
public void error(String message, Exception e, String... params) {
logUtil.errorDev("",message, e, params);
}
// public void error(String message, Exception e, String... params) {
// logUtil.errorDev("",message, e, params);
// }
// public void error(String message, Object... params) {
// ErrorLog.errorDev(message, params);
// }
......@@ -86,21 +87,21 @@ public class AppLogUtil implements BeanFactoryAware {
return beanFactory.getBean("logUtil", LogUtil.class);
}
public static void debugLog(String message, Object requestParams, Object responseParams) {
if (requestParams != null) {
message = message.concat(" requestParams:{}");
}
if (responseParams == null) {
message = message.concat(" responseParams:{}");
}
getLogUtil().debug(message, requestParams, responseParams);
}
public static void debugLotsParams(String message, Object... params) {
if (logger.isDebugEnabled()) {
getLogUtil().debug(message, params);
}
}
// public static void debugLog(String message, Object requestParams, Object responseParams) {
// if (requestParams != null) {
// message = message.concat(" requestParams:{}");
// }
// if (responseParams == null) {
// message = message.concat(" responseParams:{}");
// }
// getLogUtil().debug(message, requestParams, responseParams);
// }
//
// public static void debugLotsParams(String message, Object... params) {
// if (logger.isDebugEnabled()) {
// getLogUtil().debug(message, params);
// }
// }
public static void infoLog(String message, Object requestParams, Object responseParams) {
getLogUtil().info(message.concat(" requestParams:{} responseParams:{}"),requestParams,responseParams);
......@@ -113,17 +114,17 @@ public class AppLogUtil implements BeanFactoryAware {
getLogUtil().info(message.concat(" requestParams:{} responseParams:{}"),requestParams,responseParams);
}
public static void errorLog(String message, Object requestParams, Object responseParams) {
getLogUtil().error(message.concat(" requestParams:{} responseParams:{}"),null,requestParams,responseParams);
}
// public static void errorLog(String message, Object requestParams, Object responseParams) {
// getLogUtil().error(message.concat(" requestParams:{} responseParams:{}"),null,requestParams,responseParams);
// }
public static void errorLog(String message, String requestParams, String responseParams, Exception e) {
getLogUtil().error(message.concat(" requestParams:{} responseParams:{}"),e,requestParams,responseParams);
getLogUtil().error("",message.concat(" requestParams:{} responseParams:{}"),e,requestParams,responseParams);
}
public static void errorLog(String trackingId, String message, String requestParams, String responseParams, Exception e) {
getLogUtil().error(message.concat(" requestParams:{} responseParams:{}"),e,requestParams,responseParams);
}
// public static void errorLog(String trackingId, String message, String requestParams, String responseParams, Exception e) {
// getLogUtil().error(message.concat(" requestParams:{} responseParams:{}"),e,requestParams,responseParams);
// }
public static void printLog(String message, Object requestParams, Object responseParams) {
getLogUtil().info(message.concat(" requestParams:{} responseParams:{}"),requestParams,responseParams);
......@@ -153,12 +154,12 @@ public class AppLogUtil implements BeanFactoryAware {
url = thirdPartLogVo.getUri();
methodName = thirdPartLogVo.getMethodName();
}
getLogUtil().error("createAt:{} appName:{} trackingNo:{} thirdPartyName:{} timeConsumed:{} url:{} methodName:{} request:{} stackTrack:{}",null, DateUtil.convert2String(Calendar.getInstance().getTime()
getLogUtil().error("","createAt:{} appName:{} trackingNo:{} thirdPartyName:{} timeConsumed:{} url:{} methodName:{} request:{} stackTrack:{}",null, DateUtil.convert2String(Calendar.getInstance().getTime()
, "yyyy-MM-dd HH:mm:ss"), appName, tracking, thirdPartyName, endTime - startTime, url, methodName
, requestDataConvert, JSONObject.toJSONString(errorObject));
} catch (Exception e) {
getLogUtil().error("LogUtilError stackTrack",e,null);
getLogUtil().error("","LogUtilError stackTrack",e,null);
}
}
......@@ -208,7 +209,7 @@ public class AppLogUtil implements BeanFactoryAware {
method = targetClass.getMethod(joinPoint.getSignature().getName(), argTypes);
}
} catch (NoSuchMethodException e) {
AppLogUtil.errorLog("", serviceName, JSON.toJSONString(joinPoint.getArgs()), e);
AppLogUtil.errorLog("createThirdPartLogVo", serviceName, JSON.toJSONString(joinPoint.getArgs()), e);
}
if(method != null) {
methodName = method.getName();
......@@ -232,7 +233,7 @@ public class AppLogUtil implements BeanFactoryAware {
thirdPartLogVo.setRequestBody(requestBody);
return thirdPartLogVo;
} catch (Exception e) {
getLogUtil().error("LogUtilError stackTrack:{}", e);
getLogUtil().error("","LogUtilError stackTrack:{}", e);
return null;
}
}
......
......@@ -91,7 +91,7 @@ public class OrderCountJobHandler extends IJobHandler {
BaseResponse baseResponse = microOpenplatformClient.addOrderSum(build);
// AppLogUtil.infoLog("orderCountJobHandlersendreportorderend", JSON.toJSONString(build), JSON.toJSONString(baseResponse));
} catch (Exception e) {
AppLogUtil.errorLog("orderCountJobHandlersendreportorderend", null, JSON.toJSONString(e));
AppLogUtil.errorLog("orderCountJobHandlersendreportorderend", null, null,e);
}
return ReturnT.SUCCESS;
}
......
......@@ -59,7 +59,7 @@ public class CouoponOnlineTest {
String sign = SignUtil.createMD5Sign(requestDto, appSecret);
requestDto.setSign(sign);
BatchQueryActivityInfoResponseDto batchQueryActivityInfoResponseDto = cardBinClient.batchQueryActivityInfo(requestDto);
AppLogUtil.debugLog("batchQueryActivityInfoTest", JSON.toJSONString(requestDto), JSON.toJSONString(batchQueryActivityInfoResponseDto));
// AppLogUtil.debugLog("batchQueryActivityInfoTest", JSON.toJSONString(requestDto), JSON.toJSONString(batchQueryActivityInfoResponseDto));
}
......
......@@ -390,7 +390,7 @@ public class OrderDownLoadSdkService {
return queryResponse;
}catch (Exception e){
// 不要影响主流程
logUtil.error("Redis替换ES异常 queryResponse:{} error", e,queryResponse);
logUtil.error("","Redis替换ES异常 queryResponse:{} error", e,queryResponse);
return queryResponse;
}
}
......
......@@ -54,15 +54,12 @@ public class LogUtil {
try {
ApiLog.printLog(MessageFormatter.arrayFormat(message, params).getMessage(), param1, param2, param3);
} catch (Exception e) {
ErrorLog.errorDev("LogUtil.printLog ".concat(message), e, params);
ErrorLog.errorDev("","LogUtil.printLog".concat(message), e, params);
}
}
}
public void error(String message, Exception e, Object... params) {
ErrorLog.errorDev(message, e, params);
}
public void errorDev(String statusCode, String message,Exception e, Object... params) {
public void error(String statusCode, String message, Exception e, Object... params) {
ErrorLog.errorDev(statusCode,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