當前位置: 首頁>>代碼示例>>Java>>正文


Java RequestLogSwitch類代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:venusdrogon,項目名稱:feilong-taglib,代碼行數:15,代碼來源:BaseTag.java

示例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;
}
 
開發者ID:venusdrogon,項目名稱:feilong-spring,代碼行數:30,代碼來源:BrowsingHistoryInterceptor.java

示例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;
}
 
開發者ID:venusdrogon,項目名稱:feilong-spring,代碼行數:14,代碼來源:MonitorMessageEntity.java

示例4: getRequestLogSwitch

import com.feilong.servlet.http.entity.RequestLogSwitch; //導入依賴的package包/類
/**
 * 獲得 request log switch.
 *
 * @return the requestLogSwitch
 */
public RequestLogSwitch getRequestLogSwitch(){
    return requestLogSwitch;
}
 
開發者ID:venusdrogon,項目名稱:feilong-spring,代碼行數:9,代碼來源:MonitorMessageEntity.java

示例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;
}
 
開發者ID:venusdrogon,項目名稱:feilong-spring,代碼行數:10,代碼來源:MonitorMessageEntity.java

示例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;
}
 
開發者ID:venusdrogon,項目名稱:feilong-servlet,代碼行數:14,代碼來源:RequestLogBuilder.java

示例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;
}
 
開發者ID:venusdrogon,項目名稱:feilong-servlet,代碼行數:12,代碼來源:RequestLogBuilder.java

示例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);
}
 
開發者ID:venusdrogon,項目名稱:feilong-servlet,代碼行數:37,代碼來源:RequestUtil.java


注:本文中的com.feilong.servlet.http.entity.RequestLogSwitch類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。