Package nxt.util

Class MemoryHandler


public class MemoryHandler extends Handler
MemoryHandler maintains a ring buffer of log messages. The GetLog API is used to retrieve these log messages. The following logging.properties entries are used:
  • nxt.util.MemoryHandler.level (default ALL)
  • nxt.util.MemoryHandler.size (default 100, minimum 10)
  • Constructor Details

    • MemoryHandler

      public MemoryHandler()
      Create a MemoryHandler and configure it based on LogManager properties
  • Method Details

    • publish

      public void publish(LogRecord record)
      Store a LogRecord in the ring buffer
      Specified by:
      publish in class Handler
      Parameters:
      record - Description of the log event. A null record is silently ignored and is not published
    • getMessages

      public List<String> getMessages(int msgCount)
      Return the log messages from the ring buffer
      Parameters:
      msgCount - Number of messages to return
      Returns:
      List of log messages
    • flush

      public void flush()
      Flush the ring buffer
      Specified by:
      flush in class Handler
    • close

      public void close()
      Close the handler
      Specified by:
      close in class Handler