APISonar


io.seldon.api.logging.ApiLogger.log

> io > seldon > api > logging > ApiLogger > log
io APIs seldon APIs api APIs logging APIs ApiLogger APIs log APIs

Example 1
ResourceBean addEvents(@RequestBody String event, HttpServletRequest req) {
		Date start = new Date();
		ResourceBean con = resourceServer.validateResourceRequest(req);
		ResourceBean responseBean;
		if(con instanceof ConsumerBean) 
		{
            responseBean = predictionBusinessService.addEvent((ConsumerBean)con, event);
        }
		else {
			responseBean = con;
		}
		ApiLogger.log("events",start,new Date(),con,responseBean,req);
        return responseBean;
	}
Example 2
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
        Date start = (Date)request.getAttribute(START_TIME);
        final HttpSession session = request.getSession();
        final ConsumerBean consumerBean = (ConsumerBean) session.getAttribute("consumer");
        String apiKey = request.getServletPath().replaceAll("/", "\\."); //Asumes no user/item ids in path!!!!
        ApiLogger.log(apiKey,start, request, consumerBean);
        super.postHandle(request, response, handler, modelAndView);
    }
Example 3
ModelAndView setCookie(HttpServletRequest request, HttpServletResponse response,
                           @RequestParam(value = "localId", required = false) String localId,
                           @RequestParam("proxy") String proxy) {
        Date start = new Date();
        String userId = ensureCookie(request, response, localId);
        final ModelAndView mav = new ModelAndView("porthole-session");
        mav.addObject("uuid", userId);
        mav.addObject("proxy", proxy);
        mav.addObject("closeImmediately", localId != null);
        ApiLogger.log("id",start, request, null);
        return mav;
    }