Class LogRecordingHandler


  • @Beta
    public class LogRecordingHandler
    extends java.util.logging.Handler
    Beta
    Logging handler that stores log records.
    Since:
    1.14
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.util.logging.LogRecord> records
      Stored records.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void flush()  
      java.util.List<java.lang.String> messages()
      Returns a new instance of a list of published record messages.
      void publish​(java.util.logging.LogRecord record)  
      • Methods inherited from class java.util.logging.Handler

        getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
      • Methods inherited from class java.lang.Object

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

      • records

        private final java.util.List<java.util.logging.LogRecord> records
        Stored records.
    • Constructor Detail

      • LogRecordingHandler

        public LogRecordingHandler()
    • Method Detail

      • publish

        public void publish​(java.util.logging.LogRecord record)
        Specified by:
        publish in class java.util.logging.Handler
      • flush

        public void flush()
        Specified by:
        flush in class java.util.logging.Handler
      • close

        public void close()
                   throws java.lang.SecurityException
        Specified by:
        close in class java.util.logging.Handler
        Throws:
        java.lang.SecurityException
      • messages

        public java.util.List<java.lang.String> messages()
        Returns a new instance of a list of published record messages.