Class LogsAccessor


  • @Service
    public class LogsAccessor
    extends Object
    An accessor to the logs of Silverpeas.
    Author:
    mmoquillon
    • Method Detail

      • getAllLogs

        public Set<String> getAllLogs()
                               throws IOException
        Gets the name of the logs in used in Silverpeas.
        Returns:
        a set of Silverpeas logs.
        Throws:
        IOException - if an error occurs while accessing the logs.
      • getLastLogRecords

        public List<String> getLastLogRecords​(String log,
                                              int recordCount)
                                       throws SilverpeasException
        Gets the specified last number of records from the specified log.
        Empty line at end of file is skipped.
        Parameters:
        log - the log to access.
        recordCount - the number of records to get. O or a negative value means all the records.
        Returns:
        an array of the last log records in the log at the time it was accessed.
        Throws:
        SilverpeasException - if either the specified log doesn't exist or an error occurred wile or if the log name contains relative path.