| java.lang.Object java.util.logging.Handler
All known Subclasses: java.util.logging.MemoryHandler, java.util.logging.StreamHandler,
Handler | abstract public class Handler (Code) | | 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 | |
protected | Handler() Constructs a Handler object with a default error manager,
the default encoding, and the default logging level
Level.ALL . |
Handler | protected Handler()(Code) | | Constructs a Handler object with a default error manager,
the default encoding, and the default logging level
Level.ALL . It has no filter and no formatter.
|
close | abstract public void close()(Code) | | Closes this handler. A flush operation will usually be performed and all
the associated resources will be freed. Client applications should not
use a handler after closing it.
throws: SecurityException - If a security manager determines that the caller does nothave the required permission. |
flush | abstract public void flush()(Code) | | Flushes any buffered output.
|
getEncoding | public String getEncoding()(Code) | | Gets the character encoding used by this handler.
the character encoding used by this handler |
getErrorManager | public ErrorManager getErrorManager()(Code) | | Gets the error manager used by this handler to report errors during
logging.
the error manager used by this handler throws: SecurityException - If a security manager determines that the caller does nothave the required permission. |
getFilter | public Filter getFilter()(Code) | | Gets the filter used by this handler.
the filter used by this handler |
getFormatter | public Formatter getFormatter()(Code) | | Gets the formatter used by this handler to format the logging messages.
the formatter used by this handler |
getLevel | public Level getLevel()(Code) | | Gets the logging level of this handler.
the logging level of this handler |
internalSetEncoding | void internalSetEncoding(String newEncoding) throws UnsupportedEncodingException(Code) | | Sets the character encoding used by this handler. A null
value indicates the using of the default encoding. This internal method
does not check security.
Parameters: newEncoding - the character encoding to set throws: UnsupportedEncodingException - If the specified encoding is not supported by the runtime. |
internalSetFormatter | void internalSetFormatter(Formatter newFormatter)(Code) | | Sets the formatter to be used by this handler. This internal method does
not check security.
Parameters: newFormatter - the formatter to set |
isLoggable | public boolean isLoggable(LogRecord record)(Code) | | Determines whether the supplied log record need to be logged. The logging
levels will be checked as well as the filter.
Parameters: record - the log record to be checked true if the supplied log record need to be logged,otherwise false |
publish | abstract public void publish(LogRecord record)(Code) | | Accepts an actual logging request.
Parameters: record - the log record to be logged |
reportError | protected void reportError(String msg, Exception ex, int code)(Code) | | Report an error to the error manager associated with this handler.
Parameters: msg - the error message Parameters: ex - the associated exception Parameters: code - the error code |
setErrorManager | public void setErrorManager(ErrorManager em)(Code) | | Sets the error manager for this handler.
Parameters: em - the error manager to set throws: SecurityException - If a security manager determines that the caller does nothave the required permission. |
setFilter | public void setFilter(Filter newFilter)(Code) | | Sets the filter to be used by this handler.
Parameters: newFilter - the filter to set throws: SecurityException - If a security manager determines that the caller does nothave the required permission. |
setFormatter | public void setFormatter(Formatter newFormatter)(Code) | | Sets the formatter to be used by this handler.
Parameters: newFormatter - the formatter to set throws: SecurityException - If a security manager determines that the caller does nothave the required permission. |
setLevel | public void setLevel(Level newLevel)(Code) | | Sets the logging level of this handler.
Parameters: newLevel - the logging level to set throws: SecurityException - If a security manager determines that the caller does nothave the required permission. |
|
|