|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is an interface used for parsing the logging configuration details.
This can be used to read the configuration details from any destination.
This gets the configuration details of LogWriters and Loggers and stores
them as properties. For example, configuration details might be available
in a file in the form of XML or in database or in any other destination.
LogConfigReader can be used to read the details wherever they are available.
Methods used in LogConfigReader |
Following are the two methods used in the LogConfigReader.
The following code snippet shows how the method getLoggerProperties can be used to get the properties of logger available in a XML file. This is just an example. As mentioned above, you may give your own implementation to read the properties available in any destination.
getLoggerProperties()
{
int i = loggerVector.size();
LoggerProperties aloggerproperties[]
= new LoggerProperties[i];
for(int j = 0; j < i;
j++)
aloggerproperties[j] = (LoggerProperties)loggerVector.elementAt(j);
return aloggerproperties;
}
The method getLogWriterProperties is used to get the properties of LogWriter from the specified location. It returns an array of LogWriterProperties. Each element in the array will have the properties of LogWriter. All the properties of LogWriter namely LogWriterClassName , LogWriterInstanceName and the custom properties will be returned.
The following code snippet shows how the method getLogWriterProperties can be used to get the properties of a LogWriter present in a file.
public LogWriterProperties[] getLogWriterProperties()
{
int i = logWriterVector.size();
LogWriterProperties alogwriterproperties[]
= new LogWriterProperties[i];
for(int j = 0; j < i;
j++)
alogwriterproperties[j] = (LogWriterProperties)logWriterVector.elementAt(j);
return alogwriterproperties;
}
Default implementation |
We have provided a default implementation for LogConfigReader namely
LogFileConfigReader. This class is used to read the configuration details
from a XML file. In case, you wish to read the configuration details from
an XML file, you may conveniently use this class.
Method Summary | |
LoggerProperties[] |
getLoggerProperties()
|
LogWriterProperties[] |
getLogWriterProperties()
It returns an array of LogWriterProperties. |
Method Detail |
public LogWriterProperties[] getLogWriterProperties()
LogWriterProperties[]
containing properties of all LogWriter.public LoggerProperties[] getLoggerProperties()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |