com.adventnet.afp.log
Class  LogConfigFileWriter
java.lang.Object
  |
  +--com.adventnet.afp.log.LogConfigFileWriter
- All Implemented Interfaces: 
 - LogConfigWriter
 
- public class LogConfigFileWriter
- extends java.lang.Object
- implements LogConfigWriter
   
This class is used to write the details of the LogWriter or Logger to the XML file. 
 Seperate methods are provided for adding and removing a Logger or LogWriter. This file 
 just updates the current XML file instead of creating a new file.
 
| 
Method Summary | 
 void | 
addLogger(LoggerProperties loggerProps)
 
          This method is used to write the properties of a Logger 
 to the XML file. | 
 void | 
addLogWriter(LogWriterProperties logWriterProps)
 
          This method is used to write the Writer and its Properties 
 specified with in the  tag to the XML File. | 
 void | 
removeLogger(java.lang.String loggerInstance)
 
          This method is used to remove a Logger's entry from the 
 XML file. | 
 void | 
removeLogWriter(java.lang.String writerInstance)
 
          This method is used to remove a writer from the XML file. | 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
LogConfigFileWriter
public LogConfigFileWriter(java.lang.String configurationFileName)
addLogWriter
public void addLogWriter(LogWriterProperties logWriterProps)
                  throws LogException
- This method is used to write the Writer and its Properties 
 specified with in the  tag to the XML File. The loggers belonging to the Writer will not
 be writen to the XML file. To write the Loggers also, we have to call the writeLoggerInXMLFile 
 method for each Logger
- Specified by: 
 addLogWriter in interface LogConfigWriter
 
- Parameters:
 logWriterProps - specifies the properties of the LogWriter- Throws:
 LogException - if an error while adding the LogWriter
 
 
removeLogWriter
public void removeLogWriter(java.lang.String writerInstance)
                     throws LogException
- This method is used to remove a writer from the XML file.
 The XML file is parsed for the LogWriter with the instance name specified in writerInstance
 and removed from the XML file. If the writer is not present in the XML file, it just 
 parses the conf file and leaves it unchanged.
- Specified by: 
 removeLogWriter in interface LogConfigWriter
 
- Parameters:
 writerInstance - a String denoting the LogWriter to be removed- Throws:
 LogException - if an error while removing the LogWriter
 
 
addLogger
public void addLogger(LoggerProperties loggerProps)
               throws LogException
- This method is used to write the properties of a Logger 
 to the XML file. The Logger and its properties will be writen under the LogWriter denoted
 by the writeInstance value.
- Specified by: 
 addLogger in interface LogConfigWriter
 
- 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 is used to remove a Logger's entry from the 
 XML file. The XML file is parsed for the particular Logger denoted by loggerInstance and
 removed. If the Logger is absent, the method returns without modifying the XML file.
- Specified by: 
 removeLogger in interface LogConfigWriter
 
- Parameters:
 loggerInstance - a String value identifying the Logger- Throws:
 LogException - if an error occurs while removing the Logger.
 
 
Copyright (c)AdventNet Inc., 1996-2004