示例#1
0
 public ActionResult Update(Bam.Net.Logging.Data.LogEvent dao)
 {
     try
     {
         dao.Save();
         return(Json(new { Success = true, Message = "", Dao = dao.ToJsonSafe() }));
     }
     catch (Exception ex)
     {
         return(GetErrorResult(ex));
     }
 }
示例#2
0
        private static LogEvent CreateFromFilter(IQueryFilter filter, Database database = null)
        {
            Database db  = database ?? Db.For <LogEvent>();
            var      dao = new LogEvent();

            filter.Parameters.Each(p =>
            {
                dao.Property(p.ColumnName, p.Value);
            });
            dao.Save(db);
            return(dao);
        }
示例#3
0
        public override void CommitLogEvent(LogEvent logEvent)
        {
            Data.LogEvent logData = new Data.LogEvent();
            logData.Source                = logEvent.Source.First(4000);
            logData.Category              = logEvent.Category.First(4000);
            logData.EventId               = logEvent.EventID;
            logData.User                  = logEvent.User.First(4000);
            logData.Time                  = logEvent.Time;
            logData.MessageSignature      = logEvent.MessageSignature.First(4000);
            logData.MessageVariableValues = logEvent.MessageVariableValues.ToDelimited(v => v, ",").First(4000);
            logData.Message               = logEvent.Message.First(4000);
            logData.Computer              = logEvent.Computer.First(4000);
            logData.Severity              = logEvent.Severity.ToString().First(4000);

            logData.Save(Database);
        }