|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmdx.kernel.log.impl.Log
public class Log
Log is the base class which defines
all of the logging constants and implements any
general logging responsibilities. It dispatches the actual
logging information over to a concrete subclass of
AbstractLoggingMechanism to do the work of writing
out the log information.
| Field Summary | |
|---|---|
static boolean |
isMicrosoftVM
Reflects if the currently used VM is a Microsoft VM (J#) |
| Constructor Summary | |
|---|---|
protected |
Log()
Prevent instantiation of subclasses |
protected |
Log(String name,
Class logClass)
Public constructor to register a new log with a particular name. |
| Method Summary | |
|---|---|
protected void |
finalize()
Must close the log for the application if the application did not or could not. |
List |
getActiveEntities()
Returns a list of all active (in use) log entities that are available by the file logging mechanisms controlled by this logger. |
BootstrapLogger |
getBootstrapLogger()
Returns the bootrap logger |
ConfigDelegate |
getConfig()
Returns the logger's configuration object |
Date |
getDateOpened()
Return the date the log was opened, only valid if the log is currently open. |
String |
getHostName()
Return the host |
String |
getLogClassName()
LocationAwareLogger requires the log class name |
int |
getLoggingLevel()
Gets the logging level of the current log. |
LogProperties |
getLogProperties()
Get the log properties. |
MechanismManager |
getMechanismManager()
Returns the logger's mechanism manager. |
String |
getName()
Return the name of the log, usually passed in by the constructor. |
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 |
isBooted()
Returns true if the logger has booted.. |
boolean |
isLoggingPerformance()
Gets the logging performance state of the current log. |
boolean |
isLoggingStatistics()
Gets the logging statistics state of the current log. |
void |
loadConfig(String cfgName,
Properties logProperties)
Load the configuration |
void |
loadMechanisms()
Load the mechanisms |
void |
logEvent(LogEvent event,
boolean forceLogging)
Logs a log event to all mechanisms. |
void |
logString(Object logSource,
String logStringSummary,
Object logObj,
int loggingLevel,
int callStackOff)
Adds a message string to the log if the log's level is currently set at or above the loggingLevel passed in. |
void |
mechanismAddedEvent(AbstractLoggingMechanism mech)
Called when a new mechanism has been added. |
void |
mechanismRemovedEvent(AbstractLoggingMechanism mech)
Called when a new mechanism has been removed. |
static Log |
newLog(String name,
Class logClass)
Public constructor to register a new log with a particular name. |
void |
removeEntity(LogEntity entity)
Remove a log entity. |
void |
setApplicationControlledTrace(boolean enable,
Thread thread)
Enables/Disables tracing for the specified thread. |
void |
setLoggingLevel(int level)
Changes the logging level of the current log. |
void |
setLoggingPerformance(boolean newState)
Changes the logging performance state of the current log. |
void |
setLoggingStatistics(boolean newState)
Changes the logging statistics state of the current log. |
String |
toString()
Returns a string representation of log properties read |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean isMicrosoftVM
| Constructor Detail |
|---|
protected Log()
protected Log(String name,
Class logClass)
name - A log name. E.g.: "AppLog" (mandatory)logClass - A logger class (mandatory)| Method Detail |
|---|
public static Log newLog(String name,
Class logClass)
name - A log name. E.g.: "AppLog" (mandatory)logClass - A logger class (mandatory)
public void loadConfig(String cfgName,
Properties logProperties)
cfgName - A config name (may be logProperties - A list of log properties (may be public void loadMechanisms()
public void logEvent(LogEvent event,
boolean forceLogging)
event - A log eventforceLogging - log an event even if the currently active log
level does not permit logging
public void logString(Object logSource,
String logStringSummary,
Object logObj,
int loggingLevel,
int callStackOff)
logSource - a log source objectlogStringSummary - The log summary info (single line)logObj - A log object (detail, to be stringified, a null
object my be passed)loggingLevel - The level at which to log the string.callStackOff - a call stack correction offset. The offset must
be a positive number 0, 1, 2, 3public boolean isBooted()
The logger has booted if it is properly configured and the mechanims have been loaded.
public int getLoggingLevel()
public boolean isLoggingPerformance()
public void setLoggingPerformance(boolean newState)
public boolean isLoggingStatistics()
public void setLoggingStatistics(boolean newState)
public void setLoggingLevel(int level)
level - a new log levelpublic MechanismManager getMechanismManager()
public ConfigDelegate getConfig()
public void mechanismAddedEvent(AbstractLoggingMechanism mech)
From MechanismManagerListener interface
mechanismAddedEvent in interface MechanismManagerListenermech - public void mechanismRemovedEvent(AbstractLoggingMechanism mech)
From MechanismManagerListener interface
mechanismRemovedEvent in interface MechanismManagerListenermech - public List getActiveEntities()
From ManageableMechanism interface
getActiveEntities in interface ManageableMechanismLogEntity objectspublic List getReadableEntities()
From ManageableMechanism interface
getReadableEntities in interface ManageableMechanismpublic List getRemoveableEntities()
From ManageableMechanism interface
getRemoveableEntities in interface ManageableMechanismpublic void removeEntity(LogEntity entity)
From ManageableMechanism interface
removeEntity in interface ManageableMechanismString - an entity namepublic LogEntityReader getReader(LogEntity entity)
From ManageableMechanism interface
getReader in interface ManageableMechanismString - an entity name
public String toString()
toString in class Object
public void setApplicationControlledTrace(boolean enable,
Thread thread)
enable - enables/disables tracethread - the thread that is affectedpublic LogProperties getLogProperties()
properties - - the propertiespublic BootstrapLogger getBootstrapLogger()
properties - - the propertiespublic String getName()
public Date getDateOpened()
public String getHostName()
protected void finalize()
throws Throwable
finalize in class ObjectThrowable - Default finalizer exceptionpublic final String getLogClassName()
LocationAwareLogger requires the log class name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||