org.objectweb.util.monolog.wrapper.javaLog
Class GenericHandler
java.util.logging.Handler
org.objectweb.util.monolog.wrapper.javaLog.GenericHandler
- Handler
public class GenericHandler
extends java.util.logging.Handler
Is a generic handler implementation used to wrapper java.util.logging.Handler
instance.
- S.Chassande-Barrioz
java.util.logging.Handler | handler - The real handler
|
protected String | name - The name of the handler
|
protected 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 , LEVEL_ATTRIBUTE , LOGGER_HANDLER_TYPE , MAX_SIZE_ATTRIBUTE , OUTPUT_ATTRIBUTE , PATTERN_ATTRIBUTE , ROLLING_FILE_HANDLER_TYPE |
void | close() - Close the Handler and free all associated resources.
|
void | flush() - Flush any buffered output.
|
Object | getAttribute(String name) - It retrieves the value of an attribute value of the handler.
|
String[] | getAttributeNames() - It retrieves the attributes of the handler
|
String | getEncoding() - Return the character encoding for this Handler.
|
Filter | getFilter() - Get the current Filter for this Handler.
|
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.
|
String | getName() - It retrieves the name of the handler
|
String | getType() - It retrieves the Handler type
|
boolean | isLoggable(LogRecord record) - Check if this Handler would actually log a given LogRecord.
|
void | publish(LogRecord record) - Publish a LogRecord.
|
Object | setAttribute(String _name, Object value) - It assigns an attributte to the handler.
|
void | setEncoding(String encoding) - Set the character encoding used by this Handler.
|
protected void | setException(Exception exception) - Set the most recent IO exception.
|
void | setFilter(Filter newFilter) - Set a Filter to control output on this Handler.
|
void | setFormatter(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(String name) - It assigns the name of the handler
|
handler
public java.util.logging.Handler handler
The real handler
name
protected String name
The name of the handler
type
protected String type
the type of the handler (see org.objectweb.util.monolog.api.Handler for
the possible values)
GenericHandler
public GenericHandler()
GenericHandler
public GenericHandler(String name)
GenericHandler
public GenericHandler(String name,
String type)
Builds a generic handler with its name and the type. The real handler
will be instanciated after the configuration step.
name
- is the name of the handlertype
- is the type of the handler
GenericHandler
public GenericHandler(String name,
java.util.logging.Handler h)
builds a generic handler since a real handler.
name
- is the name of the handlerh
- is the real handler
close
public void close()
Close the Handler and free all associated resources.
flush
public void flush()
Flush any buffered output.
getAttribute
public Object getAttribute(String name)
It retrieves the value of an attribute value of the handler.
- getAttribute in interface Handler
name
- is an attribute name
getAttributeNames
public String[] getAttributeNames()
It retrieves the attributes of the handler
- getAttributeNames in interface Handler
getEncoding
public String getEncoding()
Return the character encoding for this Handler.
getFilter
public Filter getFilter()
Get the current Filter for this Handler.
getFormatter
public Formatter getFormatter()
Return the Formatter for this Handler.
getLevel
public java.util.logging.Level getLevel()
Get the log level specifying which messages will be logged by this Handler.
getName
public String getName()
It retrieves the name of the handler
- getName in interface Handler
getType
public String getType()
It retrieves the Handler type
- getType in interface Handler
isLoggable
public boolean isLoggable(LogRecord record)
Check if this Handler would actually log a given LogRecord.
publish
public void publish(LogRecord record)
Publish a LogRecord.
setAttribute
public Object setAttribute(String _name,
Object value)
It assigns an attributte to the handler.
- setAttribute in interface Handler
_name
- is the attribute namevalue
- is the attribute value
- the old value is the attribute was already defined
setEncoding
public void setEncoding(String encoding)
throws SecurityException,
UnsupportedEncodingException
Set the character encoding used by this Handler.
setException
protected void setException(Exception exception)
Set the most recent IO exception.
setFilter
public void setFilter(Filter newFilter)
Set a Filter to control output on this Handler.
setFormatter
public void setFormatter(Formatter newFormatter)
Set a Formatter.
setLevel
public void setLevel(java.util.logging.Level newLevel)
Set the log level specifying which message levels will
be logged by this Handler.
setName
public void setName(String name)
It assigns the name of the handler
- setName in interface Handler