public void sendErrorEmail(RequestCycle cycle, Exception ex, IRequestLogger logger) {
        try {
            String customer = Utils.getCustomer();
            Url url = cycle.getRequest().getUrl();
            Url clientUrl = cycle.getRequest().getClientUrl();
            String exStr = ExceptionUtils.getStackTrace(ex);
            String fullUrl = cycle.getUrlRenderer().renderFullUrl(url);
            int currUserId = 0;
            RequestData currRd = logger.getCurrentRequest();
            String currSessId = Session.get().getId();
            SessionData sd = null;
            if(currSessId != null) {
                SessionData[] sessions = logger.getLiveSessions();
                for(SessionData s : sessions) {
                    if(s.getSessionId().equals(currSessId)) {
                        sd = s;
                        break;
                    }
                }
            }
            String currReq = ((CustomRequestLogger)logger).createRequestData(currRd, sd);
            StringBuilder currSessStr = new StringBuilder();
            if(sd != null) {
                currSessStr.append("id:").append(sd.getSessionId()).append('\n');
                currSessStr.append("requestCount:").append(sd.getNumberOfRequests()).append('\n');
                currSessStr.append("requestsTime:").append(sd.getTotalTimeTaken()).append('\n');
                currSessStr.append("sessionSize:").append(Bytes.bytes(sd.getSessionSize())).append('\n');
                currSessStr.append("sessionInfo:").append(sd.getSessionInfo()).append('\n');
                currSessStr.append("startDate:").append(sd.getStartDate()).append('\n');
                currSessStr.append("lastRequestTime:").append(sd.getLastActive()).append('\n');
                currSessStr.append("numberOfRequests:").append(sd.getNumberOfRequests()).append('\n');
                currSessStr.append("totalTimeTaken:").append(sd.getTotalTimeTaken()).append("\n\n\n");
            }
            currSessStr.append("Requests: \n");
            ((CustomRequestLogger)logger).getRequests(currSessStr);
            String template = "param1: %s \n url: %s \n client url: %s \n user: %s \n\n "
                    + "curr req: %s \n\n\n curr session: %s \n\n\n stack trace: %s";
            String body = String.format(template, customer, fullUrl, clientUrl.toString(), currUserId, currReq, currSessStr.toString(), exStr);
            String subject = customer + " error";
            //TODO send email here
        } catch (Exception e) {
            //ignore
        }
    }
public void sendErrorEmail(RequestCycle cycle, Exception ex, IRequestLogger logger) {
        try {
            String customer = Utils.getCustomer();
            Url url = cycle.getRequest().getUrl();
            Url clientUrl = cycle.getRequest().getClientUrl();
            String exStr = ExceptionUtils.getStackTrace(ex);
            String fullUrl = cycle.getUrlRenderer().renderFullUrl(url);
            int currUserId = 0;
            RequestData currRd = logger.getCurrentRequest();
            String currSessId = Session.get().getId();
            SessionData sd = null;
            if(currSessId != null) {
                SessionData[] sessions = logger.getLiveSessions();
                for(SessionData s : sessions) {
                    if(s.getSessionId().equals(currSessId)) {
                        sd = s;
                        break;
                    }
                }
            }
            String currReq = ((CustomRequestLogger)logger).createRequestData(currRd, sd);
            StringBuilder currSessStr = new StringBuilder();
            if(sd != null) {
                currSessStr.append("id:").append(sd.getSessionId()).append('\n');
                currSessStr.append("requestCount:").append(sd.getNumberOfRequests()).append('\n');
                currSessStr.append("requestsTime:").append(sd.getTotalTimeTaken()).append('\n');
                currSessStr.append("sessionSize:").append(Bytes.bytes(sd.getSessionSize())).append('\n');
                currSessStr.append("sessionInfo:").append(sd.getSessionInfo()).append('\n');
                currSessStr.append("startDate:").append(sd.getStartDate()).append('\n');
                currSessStr.append("lastRequestTime:").append(sd.getLastActive()).append('\n');
                currSessStr.append("numberOfRequests:").append(sd.getNumberOfRequests()).append('\n');
                currSessStr.append("totalTimeTaken:").append(sd.getTotalTimeTaken()).append("\n\n\n");
            }
            currSessStr.append("Requests: \n");
            ((CustomRequestLogger)logger).getRequests(currSessStr);
            String template = "param1: %s \n url: %s \n client url: %s \n user: %s \n\n "
                    + "curr req: %s \n\n\n curr session: %s \n\n\n stack trace: %s";
            String body = String.format(template, customer, fullUrl, clientUrl.toString(), currUserId, currReq, currSessStr.toString(), exStr);
            String subject = customer + " error";
           
        } catch (Exception e) {
           
        }
    }
public void senderroremail(requestcycle cycle, exception ex, irequestlogger logger) { try { string customer = utils.getcustomer(); url url = cycle.getrequest().geturl(); url clienturl = cycle.getrequest().getclienturl(); string exstr = exceptionutils.getstacktrace(ex); string fullurl = cycle.geturlrenderer().renderfullurl(url); int curruserid = 0; requestdata currrd = logger.getcurrentrequest(); string currsessid = session.get().getid(); sessiondata sd = null; if(currsessid != null) { sessiondata[] sessions = logger.getlivesessions(); for(sessiondata s : sessions) { if(s.getsessionid().equals(currsessid)) { sd = s; break; } } } string currreq = ((customrequestlogger)logger).createrequestdata(currrd, sd); stringbuilder currsessstr = new stringbuilder(); if(sd != null) { currsessstr.append("id:").append(sd.getsessionid()).append('\n'); currsessstr.append("requestcount:").append(sd.getnumberofrequests()).append('\n'); currsessstr.append("requeststime:").append(sd.gettotaltimetaken()).append('\n'); currsessstr.append("sessionsize:").append(bytes.bytes(sd.getsessionsize())).append('\n'); currsessstr.append("sessioninfo:").append(sd.getsessioninfo()).append('\n'); currsessstr.append("startdate:").append(sd.getstartdate()).append('\n'); currsessstr.append("lastrequesttime:").append(sd.getlastactive()).append('\n'); currsessstr.append("numberofrequests:").append(sd.getnumberofrequests()).append('\n'); currsessstr.append("totaltimetaken:").append(sd.gettotaltimetaken()).append("\n\n\n"); } currsessstr.append("requests: \n"); ((customrequestlogger)logger).getrequests(currsessstr); string template = "param1: %s \n url: %s \n client url: %s \n user: %s \n\n " + "curr req: %s \n\n\n curr session: %s \n\n\n stack trace: %s"; string body = string.format(template, customer, fullurl, clienturl.tostring(), curruserid, currreq, currsessstr.tostring(), exstr); string subject = customer + " error"; } catch (exception e) { } }