IT. Expert System.

Android Reference

Handler


java.util.logging

Class Handler

  • Direct Known Subclasses:
    MemoryHandler, StreamHandler


    public abstract class Handler
    extends Object
    A Handler object accepts a logging request and exports the desired messages to a target, for example, a file, the console, etc. It can be disabled by setting its logging level to Level.OFF.
    • Constructor Summary

      Constructors
      Modifier Constructor and Description
      protected Handler()
      Constructs a Handler object with a default error manager instance ErrorManager, the default encoding, and the default logging level Level.ALL.
    • Constructor Detail

      • Handler

        protected Handler()
        Constructs a Handler object with a default error manager instance ErrorManager, the default encoding, and the default logging level Level.ALL. It has no filter and no formatter.
    • Method Detail

      • close

        public abstract void close()
        Closes this handler. A flush operation will be performed and all the associated resources will be freed. Client applications should not use this handler after closing it.
      • flush

        public abstract void flush()
        Flushes any buffered output.
      • publish

        public abstract void publish(LogRecord record)
        Accepts a logging request and sends it to the the target.
        Parameters:
        record - the log record to be logged; null records are ignored.
      • getEncoding

        public String getEncoding()
        Gets the character encoding used by this handler, null for default encoding.
        Returns:
        the character encoding used by this handler.
      • getErrorManager

        public ErrorManager getErrorManager()
        Gets the error manager used by this handler to report errors during logging.
        Returns:
        the error manager used by this handler.
      • getFilter

        public Filter getFilter()
        Gets the filter used by this handler.
        Returns:
        the filter used by this handler (possibly null).
      • getFormatter

        public Formatter getFormatter()
        Gets the formatter used by this handler to format the logging messages.
        Returns:
        the formatter used by this handler (possibly null).
      • getLevel

        public Level getLevel()
        Gets the logging level of this handler, records with levels lower than this value will be dropped.
        Returns:
        the logging level of this handler.
      • isLoggable

        public boolean isLoggable(LogRecord record)
        Determines whether the supplied log record needs to be logged. The logging levels will be checked as well as the filter.
        Parameters:
        record - the log record to be checked.
        Returns:
        true if the supplied log record needs to be logged, otherwise false.
      • reportError

        protected void reportError(String msg,
                       Exception ex,
                       int code)
        Reports an error to the error manager associated with this handler, ErrorManager is used for that purpose. No security checks are done, therefore this is compatible with environments where the caller is non-privileged.
        Parameters:
        msg - the error message, may be null.
        ex - the associated exception, may be null.
        code - an ErrorManager error code.
      • setEncoding

        public void setEncoding(String encoding)
                         throws UnsupportedEncodingException
        Sets the character encoding used by this handler, null indicates a default encoding.
        Parameters:
        encoding - the character encoding to set.
        Throws:
        UnsupportedEncodingException - if the specified encoding is not supported by the runtime.
      • setErrorManager

        public void setErrorManager(ErrorManager newErrorManager)
        Sets the error manager for this handler.
        Parameters:
        newErrorManager - the error manager to set.
        Throws:
        NullPointerException - if em is null.
      • setFilter

        public void setFilter(Filter newFilter)
        Sets the filter to be used by this handler.
        Parameters:
        newFilter - the filter to set, may be null.
      • setFormatter

        public void setFormatter(Formatter newFormatter)
        Sets the formatter to be used by this handler.
        Parameters:
        newFormatter - the formatter to set.
        Throws:
        NullPointerException - if newFormatter is null.
      • setLevel

        public void setLevel(Level newLevel)
        Sets the logging level of the messages logged by this handler, levels lower than this value will be dropped.
        Parameters:
        newLevel - the logging level to set.
        Throws:
        NullPointerException - if newLevel is null.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 284 / 158862313. Delta: 0.04835 с