use of io.cdap.cdap.logging.read.LogReader in project cdap by caskdata.
the class PreviewHttpHandler method sendLogs.
private void sendLogs(HttpResponder responder, String namespaceId, String previewId, Consumer<LogReaderInfo> logsResponder) throws Exception {
ApplicationId applicationId = new ApplicationId(namespaceId, previewId);
ProgramRunId programRunId = previewManager.getRunId(applicationId);
if (programRunId == null) {
responder.sendStatus(HttpResponseStatus.OK);
return;
}
LoggingContext loggingContext = LoggingContextHelper.getLoggingContextWithRunId(programRunId, null);
LogReader logReader = previewManager.getLogReader();
logsResponder.accept(new LogReaderInfo(logReader, loggingContext, null));
}
Aggregations