예제 #1
0
        public void InsertLogMessage(string logMessage)
        {
            tbl_Error tblError = new tbl_Error();

            tblError.ErrorMessage = logMessage;
            tblError.ErrorTime    = DateTime.Now;
            db.tbl_Error.Add(tblError);
            db.SaveChanges();
        }
예제 #2
0
        public int InsertLog(IDictionary <string, object> data)
        {
            tbl_Error tblError = new tbl_Error();

            tblError.ErrorMessage = data["ErrorMessage"].ToString();
            tblError.ErrorTime    = DateTime.Now;
            db.tbl_Error.Add(tblError);
            db.SaveChanges();
            return(1);
        }
예제 #3
0
        public void OnException(ExceptionContext filterContext)
        {
            string route      = filterContext.RouteData.Route.ToString();
            string logMessage = "Error In :" + route + "  Inner Exception " + filterContext.Exception.InnerException + "Message :" + filterContext.Exception.Message + "Stack Trace : " + filterContext.Exception.StackTrace;

            tbl_Error tblError = new tbl_Error();

            tblError.ErrorMessage = logMessage;
            tblError.ErrorTime    = DateTime.Now;
            db.tbl_Error.Add(tblError);
            db.SaveChanges();


            filterContext.ExceptionHandled = true;
        }