Authored by wujiexiang

新增日志文件

... ... @@ -16,9 +16,9 @@ import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohoufo.order.service.IBuyerOrderService;
import com.yohoufo.order.service.impl.SellerFeeService;
import com.yohoufo.order.service.impl.SellerOrderService;
import com.yohoufo.order.utils.LoggerUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
... ... @@ -26,7 +26,7 @@ import java.util.Objects;
@RestController
public class BuyerOrderController {
private final Logger LOG = LoggerFactory.getLogger(BuyerOrderController.class);
private final Logger LOG = LoggerUtils.getBuyerOrderLogger();
@Autowired
IBuyerOrderService buyerOrderService;
... ...
... ... @@ -3,14 +3,12 @@ package com.yohoufo.order.controller;
import com.yoho.core.rest.annotation.ServiceDesc;
import com.yoho.tools.common.beans.ApiResponse;
import com.yohobuy.ufo.model.order.req.BuyerOrderMetaUpdateReq;
import com.yohobuy.ufo.model.user.req.AuthorizeInfoReq;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
import com.yohoufo.dal.user.model.UserAuthorizeInfo;
import com.yohoufo.order.service.IBuyerOrderMetaService;
import com.yohoufo.order.utils.LoggerUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
... ... @@ -20,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping(value="/order/buyerOrderMeta")
@ServiceDesc("orderBuyerOrderMeta")
public class BuyerOrderMeta4PlatformController {
private final Logger logger = LoggerFactory.getLogger(BuyerOrderMeta4PlatformController.class);
private final Logger logger = LoggerUtils.getBuyerOrderLogger();
@Autowired
private IBuyerOrderMetaService buyerOrderMetaService;
... ...
... ... @@ -8,9 +8,9 @@ import com.yohoufo.order.service.IBuyerOrderService;
import com.yohoufo.order.service.IShoppingService;
import com.yohoufo.order.service.impl.SellerOrderService;
import com.yohoufo.order.utils.CouponCodeUtils;
import com.yohoufo.order.utils.LoggerUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
... ... @@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
public class ShoppingController {
private Logger logger = LoggerFactory.getLogger(getClass());
private Logger logger = LoggerUtils.getBuyerOrderLogger();
@Autowired
IShoppingService buyerOrderService;
... ...
... ... @@ -16,9 +16,9 @@ import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.service.AbsBuyerOrderViewService;
import com.yohoufo.order.service.IBuyerOrderMetaService;
import com.yohoufo.order.service.IOrderListService;
import com.yohoufo.order.utils.LoggerUtils;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -30,7 +30,7 @@ import java.util.List;
@Service
public class BuyerOrderListServiceImpl extends AbsOrderListService implements IOrderListService,AbsBuyerOrderViewService {
private final Logger logger = LoggerFactory.getLogger(getClass());
private final Logger logger = LoggerUtils.getBuyerOrderLogger();
@Autowired
BuyerOrderMapper buyerOrderMapper;
... ...
... ... @@ -13,9 +13,9 @@ import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohoufo.order.service.IBuyerOrderMetaService;
import com.yohoufo.order.service.cache.CacheCleaner;
import com.yohoufo.order.service.cache.CacheKeyBuilder;
import com.yohoufo.order.utils.LoggerUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -24,7 +24,7 @@ import java.util.Arrays;
@Service
public class BuyerOrderMetaServiceImpl implements IBuyerOrderMetaService {
private final static Logger logger = LoggerFactory.getLogger(BuyerOrderMetaServiceImpl.class);
private final static Logger logger = LoggerUtils.getBuyerOrderLogger();
@Autowired
private BuyerOrderMetaMapper buyerOrderMetaMapper;
... ...
... ... @@ -38,9 +38,9 @@ import com.yohoufo.order.service.cache.CacheKeyBuilder;
import com.yohoufo.order.service.cache.OrderCacheService;
import com.yohoufo.order.service.proxy.InBoxFacade;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.utils.LoggerUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -51,7 +51,7 @@ import java.util.Objects;
@Service
public class BuyerOrderServiceImpl implements IBuyerOrderService {
private final Logger logger = LoggerFactory.getLogger(getClass());
private final Logger logger = LoggerUtils.getBuyerOrderLogger();
@Autowired
BuyerOrderMapper buyerOrderMapper;
... ...
... ... @@ -38,10 +38,10 @@ import com.yohoufo.order.service.support.CouponSupport;
import com.yohoufo.order.service.support.ShoppingSupport;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import com.yohoufo.order.utils.AddressHelper;
import com.yohoufo.order.utils.LoggerUtils;
import com.yohoufo.order.utils.MathUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.math.BigDecimal;
import java.util.Arrays;
... ... @@ -51,7 +51,7 @@ import org.springframework.stereotype.Service;
@Service
public class ShoppingServiceImpl implements IShoppingService {
private final Logger logger = LoggerFactory.getLogger(getClass());
private final Logger logger = LoggerUtils.getBuyerOrderLogger();
@Autowired
ShoppingSupport shoppingSupport;
... ...
... ... @@ -20,8 +20,8 @@ import com.yohoufo.order.model.dto.OrderBuilder;
import com.yohoufo.order.service.ISubmitOrderService;
import com.yohoufo.order.service.proxy.CouponProxyService;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.utils.LoggerUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
... ... @@ -30,7 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
@Service
public class SubmitOrderServiceImpl implements ISubmitOrderService {
private final static Logger logger = LoggerFactory.getLogger(SubmitOrderServiceImpl.class);
private final static Logger logger = LoggerUtils.getBuyerOrderLogger();
@Autowired
OrderCreateService orderCreateService;
... ...
... ... @@ -28,6 +28,10 @@ public class LoggerUtils {
return buildByName("sellerOrderLog");
}
public static Logger getBuyerOrderLogger(){
return buildByName("buyerOrderLog");
}
static Logger buildByName(String logName){
return LoggerFactory.getLogger(logName);
}
... ...
... ... @@ -191,6 +191,23 @@
</encoder>
</appender>
<appender name="BUYER_ORDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/buyer-order.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/buyer-order.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>${yoho.logs.maxHistory}</maxHistory>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>${yoho.logs.maxFileSize}</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.apache.zookeeper.ClientCnxn" level="WARN" />
<!-- 登录时,如果一个IP在一定时间内登录次数过多,记录日志 appender -->
<logger name="ipLoginMoreLog" level="INFO" additivity="false">
... ... @@ -263,4 +280,8 @@
<logger name="sellerOrderLog" level="INFO" additivity="false">
<appender-ref ref="SELLER_ORDER" />
</logger>
<logger name="buyerOrderLog" level="INFO" additivity="false">
<appender-ref ref="BUYER_ORDER" />
</logger>
</configuration>
\ No newline at end of file
... ...
... ... @@ -492,6 +492,22 @@
</encoder>
</appender>
<appender name="BUYER_ORDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/buyer-order.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${yoho.logs.basedir}/${ufo.gateway.env.namespace}/archived/buyer-order.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>${yoho.logs.maxHistory}</maxHistory>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>${yoho.logs.maxFileSize}</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
</encoder>
</appender>
<!-- 数据库操作日志 -->
<logger name="java.sql.PreparedStatement" value="${yoho.logs.level}"/>
<logger name="java.sql.Connection" value="${yoho.logs.level}"/>
... ... @@ -610,4 +626,8 @@
<logger name="sellerOrderLog" level="INFO" additivity="false">
<appender-ref ref="SELLER_ORDER" />
</logger>
<logger name="buyerOrderLog" level="INFO" additivity="false">
<appender-ref ref="BUYER_ORDER" />
</logger>
</configuration>
... ...