Class ELFFormatter


  • public class ELFFormatter
    extends Formatter
    This Formatter is the custom defined Formatter for DSAME which formats the logRecord according to ELF. For details of ELF specification pls refer www.w3.org/TR/WD-logfile.html. This Formatter will put the version number and Fields as the first 2 lines and the data corresponding to each field follows. If a field is not selected a "-" is put.
    • Constructor Detail

      • ELFFormatter

        public ELFFormatter()
        returns a ELF Formatter
    • Method Detail

      • format

        public String format​(LogRecord logRecord)
        Format the given record as per ELF and return a formatted string.

        For ELF Specifications refer to www.w3.org/TR/WD-logfile.html

        Specified by:
        format in class Formatter
        Parameters:
        logRecord - the log record to be formatted.
        Returns:
        formatted string.
      • getHead

        public String getHead​(Handler handler)
        According to ELF, the log file should start with a #Version which specifies the ELF version used followed by a #Fields line which specifies all the fields that are being logged.

        ELFFormatter uses this method to return back the header containing these two lines. FileHandler checks if the header is already written, if not uses this method to get the header and puts it at the beginning of the file.

        Overrides:
        getHead in class Formatter
        Parameters:
        handler - The target handler (can be null)
        Returns:
        the set of all fields converted into a # prefixed string.
      • getTail

        public String getTail​(Handler handler)
        Returns an empty string.
        Overrides:
        getTail in class Formatter
        Parameters:
        handler - The target handler (can be null)
        Returns:
        a empty string.