示例#1
0
        public void LogError(HttpContext httpContext, Exception exception)
        {
            string   request    = httpContext.Request.Url.ToString();
            string   httpMethod = httpContext.Request.HttpMethod;
            DateTime time       = httpContext.Timestamp;
            string   message    = exception.Message;
            string   stackTrace = exception.StackTrace;
            string   targetSite = exception.TargetSite.ToString();

            ErrorLog        log             = new ErrorLog(1, httpMethod, request, message, stackTrace, targetSite, time);
            ErrorLogService errorLogService = new ErrorLogService();

            errorLogService.CreateErrorLog(log);
        }
示例#2
0
        public IEnumerable GetErrorLogs(DateTime minimumDate, DateTime maximumDate)
        {
            ErrorLogService errorLogService = new ErrorLogService();

            return(errorLogService.GetErrorLogs(minimumDate, maximumDate));
        }