src/models/log.js
function getContinuousLogs (api, appId, before, after, search, deploymentId) {
  function makeUrl (retryTimestamp) {
    const newAfter = retryTimestamp === null || after.getTime() > retryTimestamp.getTime() ? after : retryTimestamp;
    return getWsLogUrl(appId, newAfter.toISOString(), search, deploymentId);
  };

  return WsStream
    .openStream(makeUrl, api.session.getAuthorization('GET', getAppLogsUrl(appId), {}))
    .filter((line) => {
      const lineDate = Date.parse(line._source['@timestamp']);
      const isBefore = !before || lineDate < before.getTime();
      const isAfter = !after || lineDate > after.getTime();
      return isBefore && isAfter;
    });
}
function getContinuousLogs (api, appId, before, after, search, deploymentId) {
  function makeUrl (retryTimestamp) {
    const newAfter = retryTimestamp === null || after.getTime() > retryTimestamp.getTime() ? after : retryTimestamp;
    return getWsLogUrl(appId, newAfter.toISOString(), search, deploymentId);
  };

  return WsStream
    .openStream(makeUrl, api.session.getAuthorization('GET', getAppLogsUrl(appId), {}))
    .filter((line) => {
      const lineDate = Date.parse(line._source['@timestamp']);
      const isBefore = !before || lineDate < before.getTime();
      const isAfter = !after || lineDate > after.getTime();
      return isBefore && isAfter;
    });
}
function getContinuousLogs ( api , appId , before , after , search , deploymentId ) { function makeUrl ( retryTimestamp ) { const newAfter = retryTimestamp === null || after . getTime ( ) > retryTimestamp . getTime ( ) ? after : retryTimestamp ; return getWsLogUrl ( appId , newAfter . toISOString ( ) , search , deploymentId ) ; } ; return WsStream . openStream ( makeUrl , api . session . getAuthorization ( 'GET' , getAppLogsUrl ( appId ) , { } ) ) . filter ( ( line ) => { const lineDate = Date . parse ( line . _source [ '@timestamp' ] ) ; const isBefore = ! before || lineDate < before . getTime ( ) ; const isAfter = ! after || lineDate > after . getTime ( ) ; return isBefore && isAfter ; } ) ; }
Get logs as they arrive from a web socket.
Automatically reconnect if the connexion is closed.

api: The API object
appId: The appId of the application
before (Date): only display log lines that happened before this date
after  (Date): only display log lines that happened after this date
deploymentId: Only display log lines corresponding to this deployment
Get logs as they arrive from a web socket . Automatically reconnect if the connexion is closed .