예제 #1
0
 internal static void CleanLoggingDB(string databaseConnectionString)
 {
     using (var db = new TracingDataContext(databaseConnectionString))
     {
         db.Traces.DeleteAllOnSubmit(db.Traces);
         db.SubmitChanges();
     }
 }
예제 #2
0
 internal static Trace GetFirstLog(string databaseConnectionString)
 {
     using (var db = new TracingDataContext(databaseConnectionString))
     {
         return db.Traces.FirstOrDefault();
     }
 }
예제 #3
0
        internal static string GetFirstLogFormattedMessage(string databaseConnectionString)
        {
            using (var db = new TracingDataContext(databaseConnectionString))
            {
                var log = db.Traces.Where(e => e.FormattedMessage.Contains("Extended Properties: value - testing title")).SingleOrDefault();
                if (log == null)
                    return null;

                return log.FormattedMessage;
            }
        }
예제 #4
0
 internal static List<Trace> GetAllLogEntries(string databaseConnectionString)
 {
     using (var db = new TracingDataContext(databaseConnectionString))
     {
         return db.Traces.ToList();
     }
 }
예제 #5
0
 internal static List<Trace> GetExceptionsFromDB(string databaseConnectionString)
 {
     using (var db = new TracingDataContext(databaseConnectionString))
     {
         return db.Traces.Where(e => e.Level == 2).ToList();
     }
 }