Search in sources :

Example 1 with LogReader

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));
}
Also used : LoggingContext(io.cdap.cdap.common.logging.LoggingContext) LogReader(io.cdap.cdap.logging.read.LogReader) ProgramRunId(io.cdap.cdap.proto.id.ProgramRunId) ApplicationId(io.cdap.cdap.proto.id.ApplicationId)

Aggregations

LoggingContext (io.cdap.cdap.common.logging.LoggingContext)1 LogReader (io.cdap.cdap.logging.read.LogReader)1 ApplicationId (io.cdap.cdap.proto.id.ApplicationId)1 ProgramRunId (io.cdap.cdap.proto.id.ProgramRunId)1