co.cask.cdap.api.log
Interface LogService


public interface LogService

Provides access to log messages.


Method Summary
 Iterable<LogMessage> query(LogQuery query, long startTs, long endTs)
          Selects logs messages of the specified time interval.
 Iterable<LogMessage> tail(LogQuery query, int startPositionInBytes)
          Performs ongoing tailing of the logs messages starting from the given position relative to the end.
 

Method Detail

tail

Iterable<LogMessage> tail(LogQuery query,
                          int startPositionInBytes)
                          throws LogServiceException,
                                 UnsupportedLogQueryException
Performs ongoing tailing of the logs messages starting from the given position relative to the end.

E.g. tail(query, 1024) will return last 1KB of messages and continue to output as new data appears.

Parameters:
query - specifies which messages to select
startPositionInBytes - position to start tailing from. It is relative to the end position.
Returns:
log messages. Iterator has non-blocking behaviour: in case there's no messages to read, it will return null. In that case client code can try to read messages emitted after last call again after some time.
Throws:
LogServiceException - request cannot be completed.
UnsupportedLogQueryException - when given query is not supported by the back-end.

query

Iterable<LogMessage> query(LogQuery query,
                           long startTs,
                           long endTs)
                           throws LogServiceException,
                                  UnsupportedLogQueryException
Selects logs messages of the specified time interval.

Parameters:
query - specifies which messages to select
startTs - start point of the time range selection
endTs - end point of the time range selection
Returns:
log messages
Throws:
UnsupportedLogQueryException - when given query is not supported by the back-end.
LogServiceException


Copyright © 2014 Cask Data, Inc. Licensed under the Apache License, Version 2.0.