Authored by hugufei

Merge branch 'master' into dev

... ... @@ -275,6 +275,8 @@ public class SearchController {
String val = ((String[]) paramMap.get(key))[0];
resultMap.put(key, val);
}
resultMap.put("Referer", request.getHeader("Referer"));
resultMap.put("User-Agent", request.getHeader("User-Agent"));
return resultMap;
}
... ...
... ... @@ -129,6 +129,24 @@
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger:%line - %msg%n</pattern>
</encoder>
</appender>
<!-- 缓存命中统计 appender -->
<appender name="CACHE_MATCH" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/cache-match.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>${yoho.logs.basedir}/${yoho.search.service.env.namespace}/archived/cache-match.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>${yoho.logs.maxFileSize}</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- keep 30 days' worth of history -->
<maxHistory>${yoho.logs.maxHistory}</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger:%line - %msg%n</pattern>
</encoder>
</appender>
<!-- 数据库操作日志 -->
<logger name="java.sql.PreparedStatement" value="${yoho.logs.level}" />
... ... @@ -165,5 +183,11 @@
<level value="INFO"/>
<appender-ref ref="REQUEST_STAT"/>
</logger>
<!-- 缓存命中统计日志 -->
<logger name="com.yoho.search.cache.CacheService" additivity="false">
<level value="INFO"/>
<appender-ref ref="CACHE_MATCH"/>
</logger>
</configuration>
\ No newline at end of file
... ...