Class QueueHandler

    • Constructor Detail

      • QueueHandler

        public QueueHandler()
        Construct a new instance with a default queue length.
      • QueueHandler

        public QueueHandler​(int limit)
        Construct a new instance.
        Parameters:
        limit - the queue length to use
    • Method Detail

      • publish

        public void publish​(ExtLogRecord record)
        Description copied from class: ExtHandler
        Publish an ExtLogRecord.

        The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here.

        The ExtHandler is responsible for formatting the message, when and if necessary. The formatting should include localization.

        Overrides:
        publish in class ExtHandler
        Parameters:
        record - the log record to publish
      • doPublish

        protected void doPublish​(ExtLogRecord record)
        Description copied from class: ExtHandler
        Do the actual work of publication; the record will have been filtered already. The default implementation does nothing except to flush if the autoFlush property is set to true; if this behavior is to be preserved in a subclass then this method should be called after the record is physically written.
        Overrides:
        doPublish in class ExtHandler
        Parameters:
        record - the log record to publish
      • getLimit

        public int getLimit()
        Get the queue length limit. This is the number of messages that will be saved before old messages roll off of the queue.
        Returns:
        the queue length limit
      • setLimit

        public void setLimit​(int limit)
        Set the queue length limit. This is the number of messages that will be saved before old messages roll off of the queue.
        Parameters:
        limit - the queue length limit
      • getQueue

        public ExtLogRecord[] getQueue()
        Get a copy of the queue as it is at an exact moment in time.
        Returns:
        the copy of the queue
      • getQueueAsStrings

        public String[] getQueueAsStrings()
        Get a copy of the queue, rendering each record as a string.
        Returns:
        the copy of the queue rendered as strings
      • replay

        public void replay()
        Replay the stored queue to the nested handlers.