Exemplo n.º 1
0
 private void WriteLog(LogType logtype, LogLevel loglevel, Exception ex, String message, CurrentUser currentUser)
 {
     try
     {
         Dalyan.Db.LogDatabase log = new Dalyan.Db.LogDatabase();
         log.Comment = message;
         log.ExceptionString = ex.ToString();
         log.LogDate = DateTime.Now;
         log.LogLevel = loglevel.ToString();
         log.LogType = logtype.ToString();
         if (currentUser != null) log.UserId = currentUser.UserID;
         log.IsDeleted = false;
         _db.LogDatabase.Add(log);
         _db.SaveChanges();
     }
     catch (Exception exLog)
     {
         WriteLogToFile(logtype, loglevel, ex, message, exLog);
     }
 }
Exemplo n.º 2
0
 public void Logger(LogType logtype, LogLevel loglevel, Exception ex, String message, CurrentUser currentUser)
 {
     WriteLog(logtype, loglevel, ex, message, currentUser);
 }