org.openmdx.kernel.log
Class Config

java.lang.Object
  extended by org.openmdx.kernel.log.Config

public final class Config
extends Object

The configuration for a specific logger


Constructor Summary
Config(ConfigDelegate delegation)
          Creates a new confiuration object
 
Method Summary
 String dumpLogProperties()
          Dump the log properties read from the log property file to a string
 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.
 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 isActiv()
          Checks if the configuration is still active.
 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

Config

public Config(ConfigDelegate delegation)
Creates a new confiuration object

Parameters:
delegate - A delegate
Method Detail

isActiv

public boolean isActiv()
Checks if the configuration is still active.


getInstantiationTime

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

Returns:
a Date
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

getConfigName

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

Returns:
a string
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

getApplicationId

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

Returns:
a string
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

getLogName

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

Returns:
a string
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

dumpLogProperties

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

Returns:
The stringified log properties (multiline)
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

setLogLevel

public void setLogLevel(int logLevel)
                 throws MissingResourceException
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
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

getLogLevel

public int getLogLevel()
                throws MissingResourceException
Get logging level.

This method should not be used by applications.

Returns:
the current logging level
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

enablePerformanceLog

public void enablePerformanceLog(boolean enable)
                          throws MissingResourceException
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
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

isPerformanceLog

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

Returns:
true if performance logging is active
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

enableStatisticsLog

public void enableStatisticsLog(boolean enable)
                         throws MissingResourceException
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
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

isStatisticsLog

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

Returns:
true if statistics logging is active
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

setApplicationControlledTrace

public void setApplicationControlledTrace(boolean enable,
                                          Thread thread)
                                   throws MissingResourceException
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
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

getLogProperty

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

Parameters:
name - a property name
defaultValue - a default value
Returns:
a log log property
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

equals

public boolean equals(Object obj)
               throws MissingResourceException
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.
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

getActiveEntities

public List getActiveEntities()
                       throws MissingResourceException
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
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

getReadableEntities

public List getReadableEntities()
                         throws MissingResourceException
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
Throws:
MissingResourceException

getRemoveableEntities

public List getRemoveableEntities()
                           throws MissingResourceException
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
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

removeEntity

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

Parameters:
entity - a log entity
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.

getReader

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

Parameters:
entity - a log entity
Throws:
MissingResourceException - if the delegate config object does not exist anymore. Most probably the logger has been undeployed and the reference to the config's delegate has been released.


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