public IList <EventLog> EventLogs() { try { return(_eventlogRepository.Get().ToList()); } catch (Exception e) { throw e; } }
public async Task <IActionResult> Detail(long id) { try { var login = User.Identity.IsAuthenticated; var log = await _logger.Get(id); return(Ok(_mapper.Map <EventLogViewModel>(log))); } catch (Exception e) { await _logger.AddException(e); return(StatusCode(500)); } }
public async Task <IActionResult> Get() { var itemsFromDb = await _eventLogRepository.Get(20); return(Ok(itemsFromDb.Select(item => new EventLogItem { Id = item.Id, Headers = item.Headers, Payload = item.Payload, Succeeded = item.Succeeded, CommandError = item.ExecutionResult?.Error, CommandOutput = item.ExecutionResult?.Output, ExitCode = item.ExecutionResult?.ExitCode, StatusMessage = item.StatusMessage, EventReceivedOn = item.EventReceivedOn, WebHookRuleCommand = item.MatchedRule?.Execute, WebHookRuleName = item.MatchedRule?.Name }))); }