Authored by foxxy

Merge branch 'pt'

... ... @@ -63,7 +63,8 @@ public class BrandAggregation extends AbstractAggregation {
Iterator<? extends Bucket> itSizeAgg = aggregation.getBuckets().iterator();
while (itSizeAgg.hasNext()) {
Bucket ltSize = itSizeAgg.next();
for (String brandId : ltSize.getKeyAsString().split(",")) {
String[] brandIdArray=ltSize.getKeyAsString().split(",");
for (String brandId : brandIdArray) {
brandIds.add(brandId);
}
}
... ...
... ... @@ -119,7 +119,7 @@ public class HelperServiceImpl extends BaseService implements IHelperService, Ap
final String indexName = ISearchConstants.INDEX_NAME_HELPER;
JSONObject cacheObject = searchCacheService.getJSONObjectFromCache(searchCache,indexName, searchParam);
if (cacheObject != null) {
CACHE_MATCH_REQUEST.info("match cache , url is :/helper.json?" + HttpServletRequestUtils.genParamString(paramMap));
CACHE_MATCH_REQUEST.info("match cache , url is :/helper.json? {}" , HttpServletRequestUtils.genParamString(paramMap));
return new SearchApiResult().setData(cacheObject);
}
// 7.查询ES
... ...
... ... @@ -110,7 +110,7 @@ public class ProductListServiceImpl implements IProductListService {
final String indexName = ISearchConstants.INDEX_NAME_PRODUCT_INDEX;
JSONObject cacheObject = searchCacheService.getJSONObjectFromCache(productListSearchCache, indexName, searchParam);
if (cacheObject != null) {
CACHE_MATCH_REQUEST.info("match cache , url is :/productindex/productList.json?" + HttpServletRequestUtils.genParamString(paramMap));
CACHE_MATCH_REQUEST.info("match cache , url is :/productindex/productList.json? {}", HttpServletRequestUtils.genParamString(paramMap));
return new SearchApiResult().setData(cacheObject);
}
... ...
... ... @@ -93,6 +93,17 @@
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger:%line - %msg%n</pattern>
</encoder>
</appender>
<appender name="REQUEST_TIMEOUT_ASYNCFILE" class= "ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold >20</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>256</queueSize>
<neverBlock>true</neverBlock>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref ="REQUEST_TIMEOUT"/>
</appender>
<!-- 数据库超时日志 appender -->
<appender name="DATABASE_TIMEOUT" class="ch.qos.logback.core.rolling.RollingFileAppender">
... ... @@ -148,6 +159,7 @@
</encoder>
</appender>
<!-- 缓存命中请求日志 appender -->
<appender name="CACHE_MATCH_REQUEST_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/cache-match-request.log</file>
... ... @@ -293,22 +305,16 @@
</root>
<!-- http请求处理超时日志 -->
<logger name="com.yoho.core.common.monitor.ThreadProfile" additivity="true">
<level value="INFO"/>
<appender-ref ref="REQUEST_TIMEOUT"/>
<logger name="com.yoho.core.common.monitor.ThreadProfile" additivity="false">
<level value="WARN"/>
<appender-ref ref="REQUEST_TIMEOUT_ASYNCFILE"/>
</logger>
<!-- 数据库处理超时日志 -->
<logger name="com.yoho.core.dal.datasource.DataSourceMethodInterceptor" additivity="true">
<logger name="com.yoho.core.dal.datasource.DataSourceMethodInterceptor" additivity="false">
<level value="INFO"/>
<appender-ref ref="DATABASE_TIMEOUT"/>
</logger>
<!-- 服务请求统计 -->
<logger name="com.yoho.core.common.monitor" additivity="true">
<level value="INFO"/>
<appender-ref ref="REQUEST_STAT"/>
</logger>
<!-- 缓存命中率统计日志 -->
<logger name="CACHE_MATCH" additivity="false">
... ... @@ -317,13 +323,13 @@
</logger>
<!-- 缓存命中请求日志 -->
<logger name="CACHE_MATCH_REQUEST" additivity="false">
<logger name="CACHE_MATCH_REQUEST" additivity="${yoho.logs.level}">
<level value="INFO"/>
<appender-ref ref="CACHE_MATCH_REQUEST_APPENDER"/>
</logger>
<!-- 耗时统计-->
<logger name="CONTROLLER_COST" additivity="false">
<logger name="CONTROLLER_COST" additivity="${yoho.logs.level}">
<level value="INFO"/>
<appender-ref ref="CONTROLLER_COST"/>
</logger>
... ...