|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
LogConfigWriter is an interface provided by the logging framework which is used to write the configuration details of the LogWriter and Logger into any specified destination. The destination can be a file, database, memory etc. Separate methods have been provided for adding and removing a Logger or LogWriter at run time.
During development stages, you might be changing the configuration details
at run time and you might require the changes to get updated in the destination
where you are keeping your configuration details. Or, you might just wish
to store the configuration
details in a specific destination. In such cases, this interface would
prove to be highly useful and convenient.
Methods used in LogConfigWriter |
Following are the methods used in the LogConfigWriter :-
The method addLogWriter is very much similar to addLogger. This method adds a new LogWriter to the configuration details available in the specified destination. Here, again the properties of the new LogWriter to be added are passed as arguments. The properties include ClassName, InstanceName, and other key properties such as FileName, MaxLineCount, BufferSize, FlushMode, MaxFileCount, etc.
The methods removeLogger and removeLogWriter are for removing the already
existing Logger and LogWriter respectively. The Loggers and LogWriters
can be removed based on their unique InstanceNames.
Default Implementation |
We have provided an default implementation for LogConfigWriter named LogConfigFileWriter. This implementation can be used, if you wish to write the Configuration details into a file.
Method Summary | |
void |
addLogger(LoggerProperties loggerProps)
This method adds a new Logger into the destination specified( file, database etc). |
void |
addLogWriter(LogWriterProperties logWriterProps)
This method adds a new LogWriter into the destination specified( file, database etc). |
void |
removeLogger(java.lang.String loggerInstance)
This method removes the Logger from the logging configuration which has the LoggerInstanceName same as the argument passed. |
void |
removeLogWriter(java.lang.String writerInstance)
This method removes the LogWriter from the logging configuration which has the LogWriterInstanceName same as the argument passed. |
Method Detail |
public void addLogWriter(LogWriterProperties logWriterProps) throws LogException
logWriterProps
- specifies the properties of a particular LogWriter.LogException
- if an error occurs while adding the LogWriter.public void removeLogWriter(java.lang.String writerInstance) throws LogException
writerInstance
- a String
denoting the LogWriterInstanceName whose LogWriter has to be removedLogException
- if an error occurs while removing the LogWriter.public void addLogger(LoggerProperties loggerProps) throws LogException
loggerProps
- specifies the properties of the LoggerLogException
- if an error occurs while adding the Logger.public void removeLogger(java.lang.String loggerInstance) throws LogException
loggerInstance
- a String
denoting the LoggerInstanceName whose Loggerr has to be removedLogException
- if an error occurs while removing the Logger.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |