Class LogParser

java.lang.Object
org.apache.juneau.microservice.examples.LogParser
All Implemented Interfaces:
Closeable, AutoCloseable, Iterable<LogParser.Entry>

public class LogParser extends Object implements Iterable<LogParser.Entry>, Closeable
Utility class for reading log files.

Provides the capability of returning splices of log files based on dates and filtering based on thread and logger names.

  • Constructor Details

    • LogParser

      public LogParser(LogEntryFormatter formatter, File f, Date start, Date end, String thread, String[] loggers, String[] severity) throws IOException
      Constructor.
      Parameters:
      formatter - The log entry formatter.
      f - The log file.
      start - Don't return rows before this date. If null, start from the beginning of the file.
      end - Don't return rows after this date. If null, go to the end of the file.
      thread - Only return log entries with this thread name.
      loggers - Only return log entries produced by these loggers (simple class names).
      severity - Only return log entries with the specified severity.
      Throws:
      IOException - Thrown by underlying stream.
  • Method Details