Package com.microstrategy.utils.log
Class Handler
- java.lang.Object
-
- com.microstrategy.utils.log.Handler
-
- All Implemented Interfaces:
Configurable
- Direct Known Subclasses:
DebugMonitorHandler
,InMemoryHandler
,StreamHandler
,ThreadLocalDebugHandler
public abstract class Handler extends java.lang.Object implements Configurable
- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Handler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
close()
void
configure(java.lang.String propPrefix)
Requests the configurable object to configure itself.abstract void
flush()
java.lang.String
getEncoding()
protected java.lang.String
getEncodingSchemeSetting(java.lang.String alias)
java.lang.Exception
getException()
Filter
getFilter()
protected Filter
getFilterSetting(java.lang.String alias)
Formatter
getFormatter()
protected Formatter
getFormatterSetting(java.lang.String alias)
Level
getLevel()
protected Level
getLevelSetting(java.lang.String alias)
protected java.lang.String
getStringSettingWithDefaultValue(java.lang.String key, java.lang.String defaultValue)
boolean
isLoggable(LogRecord record)
abstract void
publish(LogRecord record)
void
setEncoding(java.lang.String encoding)
protected void
setException(java.lang.Exception exception)
void
setFilter(Filter newFilter)
void
setFormatter(Formatter newFormatter)
void
setLevel(Level newLevel)
-
-
-
Method Detail
-
configure
public void configure(java.lang.String propPrefix)
Description copied from interface:Configurable
Requests the configurable object to configure itself. The "partial properties key" is a parameter of this method. It allows different pluggable logger components to configure themselves without knowing their parent. For example let's assume we have in the logger.properties file a handler named "fileH". Then for the handler itself the prefix will be the "fileH". For the formatter of this handler the prefix will be "fileH.formatter". For the filter of this handler the prefix will be "fileH.filter". And so on. Here is the simplified handler creation workflow:- A handler is created based on the corresponding class property ("fileH.class" in our example).
- The handler's configure method is called with it's name as a prefix ("fileH" in our example).
- Inside this method the handler reads it's configuration properties and configures itself. Among other things it creates child components. For example it will read the "fileH.filter" property, which defines the filter class name and will create corresponding object.
- For each child component the handler will call it's configure method passing proper prefix. For example for the filter the prefix will be "fileH.filter".
- Specified by:
configure
in interfaceConfigurable
- Parameters:
propPrefix
- String The partial properties key.
-
setEncoding
public void setEncoding(java.lang.String encoding)
-
getEncoding
public java.lang.String getEncoding()
-
setFilter
public void setFilter(Filter newFilter)
-
getFilter
public Filter getFilter()
-
getException
public java.lang.Exception getException()
-
setException
protected void setException(java.lang.Exception exception)
-
setFormatter
public void setFormatter(Formatter newFormatter)
-
getFormatter
public Formatter getFormatter()
-
setLevel
public void setLevel(Level newLevel)
-
getLevel
public Level getLevel()
-
isLoggable
public boolean isLoggable(LogRecord record)
-
flush
public abstract void flush()
-
close
public abstract void close()
-
publish
public abstract void publish(LogRecord record)
-
getLevelSetting
protected Level getLevelSetting(java.lang.String alias)
-
getFilterSetting
protected Filter getFilterSetting(java.lang.String alias)
-
getFormatterSetting
protected Formatter getFormatterSetting(java.lang.String alias)
-
getStringSettingWithDefaultValue
protected java.lang.String getStringSettingWithDefaultValue(java.lang.String key, java.lang.String defaultValue)
-
getEncodingSchemeSetting
protected java.lang.String getEncodingSchemeSetting(java.lang.String alias)
-
-