public class GenericHandler extends java.util.logging.Handler implements Handler
Modifier and Type | Field and Description |
---|---|
java.util.logging.Handler |
handler
The real handler
|
protected java.lang.String |
name
The name of the handler
|
protected java.lang.String |
type
the type of the handler (see org.objectweb.util.monolog.api.Handler for
the possible values)
|
APPEND_MODE_ATTRIBUTE, BUFFER_ATTRIBUTE, CONSOLE_HANDLER_TYPE, FILE_HANDLER_TYPE, FILE_NUMBER_ATTRIBUTE, GENERIC_HANDLER_TYPE, JMX_HANDLER_TYPE, LEVEL_ATTRIBUTE, LOGGER_HANDLER_TYPE, MAX_SIZE_ATTRIBUTE, OUTPUT_ATTRIBUTE, PATTERN_ATTRIBUTE, ROLLING_FILE_HANDLER_TYPE
Constructor and Description |
---|
GenericHandler() |
GenericHandler(java.lang.String name) |
GenericHandler(java.lang.String name,
java.util.logging.Handler h)
builds a generic handler since a real handler.
|
GenericHandler(java.lang.String name,
java.lang.String type)
Builds a generic handler with its name and the type.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the Handler and free all associated resources.
|
void |
flush()
Flush any buffered output.
|
java.lang.Object |
getAttribute(java.lang.String name)
It retrieves the value of an attribute value of the handler.
|
java.lang.String[] |
getAttributeNames()
It retrieves the attributes of the handler
|
java.lang.String |
getEncoding()
Return the character encoding for this Handler.
|
java.util.logging.Filter |
getFilter()
Get the current Filter for this Handler.
|
java.util.logging.Formatter |
getFormatter()
Return the Formatter for this Handler.
|
java.util.logging.Level |
getLevel()
Get the log level specifying which messages will be logged by this Handler.
|
java.lang.String |
getName()
It retrieves the name of the handler
|
java.lang.String |
getType()
It retrieves the Handler type
|
boolean |
isLoggable(java.util.logging.LogRecord record)
Check if this Handler would actually log a given LogRecord.
|
void |
publish(java.util.logging.LogRecord record)
Publish a LogRecord.
|
java.lang.Object |
setAttribute(java.lang.String _name,
java.lang.Object value)
It assigns an attributte to the handler.
|
void |
setEncoding(java.lang.String encoding)
Set the character encoding used by this Handler.
|
protected void |
setException(java.lang.Exception exception)
Set the most recent IO exception.
|
void |
setFilter(java.util.logging.Filter newFilter)
Set a Filter to control output on this Handler.
|
void |
setFormatter(java.util.logging.Formatter newFormatter)
Set a Formatter.
|
void |
setLevel(java.util.logging.Level newLevel)
Set the log level specifying which message levels will
be logged by this Handler.
|
void |
setName(java.lang.String name)
It assigns the name of the handler
|
public java.util.logging.Handler handler
protected java.lang.String type
protected java.lang.String name
public GenericHandler()
public GenericHandler(java.lang.String name)
public GenericHandler(java.lang.String name, java.lang.String type)
name
- is the name of the handlertype
- is the type of the handlerpublic GenericHandler(java.lang.String name, java.util.logging.Handler h)
name
- is the name of the handlerh
- is the real handlerpublic java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getType()
public java.lang.String[] getAttributeNames()
getAttributeNames
in interface Handler
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface Handler
name
- is an attribute namepublic java.lang.Object setAttribute(java.lang.String _name, java.lang.Object value)
setAttribute
in interface Handler
_name
- is the attribute namevalue
- is the attribute valuepublic void close()
close
in class java.util.logging.Handler
public void flush()
flush
in class java.util.logging.Handler
public java.lang.String getEncoding()
getEncoding
in class java.util.logging.Handler
public java.util.logging.Filter getFilter()
getFilter
in class java.util.logging.Handler
public java.util.logging.Formatter getFormatter()
getFormatter
in class java.util.logging.Handler
public java.util.logging.Level getLevel()
getLevel
in class java.util.logging.Handler
public boolean isLoggable(java.util.logging.LogRecord record)
isLoggable
in class java.util.logging.Handler
public void publish(java.util.logging.LogRecord record)
publish
in class java.util.logging.Handler
public void setEncoding(java.lang.String encoding) throws java.lang.SecurityException, java.io.UnsupportedEncodingException
setEncoding
in class java.util.logging.Handler
java.lang.SecurityException
java.io.UnsupportedEncodingException
protected void setException(java.lang.Exception exception)
public void setFilter(java.util.logging.Filter newFilter)
setFilter
in class java.util.logging.Handler
public void setFormatter(java.util.logging.Formatter newFormatter)
setFormatter
in class java.util.logging.Handler
public void setLevel(java.util.logging.Level newLevel)
setLevel
in class java.util.logging.Handler