Exemple #1
0
 public BasicLogTree()
 {
     _logReader       = new BasicLogReader();
     _logAnalyzer     = new LogAnalyzer();
     _patternsManager = new GrokPatternsManager();
     _logLines        = new List <string>();
     _patternsManager.LoadPatterns();
 }
Exemple #2
0
 private bool analyze(ILogAnalyzer a, string line, int lineNumber, string sourceName)
 {
     try {
         return(a.Analyze(line, lineNumber, sourceName));
     }
     catch {
         // Just suppress exception and do nothing; too costly to do anything here.
         return(false);
     }
 }
Exemple #3
0
 private void endReadAll(ILogAnalyzer a)
 {
     try {
         a.EndReadAll();
     }
     catch (Exception exc) {
         Reports.Add(new StatusReport {
             Source     = a.GetType(),
             Message    = $"ILogAnalyzer {a.GetType()} threw an exception during EndReadAll(). {exc.Message}",
             ReportType = ReportType.Warning
         });
     }
 }
Exemple #4
0
 private void beginRead(ILogAnalyzer a, string sourceName)
 {
     try {
         a.BeginRead(sourceName);
     }
     catch (Exception exc) {
         Reports.Add(new StatusReport {
             Source     = a.GetType(),
             Message    = $"ILogAnalyzer {a.GetType()} threw an exception during BeginRead({sourceName}). {exc.Message}",
             ReportType = ReportType.Warning
         });
     }
 }