Example #1
0
        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;
        }
Example #2
0
        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;
        }
Example #3
0
 public void Enqueue(LogMessage le)
 {
     queque.Enqueue(le);
 }
Example #4
0
 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);
 }
Example #5
0
 public void Enqueue(LogMessage le)
 {
     queque.Enqueue(le);
 }