|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.config.DefaultConfigurable
org.norther.tammi.core.config.DefaultConfigurableFactory
org.norther.tammi.core.logger.AbstractLogger
public abstract class AbstractLogger
An abstract implementation of Logger.
| Field Summary | |
|---|---|
protected static boolean |
traceOn
The trace flag. |
| Fields inherited from class org.norther.tammi.core.config.DefaultConfigurable |
|---|
MODIFIED, SYNCHRONIZED, UNMODIFIED |
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.core.logger.Logger |
|---|
ACCESS, DEBUG, ERROR, FATAL, INFO, NONE, TRACE, WARN, WARNING |
| Fields inherited from interface org.norther.tammi.acorn.locale.Localizer |
|---|
ANY_NAME |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
AbstractLogger()
Contructs a new logger. |
|
| Method Summary | |
|---|---|
protected void |
activate(LoggerListener log,
String name)
Activates the specified logger listener. |
void |
addAppender(Object log,
Object appender)
Adds a new appender for the specified logger. |
void |
addFilter(String className)
Adds an exception filter. |
void |
clearAppenders(Object log)
Clears appenders of the specified logger. |
void |
clearCached()
Clears all cached entries without notifying. |
void |
clearFilters()
Clears all exception filters. |
void |
clearResourceBundleNames()
Clears all resource bundle names. |
void |
expireCached(long timestamp)
Expires all cached entries notifying them about expiration. |
void |
expireFraction(long timestamp,
float fraction)
Expires the specified fraction of cached entries notifying them about expiration. |
void |
flush()
Flushes queued log entries. |
boolean |
getAdditivity(Object log)
Gets the additivity of the specified logger. |
protected Object |
getAnonymousLogger(int level)
Gets the logger for the specified level. |
String[] |
getAppenderNames(Object log)
Gets appender names of the specified logger. |
int |
getBufferSize()
Gets the log buffer size. |
ConcurrentMap |
getCache(boolean create)
Gets and optionally creates the cache. |
String |
getDefaultBaseName()
Gets the default base name. |
ObjectName |
getFallbackResourcesName()
Gets the fallback resources of this map. |
String[] |
getFilters()
Gets exception filters. |
Object |
getInstance(String className,
ObjectName loader,
Object[] params,
String[] signature)
Gets an instance of a named class using a specified class loader. |
int |
getLevel()
Gets the root level. |
int |
getLevel(Object log)
Gets the level of the specified logger. |
String |
getLocalizedMessage(Object msg)
Gets a localized message for the default locale. |
String |
getLocalizedMessage(Object msg,
Locale locale)
Gets a localized message for the specified locale. |
String |
getLogClassName()
Gets the log implementation class name. |
String |
getLoggerName(int level)
Gets the logger name for the specified level. |
protected String |
getLoggerName(Object log)
Gets the logger name for the specified log object. |
protected abstract Object |
getNativeLogger(String name)
Gets a named native logger. |
String |
getPlugInBaseName(String key)
Gets the base name of the resource bundle class associated with the specified plug-in key. |
int |
getPollingInterval()
Gets the interval of polling new enries for logging. |
long |
getRefreshed()
Gets the last refresh timestamp. |
LookupResourceBundle |
getResourceBundle(String baseName)
Gets a resource bundle for the specified base name. |
LookupResourceBundle |
getResourceBundle(String baseName,
Locale locale)
Gets a resource bundle for the specified base name and locale. |
String |
getResourceBundleName(String qualifier)
Gets the qualified resource bundle name. |
ObjectName |
getResourceFinderName()
Gets the resource finder of this map. |
String |
getTimeZoneId()
Gets the default time zone. |
boolean |
isCachingDisabled()
Checks whether the caching is disabled. |
boolean |
isDefaultLogFactory()
Checks whether a default log factory. |
boolean |
isLoaderSupported(String className)
Checks if specified class loaders are supported for a named class. |
boolean |
isStackTrace()
Gets the stack trace flag for all categories called through this logger instance. |
boolean |
isStaticTrace()
Gets the trace flag for the static trace methods. |
boolean |
isSystemErrLogged()
Checks if system err is to be logged by this logger. |
boolean |
isSystemOutLogged()
Checks if system out is to be logged by this logger. |
void |
log(int level,
long time,
String msg,
Object arg)
Logs a message with a specific level, date and argument. |
void |
log(int level,
long time,
String msg,
Object arg,
Throwable cause)
Logs a message with a specific level, date, argument and reason. |
void |
log(int level,
Object msg)
Logs a message with a specific level. |
void |
log(int level,
String msg,
Object arg)
Logs a message with a specific level and argument. |
void |
log(int level,
String msg,
Object arg,
Throwable reason)
Logs a message with a specific level, argument and reason. |
void |
log(Object log,
int level,
long time,
String msg,
Object arg)
Logs a message with a specific logger, level, date and argument. |
void |
log(Object log,
int level,
long time,
String msg,
Object arg,
Throwable cause)
Logs a message with a specific logger, level, date, argument and reason. |
void |
log(Object log,
int level,
Object msg)
Logs a message with a specific logger and level. |
void |
log(Object log,
int level,
String msg,
Object arg)
Logs a message with a specific logger, level and argument. |
void |
log(Object log,
int level,
String msg,
Object arg,
Throwable cause)
Logs a message with a specific logger, level, argument and reason. |
void |
postmanaged()
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time. |
protected abstract void |
push(LogEntry entry)
Pushes a log entry into a queue. |
Set |
qualifierSet()
Returns a read-only set of resource qualifiers. |
void |
refresh()
Refreshes the MBean. |
void |
removeAppender(Object log,
String appender)
Removes an appender from the specified logger. |
void |
removeCache()
Removes the cache. |
void |
removeFilter(String className)
Removes an exception filter. |
void |
removeResourceBundleName(String qualifier)
Removes the resource bundle name of the qualified name. |
Object |
resolveLocalizedObject(String name,
String key)
Resolves a localized object for the qualified name and key. |
Object |
resolveLocalizedObject(String name,
String key,
Locale locale)
Resolves a localized object for the qualified name, key and locale. |
Object |
resolveLocalizedResource(String name,
String key)
Resolves a localized resource for the qualified name and key. |
Object |
resolveLocalizedResource(String name,
String key,
Locale locale)
Resolves a localized resource for the qualified name, key and locale. |
String |
resolveLocalizedString(String name,
String key)
Resolves a localized string for the qualified name and key. |
String |
resolveLocalizedString(String name,
String key,
Locale locale)
Resolves a localized string for the qualified name, key and locale. |
String[] |
resolveLocalizedStrings(String name,
String key)
Resolves a localized string array for the qualified name and key. |
String[] |
resolveLocalizedStrings(String name,
String key,
Locale locale)
Resolves a localized string array for the qualified name, key and locale. |
LookupResourceBundle |
resolveResourceBundle(String name)
Resolves a resource bundle for the qualified name. |
LookupResourceBundle |
resolveResourceBundle(String name,
Locale locale)
Resolves a resource bundle for the qualified name and locale. |
String |
resolveResourceBundleName(String name)
Resolves a resource bundle name for the qualified name. |
void |
setAdditivity(Object log,
boolean additivity)
Sets the additivity of the specified logger. |
void |
setBufferSize(int size)
Sets the log buffer size. |
void |
setCachingDisabled(boolean flag)
Sets the caching disabled flag. |
void |
setDefaultBaseName(String baseName)
Sets the default base name. |
void |
setDefaultLogFactory(boolean flag)
Sets whether a default log factory. |
void |
setFallbackResourcesName(ObjectName finder)
Sets the fallback resources of this map. |
void |
setFilters(String[] classNames)
Sets exception filters. |
void |
setLevel(int level)
Sets the root level. |
void |
setLevel(Object log,
int level)
Sets the level of the specified logger. |
void |
setLevelAsString(Object log,
String level)
Sets the level of the specified logger as a string. |
void |
setLevelAsString(String level)
Sets the root level as a string. |
void |
setLogClassName(String className)
Sets the log implementation class name. |
void |
setLoggerName(int level,
String name)
Sets the logger name for the specified level. |
void |
setPollingInterval(int msecs)
Sets the interval of polling new enries for logging. |
void |
setResourceBundleName(String qualifier,
String baseName)
Sets the resource bundle name of the qualified name. |
void |
setResourceFinderName(ObjectName finder)
Sets the resource finder of this map. |
void |
setStackTrace(boolean flag)
Sets the stack trace flag for all categories called through this logger instance. |
void |
setStaticTrace(boolean flag)
Sets the trace flag for static trace methods. |
void |
setSystemErrLogged(boolean flag)
Sets if system err if to be logged by this logger. |
void |
setSystemOutLogged(boolean flag)
Sets if system out is to be logged by this logger. |
void |
setTimeZoneId(String zone)
Sets the default time zone. |
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
| Methods inherited from class org.norther.tammi.core.config.DefaultConfigurableFactory |
|---|
getInstance, getInstance, getInstance |
| Methods inherited from class org.norther.tammi.core.config.DefaultConfigurable |
|---|
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getConfiguration, getModifiedState, getProperties, getProperty, getPropertyFilePath, indexOfProperty, loadConfiguration, loadConfiguration, loadConfiguration, modified, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setModifiedState, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, storeProperties |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.core.logger.Logger |
|---|
getLoggerClassName, isLog, isLog, release |
| Methods inherited from interface org.norther.tammi.core.base.ObjectFactory |
|---|
getInstance, getInstance, getInstance |
| Methods inherited from interface org.norther.tammi.core.config.Configurable |
|---|
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getProperties, getProperty, getPropertyFilePath, indexOfProperty, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, storeProperties |
| Field Detail |
|---|
protected static boolean traceOn
| Constructor Detail |
|---|
public AbstractLogger()
| Method Detail |
|---|
public void postmanaged()
Manageable
postmanaged in interface Manageablepostmanaged in class Adaptee
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class AdapteeException - if the adaptee refused to be unmanaged.public boolean isStaticTrace()
Logger
isStaticTrace in interface Loggerpublic void setStaticTrace(boolean flag)
Logger
setStaticTrace in interface Loggerflag - the static trace on/off flag.public boolean isStackTrace()
Logger
isStackTrace in interface Loggerpublic void setStackTrace(boolean flag)
Logger
setStackTrace in interface Loggerflag - the stack trace on/off flag.public int getBufferSize()
Logger
getBufferSize in interface Loggerpublic void setBufferSize(int size)
Logger
setBufferSize in interface Loggersize - the buffer size as a number of log entries.public int getPollingInterval()
Logger
getPollingInterval in interface Loggerpublic void setPollingInterval(int msecs)
Logger
setPollingInterval in interface Loggermsecs - the polling interval in msecs.public String getTimeZoneId()
Logger
getTimeZoneId in interface Loggerpublic void setTimeZoneId(String zone)
Logger
setTimeZoneId in interface Loggerzone - the default time zone of log entries.public boolean isDefaultLogFactory()
Logger
isDefaultLogFactory in interface Loggerpublic void setDefaultLogFactory(boolean flag)
Logger
setDefaultLogFactory in interface Loggerflag - true if a default factory, false otherwise.public String getLogClassName()
Logger
getLogClassName in interface Loggerpublic void setLogClassName(String className)
Logger
setLogClassName in interface LoggerclassName - the log class name.public String getLoggerName(int level)
Logger
getLoggerName in interface Loggerlevel - the level.
public void setLoggerName(int level,
String name)
Logger
setLoggerName in interface Loggerlevel - the level.name - the logger name.public int getLevel()
Logger
getLevel in interface Loggerpublic void setLevel(int level)
Logger
setLevel in interface Loggerlevel - the level.public void setLevelAsString(String level)
Logger
setLevelAsString in interface Loggerlevel - the level as a string.public int getLevel(Object log)
Logger
getLevel in interface Loggerlog - the logger.
public void setLevel(Object log,
int level)
Logger
setLevel in interface Loggerlog - the logger.level - the level.
public void setLevelAsString(Object log,
String level)
Logger
setLevelAsString in interface Loggerlog - the logger.level - the level as a string.public boolean getAdditivity(Object log)
Logger
getAdditivity in interface Loggerlog - the logger.
public void setAdditivity(Object log,
boolean additivity)
Logger
setAdditivity in interface Loggerlog - the logger.additivity - the additivity.
public void addAppender(Object log,
Object appender)
Logger
addAppender in interface Loggerlog - the logger.appender - the appender class name.public String[] getAppenderNames(Object log)
Logger
getAppenderNames in interface Loggerlog - the logger.
public void removeAppender(Object log,
String appender)
Logger
removeAppender in interface Loggerlog - the logger.appender - the appender name.public void clearAppenders(Object log)
Logger
clearAppenders in interface Loggerlog - the logger.public String[] getFilters()
Logger
getFilters in interface Loggerpublic void setFilters(String[] classNames)
Logger
setFilters in interface LoggerclassNames - an array of exception filters.public void addFilter(String className)
Logger
addFilter in interface LoggerclassName - the class name of a filtered exception.public void removeFilter(String className)
Logger
removeFilter in interface LoggerclassName - the class name of a filtered exception.public void clearFilters()
Logger
clearFilters in interface Logger
public void log(int level,
Object msg)
Logger
log in interface Loggerlevel - the level of the message.msg - the message to log.
public void log(int level,
String msg,
Object arg)
Logger
log in interface Loggerlevel - the level of the message.msg - the message to log.arg - the argument or cause.
public void log(int level,
String msg,
Object arg,
Throwable reason)
Logger
log in interface Loggerlevel - the level of the message.msg - the message to log.arg - the argument.reason - the cause.
public void log(int level,
long time,
String msg,
Object arg)
Logger
log in interface Loggerlevel - the level of the message.time - the time of the event.msg - the message to log.arg - the argument or cause.
public void log(int level,
long time,
String msg,
Object arg,
Throwable cause)
Logger
log in interface Loggerlevel - the level of the message.time - the time of the event.msg - the message to log.arg - the argument.cause - the cause.
public void log(Object log,
int level,
Object msg)
Logger
log in interface Loggerlog - the logger.level - the level of the message.msg - the message to log.
public void log(Object log,
int level,
String msg,
Object arg)
Logger
log in interface Loggerlog - the logger.level - the level of the message.msg - the message to log.arg - the argument or cau