Beispiel #1
0
        private void Notify(object state)
        {
            var messages = _eventLogBusiness.GetMessages(_lastNotifyTime);

            //_logHub.Notify();
            if (messages.Any() == false)
            {
                return;
            }
            _logHub.MessageUpdate(messages);


            if (messages.Any(message => message.Type == MessageType.Error))
            {
                var currentHourErrors = _eventLogBusiness.GetErrorsBySource(DateTime.Now.Date, DateTime.Now.Hour);
                _logHub.HourlyErrorUpdate(currentHourErrors);
            }

            //var lastHour = DateTime.Now.AddHours(-1);
            //var lastHourErrors = _eventLogBusiness.GetErrorsBySource(lastHour, lastHour.Hour);

            _lastNotifyTime = DateTime.Now;
        }
Beispiel #2
0
 public IEnumerable <ErrorMessagesBySource> ErrorMessages()
 {
     return(_eventLogBusiness.GetErrorsBySource());
 }