Log Entry Retrieval

Filters and retrieves entries from an Unwired Server log.

Syntax

void setLogPosition(LogPositionVO logPosition) throws SUPAdminException;

Collection<LogEntryVO> getLogEntries(Integer start, Integer end) throws SUPAdminException;

Collection<LogEntryVO> getLogEntries(Integer start, Integer end, Boolean includingBackup) throws SUPAdminException;

Returns

If successful, returns an object of the specified type (can be null). If unsuccessful, returns SUPAdminException.

Examples

  • Filter from the start of a log – returns log entries from the start of the log (the 100th through 250th entries after the start of the log):
    supServerLog.setLogPosition(LogPositionVO.START);
    for (LogEntryVO levo : supServerLog.getLogEntries(100, 250)) {
    	System.out.println(levo.getBucket());
    }
    for (LogEntryVO levo : supServerLog.getLogEntries(100, 250, true)) {
    	System.out.println(levo.getBucket());
    }
  • Filter from the end of a log – returns log entries from the end of the log (the 100th to 250th entries before the end of the log):
    supServerLog.setLogPosition(LogPositionVO.END);
    for (LogEntryVO levo : supServerLog.getLogEntries(-100, -250)) {
    	System.out.println(levo.getBucket());
    }
    for (LogEntryVO levo : supServerLog.getLogEntries(-100, -250, true)) {
    	System.out.println(levo.getBucket());
    }