org.openmdx.kernel.log.impl
Class ConfigDelegate

java.lang.Object
  extended by org.openmdx.kernel.log.impl.ConfigDelegate

public final class ConfigDelegate
extends Object

The configuration for a specific logger.


Constructor Summary
ConfigDelegate(Log logger, String cfgName, LogProperties logProperties)
          Creates a new confiuration object.
 
Method Summary
 String dumpLogProperties()
          Dump the log properties read from the log property file to.
 void enablePerformanceLog(boolean enable)
          Enable/Disable performance logging.
 void enableStatisticsLog(boolean enable)
          Enable/Disable statistics logging.
 boolean equals(Object obj)
          Checks whether some other object is "equal to" this one.
 List getActiveEntities()
          Returns a list of all active (in use) log entities that are available by the file logging mechanisms controlled by this logger.
 String getApplicationId()
          Return the application name view string that the logs pertain to.
 String getConfigName()
          Return the application name string that the logs pertain to.
 Date getInstantiationTime()
          Return the instantion timestamp of the Config object.
 Log getLogger()
          Returns the associated logger.
 int getLogLevel()
          Get logging level.
 String getLogName()
          Return the log name ("AppLog", "SysLog").
 String getLogProperty(String name, String defaultValue)
          Returns the specified log property from the log configuration.
 List getReadableEntities()
          Returns a list of all readable log entities that are available by the file logging mechanisms controlled by this logger.
 LogEntityReader getReader(LogEntity entity)
          Returns an entity reader for given log entity.
 List getRemoveableEntities()
          Returns a list of all removeable log entities that are available by the file logging mechanisms controlled by this logger.
 boolean isPerformanceLog()
          Checks if performance logging is active.
 boolean isStatisticsLog()
          Checks if statistics logging is active.
 void removeEntity(LogEntity entity)
          Remove a log entity.
 void setApplicationControlledTrace(boolean enable, Thread thread)
          Enables/Disables tracing for the specified thread.
 void setLogLevel(int logLevel)
          Set logging level.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigDelegate

public ConfigDelegate(Log logger,
                      String cfgName,
                      LogProperties logProperties)
Creates a new confiuration object.

Parameters:
logger - The associated logger
cfgName - The configuration name
logProperties - The log properties
Method Detail

getInstantiationTime

public Date getInstantiationTime()
Return the instantion timestamp of the Config object. P.S. the logger has the same instantiation time.

Returns:
a Date

getConfigName

public String getConfigName()
Return the application name string that the logs pertain to.

Returns:
a string

getApplicationId

public String getApplicationId()
Return the application name view string that the logs pertain to.

Returns:
a string

getLogName

public String getLogName()
Return the log name ("AppLog", "SysLog").

Returns:
a string

dumpLogProperties

public String dumpLogProperties()
Dump the log properties read from the log property file to. a string

Returns:
A string

setLogLevel

public void setLogLevel(int logLevel)
Set logging level.

This method should not be used by applications. The logging level is set in the log property file.

Parameters:
level - - a new logging level

getLogLevel

public int getLogLevel()
Get logging level.

This method should not be used by applications.


enablePerformanceLog

public void enablePerformanceLog(boolean enable)
Enable/Disable performance logging.

This method should not be used by applications. The performance log state is set in the log property file.

Parameters:
enable - enable if true

isPerformanceLog

public boolean isPerformanceLog()
Checks if performance logging is active.

Returns:
true if performance logging is active

enableStatisticsLog

public void enableStatisticsLog(boolean enable)
Enable/Disable statistics logging.

This method should not be used by applications. The statistics log state is set in the log property file.

Parameters:
enable - enable if true

isStatisticsLog

public boolean isStatisticsLog()
Checks if statistics logging is active.

Returns:
true if statistics logging is active

setApplicationControlledTrace

public void setApplicationControlledTrace(boolean enable,
                                          Thread thread)
Enables/Disables tracing for the specified thread. If application controlled tracing has been enabled through configuration setApplicationControlledTrace(true, thread) allows applications to force logs at level TRACE_LEVEL regardless the actual configuration state of the TRACE_LEVEL. A setApplicationControlledTrace(false, thread) lets the log level TRACE_LEVEL control the trace output of the specified thread.

Parameters:
enable - enables/disables trace
thread - the thread that is affected

getLogProperty

public String getLogProperty(String name,
                             String defaultValue)
Returns the specified log property from the log configuration.

Parameters:
name - a property name
defaultValue - a default value
Returns:
a string

equals

public boolean equals(Object obj)
Checks whether some other object is "equal to" this one.

Overrides:
equals in class Object
Parameters:
obj - The reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

getActiveEntities

public List getActiveEntities()
Returns a list of all active (in use) log entities that are available by the file logging mechanisms controlled by this logger.

Returns:
a list of LogEntity objects

getReadableEntities

public List getReadableEntities()
Returns a list of all readable log entities that are available by the file logging mechanisms controlled by this logger.

Returns:
a list of LogEntity objects

getRemoveableEntities

public List getRemoveableEntities()
Returns a list of all removeable log entities that are available by the file logging mechanisms controlled by this logger.

Returns:
a list of LogEntity objects

removeEntity

public void removeEntity(LogEntity entity)
Remove a log entity.

Parameters:
String - an entity name

getReader

public LogEntityReader getReader(LogEntity entity)
Returns an entity reader for given log entity.

Parameters:
String - an entity name

getLogger

public Log getLogger()
Returns the associated logger.

Returns:
a logger


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.