Class LogFormatDetector

java.lang.Object
org.glassfish.main.jul.formatter.LogFormatDetector

public class LogFormatDetector extends Object
Detector of known standardized log formats.
Author:
David Matejcek
  • Field Details

  • Constructor Details

    • LogFormatDetector

      public LogFormatDetector()
  • Method Details

    • detectFormatter

      public String detectFormatter(File logFile)
      Parameters:
      logFile -
      Returns:
      full class name of the concrete detected Formatter or null if the file is null or could not be read.
    • detectFormatter

      public String detectFormatter(String firstLine)
      Parameters:
      firstLine -
      Returns:
      null for unknown file format, full class name otherwise.
    • isODLFormatLogHeader

      public boolean isODLFormatLogHeader(String firstLine)
      Parameters:
      firstLine -
      Returns:
      true if the given line is probably a beginning of a ODL log record.
    • isOneLineLFormatLogHeader

      public boolean isOneLineLFormatLogHeader(String firstLine)
      Parameters:
      firstLine -
      Returns:
      true if the given line is probably a beginning of a OneLineFormatter's log record.
    • isUniformFormatLogHeader

      public boolean isUniformFormatLogHeader(String firstLine)
      Parameters:
      firstLine -
      Returns:
      true if the given line is probably a beginning of a Uniform log record.
    • isCompressedFile

      public boolean isCompressedFile(String filename)
      Determines whether the given file is compressed (name ends with .gz).
      Parameters:
      filename -
      Returns:
      true if the filename ends with ".gz"