예제 #1
0
파일: Monitor.cs 프로젝트: jkotrba/LogMon
        protected IEnumerable<LogEntry> FindEntries(int lastReadEntryId)
        {
            var currentEntries = new LogRepository(ConnectionStringName).GetEntries(lastReadEntryId).OrderByDescending(e => e.ID);
            if (currentEntries.Any())
            {
                // Update the LastReadEntryId
                int latestEntryId = currentEntries.First().ID;
                if (latestEntryId > LastReadEntryId)
                {
                    LastReadEntryId = latestEntryId;
                }

                return currentEntries.Where(
                    e => !string.IsNullOrEmpty(e.Exception) && e.Exception.Substring(0, SymConTimeoutException.Length) == SymConTimeoutException);
            }
            return Enumerable.Empty<LogEntry>();
        }
예제 #2
0
파일: Monitor.cs 프로젝트: jkotrba/LogMon
 private static int GetLatestLogEntryId()
 {
     var latestEntry = new LogRepository(ConnectionStringName).GetLatestEntry();
     return latestEntry.ID;
 }