public void Log(Item item, string eventId, string color, string label, string note = "")
 {
     try
     {
         ItemAuditEntry entry = new ItemAuditEntry(eventId, label, color, item);
         if (entry.User.ToLower().Contains("anonymous") && !_logAnonymousEvents)
         {
             return;
         }
         entry.Note = note;
         StringBuilder sb = new StringBuilder();
         if (item != null)
         {
             var fieldList = item.Fields.Where(x => !x.Name.StartsWith("__")).Select(x => x.Value);
             foreach (string str in fieldList)
             {
                 sb.Append(str);
                 sb.Append("|");
             }
         }
         Log(entry, sb.ToString());
     }
     catch (Exception e)
     {
         Sitecore.Diagnostics.Log.Error("SCS: issue writing item log audit log", e, this);
     }
 }
 public void Log(Item item, string eventId, string color, string label, string note = "")
 {
     try
     {
         string         dateKey = DateTime.Now.ToString("yyyyMMdd");
         ItemAuditEntry entry   = new ItemAuditEntry(eventId, label, color, item);
         entry.Note = note;
         StringBuilder sb = new StringBuilder();
         if (item != null)
         {
             var fieldList = item.Fields.Where(x => !x.Name.StartsWith("__")).Select(x => x.Value);
             foreach (string str in fieldList)
             {
                 sb.Append(str);
                 sb.Append("|");
             }
         }
         Log(entry, sb.ToString());
     }
     catch (Exception e)
     {
         Sitecore.Diagnostics.Log.Error("issue writing item log audit log", e, this);
     }
 }
示例#3
0
 public void Log(Item item, string eventId, string color, string label, string note = "")
 {
     try
     {
         string dateKey = DateTime.Now.ToString("yyyyMMdd");
         ItemAuditEntry entry = new ItemAuditEntry(eventId, label, color, item);
         entry.Note = note;
         StringBuilder sb = new StringBuilder();
         if (item != null)
         {
             var fieldList = item.Fields.Where(x => !x.Name.StartsWith("__")).Select(x => x.Value);
             foreach (string str in fieldList)
             {
                 sb.Append(str);
                 sb.Append("|");
             }
         }
         Log(entry, sb.ToString());
     }
     catch (Exception e)
     {
         Sitecore.Diagnostics.Log.Error("issue writing item log audit log", e, this);
     }
 }
 public AuditSourceRecord(ItemAuditEntry entry, string content)
 {
     Entry   = entry;
     Content = content;
 }
 public void LogEvent(ItemAuditEntry entry)
 {
     AuditLogger.Current.Log(entry);
 }