public void pollForLogs()

in src/main/java/CloudWatchMonitor.java [59:80]


    public void pollForLogs(TaskListener listener) {
        if(cwlStreamingDisabled) {
            return;
        } else if(this.logsLocation != null && this.logsLocation.getGroupName() != null && this.logsLocation.getStreamName() != null) {
            this.latestLogs = new ArrayList<>();
            GetLogEventsRequest logRequest = new GetLogEventsRequest()
                .withStartTime(lastPollTime)
                .withStartFromHead(true)
                .withLogGroupName(logsLocation.getGroupName())
                .withLogStreamName(logsLocation.getStreamName());
            try {
                GetLogEventsResult logsResult = logsClient.getLogEvents(logRequest);
                getAndFormatLogs(logsResult.getEvents(), listener);
            } catch (Exception e) {
                latestLogs = Arrays.asList(e.getMessage());
                return;
            }
        } else {
            latestLogs = Arrays.asList(noLogsMessage);
            return;
        }
    }