本文整理匯總了Java中com.feilong.servlet.http.entity.RequestLogSwitch類的典型用法代碼示例。如果您正苦於以下問題:Java RequestLogSwitch類的具體用法?Java RequestLogSwitch怎麽用?Java RequestLogSwitch使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RequestLogSwitch類屬於com.feilong.servlet.http.entity包,在下文中一共展示了RequestLogSwitch類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: logException
import com.feilong.servlet.http.entity.RequestLogSwitch; //導入依賴的package包/類
/**
* Log exception.
*
* @param e
* the e
* @since 1.5.5
*/
protected void logException(Exception e){
if (LOGGER.isErrorEnabled()){
RequestLogSwitch requestLogSwitch = RequestLogSwitch.NORMAL_WITH_IDENTITY_INCLUDE_FORWARD;
Map<String, Object> map = RequestUtil.getRequestInfoMapForLog(getHttpServletRequest(), requestLogSwitch);
LOGGER.error(Slf4jUtil.format("request info:{},tag is:[{}]", JsonUtil.format(map), getClass().getSimpleName()), e);
}
}
示例2: doPostHandle
import com.feilong.servlet.http.entity.RequestLogSwitch; //導入依賴的package包/類
@Override
public void doPostHandle(HttpServletRequest request,HttpServletResponse response,Object handler,ModelAndView modelAndView){
//是否支持解析,有可能在xml裏麵配置的一些不相關的路徑透過到了這個攔截器
//比如 配置的 mapping path 是 item/* 但是有一些url地址是 item/wishlist 諸如此類的也到了該攔截器
boolean isSupport = isSupport(request, handler, modelAndView);
if (!isSupport){
if (LOGGER.isInfoEnabled()){
LOGGER.info(
"current request:[{}] not support this BrowsingHistoryInterceptor,maybe you can config path in spring config 'mvc:exclude-mapping' node!",
JsonUtil.format(RequestUtil.getRequestInfoMapForLog(request)));
}
return;
}
//---------------------------------------------------------------
BrowsingHistoryCommand browsingHistoryCommand = constructBrowsingHistoryCommand(request, response, handler, modelAndView);
if (null != browsingHistoryCommand){
browsingHistoryResolver.add(browsingHistoryCommand, request, response);
return;
}
//---------------------------------------------------------------
if (LOGGER.isDebugEnabled()){
LOGGER.debug(
"browsingHistoryCommand is null,don't add browsingHistory,request info:{}",
JsonUtil.format(RequestUtil.getRequestInfoMapForLog(request, RequestLogSwitch.NORMAL)));
}
return;
}
示例3: MonitorMessageEntity
import com.feilong.servlet.http.entity.RequestLogSwitch; //導入依賴的package包/類
/**
* Instantiates a new monitor message entity.
*
* @param requestLogSwitch
* the request log switch
* @param isShowRequestAttribute
* the is show request attribute
*/
public MonitorMessageEntity(RequestLogSwitch requestLogSwitch, boolean isShowRequestAttribute){
super();
this.requestLogSwitch = requestLogSwitch;
this.isShowRequestAttribute = isShowRequestAttribute;
}
示例4: getRequestLogSwitch
import com.feilong.servlet.http.entity.RequestLogSwitch; //導入依賴的package包/類
/**
* 獲得 request log switch.
*
* @return the requestLogSwitch
*/
public RequestLogSwitch getRequestLogSwitch(){
return requestLogSwitch;
}
示例5: setRequestLogSwitch
import com.feilong.servlet.http.entity.RequestLogSwitch; //導入依賴的package包/類
/**
* 設置 request log switch.
*
* @param requestLogSwitch
* the requestLogSwitch to set
*/
public void setRequestLogSwitch(RequestLogSwitch requestLogSwitch){
this.requestLogSwitch = requestLogSwitch;
}
示例6: RequestLogBuilder
import com.feilong.servlet.http.entity.RequestLogSwitch; //導入依賴的package包/類
/**
* The Constructor.
*
* @param request
* the request
* @param requestLogSwitch
* the request log switch
*/
public RequestLogBuilder(HttpServletRequest request, RequestLogSwitch requestLogSwitch){
super();
this.request = request;
this.requestLogSwitch = requestLogSwitch;
}
示例7: getClientIP
import com.feilong.servlet.http.entity.RequestLogSwitch; //導入依賴的package包/類
/**
* 如果需要顯示客戶端ip,那麽顯示,否則不顯示.
*
* @param opRequestLogSwitch
* the op request log switch
* @return the client IP
* @since 1.10.6
*/
private String getClientIP(RequestLogSwitch opRequestLogSwitch){
return (opRequestLogSwitch.getShowIdentity() || opRequestLogSwitch.getShowIPs()) ? RequestUtil.getClientIp(request) : null;
}
示例8: getRequestInfoMapForLog
import com.feilong.servlet.http.entity.RequestLogSwitch; //導入依賴的package包/類
/**
* 將 {@link HttpServletRequest} 相關屬性,數據轉成json格式 以便log顯示(目前僅作log使用).
*
* <p>
* 默認使用 {@link RequestLogSwitch#NORMAL}
* </p>
*
* <h3>示例:</h3>
* <blockquote>
*
* <pre class="code">
* Map{@code <String, Object>} requestInfoMapForLog = RequestUtil.getRequestInfoMapForLog(request);}
* LOGGER.debug("class:[{}],request info:{}", getClass().getSimpleName(), JsonUtil.format(requestInfoMapForLog);
* </pre>
*
* 輸出結果:
*
* <pre class="code">
* 19:28:37 DEBUG (AbstractWriteContentTag.java:63) execute() - class:[HttpConcatTag],request info: {
* "requestFullURL": "/member/login.htm?a=b",
* "request.getMethod": "GET",
* "parameterMap": {"a": ["b"]}
* }
* </pre>
*
* </blockquote>
*
* @param request
* the request
* @return the request string for log
* @see RequestLogSwitch
* @see #getRequestInfoMapForLog(HttpServletRequest, RequestLogSwitch)
*/
public static Map<String, Object> getRequestInfoMapForLog(HttpServletRequest request){
return getRequestInfoMapForLog(request, RequestLogSwitch.NORMAL);
}