static void Main(string[] args) { //string configurationFileContent = JsonConvert.SerializeObject(GetAnalyzerConfig(), new Newtonsoft.Json.Converters.StringEnumConverter()); // specify the way you are going to use to send your logs to the analyzer. ILogsSender logsSender = GetLogsSender(); // initialize the logs managers class that's going to handle incoming logs messages and send them to the analyzer // using the logs sender. LogsManager.LogsManager logsManager = new LogsManager.LogsManager(IsLogsAnalyzerEnabled, logsSender); logsManager.Initialize(); // the following are some test for analyzer rules. Task.Delay(12000).ContinueWith((t) => { TestFilterOnlyRule(logsManager); Task.Run(() => TestTimeDifferenceRule(logsManager)); Task.Run(() => TestLogFrequencyRule(logsManager)); Task.Run(() => TestAggregateFunctionRule(logsManager)); Task.Run(() => TestDuplicateLogDetectionRule(logsManager)); }); Console.ReadLine(); }
public LogsManager(Func <bool> isLogAnalyzerEnabled, ILogsSender logsSender) { _isLogAnalyzerEnabled = isLogAnalyzerEnabled; _logsSender = logsSender; }
public DataPumperService(DataPumperConfiguration configuration) { _pumper = new NDataPumper.DataPumper(); _configuration = configuration; LogsSender = new SmtpSender(configuration); }