SearchCacheMatchLogger.java 779 Bytes
package com.yoho.search.common.cache;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.yoho.search.base.utils.HttpServletRequestUtils;

public class SearchCacheMatchLogger {

	private static final Logger CACHE_MATCH_REQUEST = LoggerFactory.getLogger("CACHE_MATCH_REQUEST");

	public static void doSearchCacheMatchLog(String url, Map<String, String> paramMap) {
		if(CACHE_MATCH_REQUEST.isInfoEnabled()){
			CACHE_MATCH_REQUEST.info("match cache , url is :{}?{}", url, HttpServletRequestUtils.genParamString(paramMap));
		}
	}

	public static void doSearchCacheMatchLog(String method, String key) {
		if(CACHE_MATCH_REQUEST.isInfoEnabled()){
			CACHE_MATCH_REQUEST.info("match cache , method is :{}, key is {}", method, key);
		}
	}

}