com.adventnet.afp.log
Interface LogConfigWriter

All Known Implementing Classes:
LogConfigFileWriter

public interface LogConfigWriter

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 addLogger is used to add a new Logger to the already existing configuration details present in the specified destination. The properties of the new Logger to be added are given as arguments. The properties include ClassName, InstanceName, LogLevel, DisplayName, etc.

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

addLogWriter

public void addLogWriter(LogWriterProperties logWriterProps)
                  throws LogException
This method adds a new LogWriter into the destination specified( file, database etc). New LogWriter properties given as the argument. The properties includes LogWriterClassName, LogWriterInstanceName etc. This LogWriter Properties will be updated in the logging configuration.
Parameters:
logWriterProps - specifies the properties of a particular LogWriter.
Throws:
LogException - if an error occurs while adding the LogWriter.

removeLogWriter

public void removeLogWriter(java.lang.String writerInstance)
                     throws LogException
This method removes the LogWriter from the logging configuration which has the LogWriterInstanceName same as the argument passed.
Parameters:
writerInstance - a String denoting the LogWriterInstanceName whose LogWriter has to be removed
Throws:
LogException - if an error occurs while removing the LogWriter.

addLogger

public void addLogger(LoggerProperties loggerProps)
               throws LogException
This method adds a new Logger into the destination specified( file, database etc). New Logger properties given as the argument. The properties includes LoggerClassName, LoggerInstanceName etc. This LogWriter Properties will be updated in the logging configuration.
Parameters:
loggerProps - specifies the properties of the Logger
Throws:
LogException - if an error occurs while adding the Logger.

removeLogger

public void removeLogger(java.lang.String loggerInstance)
                  throws LogException
This method removes the Logger from the logging configuration which has the LoggerInstanceName same as the argument passed.
Parameters:
loggerInstance - a String denoting the LoggerInstanceName whose Loggerr has to be removed
Throws:
LogException - if an error occurs while removing the Logger.


Copyright (c)AdventNet Inc., 1996-2004