public static List<LogMessage> ConvertLogEntityToMessage(List<LogEntity> list) { List<LogMessage> result = new List<LogMessage>(); foreach (LogEntity le in list) { LogMessage lm = new LogMessage(); lm.Level = le.Level; lm.Message = le.Message; lm.SourceDate = le.SourceDate; result.Add(lm); } return result; }
internal static LogEntity ConvertLog(LogMessage log) { LogEntity result = new LogEntity(); result.Uid = Guid.NewGuid(); result.Level = log.Level; result.Message = log.Message; result.SourceDate = log.SourceDate; result.UpdateDate = DateTime.Now; try { Guid searchGuid = new Guid(log.ApplicationKey); RepositoryContext.Current.Applications.GetById(searchGuid); } catch(Exception err) { WlogLogger.Current.Error(err); } return result; }
public void Enqueue(LogMessage le) { queque.Enqueue(le); }
public void PersistLog(LogMessage log) { LogEntity ent = new LogEntity(); ent.ApplictionId = RepositoryContext.Current.Applications.GetByApplicationKey(log.ApplicationKey).IdApplication; ent.Level = log.Level; ent.Message = log.Message; ent.SourceDate = log.SourceDate; ent.UpdateDate = DateTime.Now; ent.CreateDate = DateTime.Now; RepositoryContext.Current.Logs.Save(ent); }