Class SimpleLogFormatter


  • public class SimpleLogFormatter
    extends java.util.logging.Formatter
    Simple(r) log formatter for java.util.logging messages. Outputs unique dates once, with all messages sharing that time tab indented below. Example Format:
     Wed Sep 30 19:31:48 GMT 2009
     INFO    Exit code=0
     Wed Sep 30 19:32:52 GMT 2009
     INFO    [polldir] duplicate product id=urn:earthquake-usgs-gov:shakemap-scraper:global:2009medd:1
     Wed Sep 30 19:32:53 GMT 2009
     INFO    [polldir] received urn:earthquake-usgs-gov:shakemap-scraper:global:2009medd:1
     INFO    [losspager] filtering type 'shakemap-scraper', not allowed
     INFO    [logging_client] received urn:earthquake-usgs-gov:shakemap-scraper:global:2009medd:1
     INFO    [shakemap] received urn:earthquake-usgs-gov:shakemap-scraper:global:2009medd:1
     
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long MILLIS_PER_SECOND
      Milliseconds in a second.
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleLogFormatter()
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(java.util.logging.LogRecord record)
      Format a LogRecord for output.
      • Methods inherited from class java.util.logging.Formatter

        formatMessage, getHead, getTail
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MILLIS_PER_SECOND

        public static final long MILLIS_PER_SECOND
        Milliseconds in a second.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SimpleLogFormatter

        public SimpleLogFormatter()
        Default constructor.
    • Method Detail

      • format

        public final java.lang.String format​(java.util.logging.LogRecord record)
        Format a LogRecord for output.
        Specified by:
        format in class java.util.logging.Formatter
        Parameters:
        record - LogRecord to format.
        Returns:
        formatted LogRecord as String.