|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.logging.Handler
public abstract class Handler
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. |
| Method Summary | |
|---|---|
abstract void |
close()
Closes this handler. |
abstract void |
flush()
Flushes any buffered output. |
String |
getEncoding()
Gets the character encoding used by this handler. |
ErrorManager |
getErrorManager()
Gets the error manager used by this handler to report errors during logging. |
Filter |
getFilter()
Gets the filter used by this handler. |
Formatter |
getFormatter()
Gets the formatter used by this handler to format the logging messages. |
Level |
getLevel()
Gets the logging level of this handler. |
(package private) void |
initProperties(String defaultLevel,
String defaultFilter,
String defaultFormatter,
String defaultEncoding)
|
(package private) void |
internalSetEncoding(String newEncoding)
Sets the character encoding used by this handler. |
(package private) void |
internalSetFormatter(Formatter newFormatter)
Sets the formatter to be used by this handler. |
boolean |
isLoggable(LogRecord record)
Determines whether the supplied log record need to be logged. |
(package private) void |
printInvalidPropMessage(String key,
String value,
Exception e)
|
abstract void |
publish(LogRecord record)
Accepts an actual logging request. |
protected void |
reportError(String msg,
Exception ex,
int code)
Report an error to the error manager associated with this handler. |
void |
setEncoding(String encoding)
Sets the character encoding used by this handler. |
void |
setErrorManager(ErrorManager em)
Sets the error manager for this handler. |
void |
setFilter(Filter newFilter)
Sets the filter to be used by this handler. |
void |
setFormatter(Formatter newFormatter)
Sets the formatter to be used by this handler. |
void |
setLevel(Level newLevel)
Sets the logging level of this handler. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Handler()
Handler object with a default error manager,
the default encoding, and the default logging level
Level.ALL. It has no filter and no formatter.
| Method Detail |
|---|
void printInvalidPropMessage(String key,
String value,
Exception e)
void initProperties(String defaultLevel,
String defaultFilter,
String defaultFormatter,
String defaultEncoding)
public abstract void close()
SecurityException - If a security manager determines that the caller does not
have the required permission.public abstract void flush()
public abstract void publish(LogRecord record)
record - the log record to be loggedpublic String getEncoding()
public ErrorManager getErrorManager()
SecurityException - If a security manager determines that the caller does not
have the required permission.public Filter getFilter()
public Formatter getFormatter()
public Level getLevel()
public boolean isLoggable(LogRecord record)
record - the log record to be checked
true if the supplied log record need to be logged,
otherwise false
protected void reportError(String msg,
Exception ex,
int code)
msg - the error messageex - the associated exceptioncode - the error code
void internalSetEncoding(String newEncoding)
throws UnsupportedEncodingException
null
value indicates the using of the default encoding. This internal method
does not check security.
newEncoding - the character encoding to set
UnsupportedEncodingException - If the specified encoding is not supported by the runtime.
public void setEncoding(String encoding)
throws SecurityException,
UnsupportedEncodingException
null
value indicates the using of the default encoding.
encoding - the character encoding to set
SecurityException - If a security manager determines that the caller does not
have the required permission.
UnsupportedEncodingException - If the specified encoding is not supported by the runtime.public void setErrorManager(ErrorManager em)
em - the error manager to set
SecurityException - If a security manager determines that the caller does not
have the required permission.public void setFilter(Filter newFilter)
newFilter - the filter to set
SecurityException - If a security manager determines that the caller does not
have the required permission.void internalSetFormatter(Formatter newFormatter)
newFormatter - the formatter to setpublic void setFormatter(Formatter newFormatter)
newFormatter - the formatter to set
SecurityException - If a security manager determines that the caller does not
have the required permission.public void setLevel(Level newLevel)
newLevel - the logging level to set
SecurityException - If a security manager determines that the caller does not
have the required permission.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||