|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmdx.kernel.log.impl.LogProperties
public class LogProperties
LogProperties is a concrete class which manages all of the default start-up properties for logs. There is only one singleton instance of this class. The first time the application uses this class, it will attempt to read its properties from the file named [App].log.properties in the current directory, where [App] is the application name taken from the associated log class. If the file cannot be read the default property file LogProperties.properties from the log package will be read instead. This allows an easy "out-of-the-box" usage of the log package as well as sophisticated configuration capabilites. The following property tags and defaults will be used when reading the log property file:
ApplicationId = XXXX
LogFileExtension = log
LogFilePath = c:/temp
LogLevel = 2
java.LoggingMechanism = StandardErrLoggingMechanism
LogPerformance = {false|true}
LogStatistics = {false|true}
LogNotification = {false|true}
ApplicationControlledTracing = {false|true}
LogVmPropertiesSuppress = item1,item2,item3,...
If the property 'LogFilePath' is empty the file logs go to the current working directory. If the property 'LogFilePath' is omitted the file logs go to the platforms temp directory (Usually /tmp for UNIX, and "C:\Documents and Settings\%USER%\Local Settings\Temp" on Windows 2000 (according to the environment variable TEMP).
Any of the above property tags (except 'LogFileExtension' and 'LogFilePath' can be overridden for a particular log, by prefixing the property key by the log name.
If 'LogVmPropertiesSuppress' is missing only some standard VM properties get logged. If 'LogVmPropertiesSuppress' contains a comma separated list of suppressed property names all VM properties except the ones that match the suppress list are logged. A property matches the suppress list if it its name contains one of the suppressed items.
Also note that because you may have more than one logging mechanism open for the same log, append a consecutive integer to the property starting at 2.
For example:
LogFilePath = /tmp AppLog.LogLevel = 3 AppLog.java.LoggingMechanism = StandardErrorLoggingMechanism AppLog.java.LoggingMechanism2 = SharedFileLoggingMechanism AppLog.java.LoggingMechanism3 = CorbaLoggingMechanism
| Field Summary | |
|---|---|
static String |
STANDARD_ERROR_MECHANISM
|
| Constructor Summary | |
|---|---|
LogProperties(Log log,
String configName,
ClassLoader propertyFileClassLoader,
Properties applicationProperties)
Constructor |
|
| Method Summary | |
|---|---|
Properties |
getAllProperties()
Returns all properties. |
String |
getApplicationId(String logName)
Returns application. |
String |
getLoggingExtension(String logName)
Returns the log filename extension for a specific logger. |
int |
getLoggingLevel(String logName)
Returns the logging level for a specific logger. |
String[] |
getLoggingMechanismNames(String logName)
Return the logging mechanisms for a specific logger. |
String |
getLoggingPath(String logName)
Returns the file path the log file should be written out under. |
String |
getProperty(String logName,
String key,
String defaultValue)
Returns the log property for a given key. |
static boolean |
isDebuggingEnabled()
Checks if log framework debugging is enabled. |
boolean |
isLoggingNotification(String logName)
Checks if log notification is enabled for a specific logger |
boolean |
isLoggingPerformance(String logName)
Checks if performance logs are enabled for a specific logger. |
boolean |
isLoggingStatistics(String logName)
Checks if statistics logs are enabled for a specific logger. |
String |
toString()
Returns a string representation of log properties read |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String STANDARD_ERROR_MECHANISM
| Constructor Detail |
|---|
public LogProperties(Log log,
String configName,
ClassLoader propertyFileClassLoader,
Properties applicationProperties)
| Method Detail |
|---|
public Properties getAllProperties()
public String getProperty(String logName,
String key,
String defaultValue)
Actually tries to read properties using the following name strategy and returns the default value if no value could be found for any of the names.
logName - a logger's name {AppLog, SysLog, ...}key - the propertie's namedefaultValue - the propertie's default value
public String getApplicationId(String logName)
logName - a logger's name {AppLog, SysLog, ...}
public String getLoggingPath(String logName)
logName - a logger's name {AppLog, SysLog, ...}
public String getLoggingExtension(String logName)
logName - a logger's name {AppLog, SysLog, ...}
public String[] getLoggingMechanismNames(String logName)
logName - a logger's name {AppLog, SysLog, ...}
public int getLoggingLevel(String logName)
logName - a logger's name {AppLog, SysLog, ...}
public boolean isLoggingPerformance(String logName)
logName - a logger's name {AppLog, SysLog, ...}
public boolean isLoggingStatistics(String logName)
logName - a logger's name {AppLog, SysLog, ...}
public boolean isLoggingNotification(String logName)
logName - a logger's name {AppLog, SysLog, ...}
public static boolean isDebuggingEnabled()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||