public void LogTheExceptions(Exception exception, string URL) { MaaAahwanam.Dal.MA_ExceptionLogs ExceptionLogs = new MA_ExceptionLogs(); ExceptionLogs.ExceptionType = exception.GetType().FullName; ExceptionLogs.ErrorMessage = exception.Message; ExceptionLogs.UrlPattern = URL; ExceptionLogs.Date = DateTime.Now; ExceptionLogs.LogType = "ExceptionLog"; ExceptionLogs.UserID = ValidUserUtility.ValidUser(); _Repositories.ExceptionLogs.Add(ExceptionLogs); Repositories.SaveChanges(); }
public void LogEvents(string Description, string URL, int UserID) { MaaAahwanam.Dal.MA_ExceptionLogs ExceptionLogs = new MA_ExceptionLogs(); ExceptionLogs.ErrorMessage = Description; ExceptionLogs.UrlPattern = URL; ExceptionLogs.Date = DateTime.Now; ExceptionLogs.IPAddress = GetComputer_LanIP(); ExceptionLogs.Browsertype = HttpContext.Current.Request.Browser.Type; ExceptionLogs.URL = HttpContext.Current.Request.Url.OriginalString; ExceptionLogs.usertype = ""; ExceptionLogs.LogType = "EventLog"; ExceptionLogs.UserID = UserID; _Repositories.ExceptionLogs.Add(ExceptionLogs); _Repositories.SaveChanges(); }