Ejemplo n.º 1
0
        protected override Task <bool> WriteLog(TraceEventType severity, LogCallSiteInfo logCallSiteInfo, string message, IDictionary <string, string> encryptedTags, IDictionary <string, string> unencryptedTags, Exception exception = null, string stackTrace = null)
        {
            var entry = new LogEntry
            {
                Severity        = severity,
                Message         = message,
                EncryptedTags   = encryptedTags.ToDictionary(_ => _.Key, _ => EventFieldFormatter.SerializeFieldValue(_.Value)),
                UnencryptedTags = unencryptedTags.ToDictionary(_ => _.Key, _ => EventFieldFormatter.SerializeFieldValue(_.Value)),
                Exception       = exception
            };

            lock (LogEntriesList)
            {
                LogEntriesList.Add(entry);
            }

            return(null);
        }
 private void ExecuteLogClear()
 {
     if (this.ConnectionString == null && this.ConnectionString.Equals(""))
     {
         MessageBox.Show("Bitte Connectionstring eingeben!");
     }
     else
     {
         var logentryRepository = new LogEntryRepository();
         logentryRepository.ExecuteLogClear(SelectedEntry);
         LogEntriesList = logentryRepository.GetAll().ToList <LogEntry>();
         if (LogEntriesList.Any())
         {
             this.SelectedEntry = this.LogEntriesList.First();
         }
         OnPropertyChanged("LogEntriesList");
         OnPropertyChanged("SelectedEntry");
     }
 }