com.ibm.di.api.syslog
Class SystemLogAppender

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by org.apache.log4j.WriterAppender
          extended by org.apache.log4j.FileAppender
              extended by com.ibm.di.api.syslog.SystemLogAppender
All Implemented Interfaces:
org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

public class SystemLogAppender
extends org.apache.log4j.FileAppender
implements org.apache.log4j.spi.OptionHandler

This class extend the FileAppender class and defines API for writing logs to system files.


Field Summary
 
Fields inherited from class org.apache.log4j.FileAppender
bufferedIO, bufferSize, fileAppend, fileName
 
Fields inherited from class org.apache.log4j.WriterAppender
encoding, immediateFlush, qw
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Constructor Summary
SystemLogAppender()
          Default constructor
SystemLogAppender(java.lang.String aComponentType, java.lang.String aComponentName, java.lang.String aLogPattern, java.lang.String aConfigId)
          Class constructor
 
Method Summary
 void activateOptions()
          If the component and it`s name are assigned and the log patters is not null this method sets a layout , constructs and sets file name and opens the file where the log output will go.
 java.lang.String getComponentName()
          Retrieves component name.
 java.lang.String getComponentType()
          Returns the component type.
 java.lang.String getConfigId()
          Retrieves configuration ID.
 java.lang.String getFileName()
          Retrieves file name.
 java.lang.String getLogPattern()
          Retrieves log pattern.
 void setComponentName(java.lang.String aComponentName)
          Sets the name of the component.
 void setComponentType(java.lang.String aComponentType)
          Sets the component type
 void setConfigId(java.lang.String aConfigId)
          Sets the configuration id.
 void setConfigInstance(java.lang.Object configInstance)
          Sets the configuration id using a configInstance.
 void setLogPattern(java.lang.String aLogPattern)
          Sets the log pattern.
 void setMaxGenerations(java.lang.String number)
          Sets max generations of log files
 
Methods inherited from class org.apache.log4j.FileAppender
closeFile, getAppend, getBufferedIO, getBufferSize, getFile, reset, setAppend, setBufferedIO, setBufferSize, setFile, setFile, setQWForFiles
 
Methods inherited from class org.apache.log4j.WriterAppender
append, checkEntryConditions, close, closeWriter, createWriter, getEncoding, getImmediateFlush, requiresLayout, setEncoding, setErrorHandler, setImmediateFlush, setWriter, shouldFlush, subAppend, writeFooter, writeHeader
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemLogAppender

public SystemLogAppender()
                  throws java.lang.Exception
Default constructor

Throws:
Exception: - never
java.lang.Exception

SystemLogAppender

public SystemLogAppender(java.lang.String aComponentType,
                         java.lang.String aComponentName,
                         java.lang.String aLogPattern,
                         java.lang.String aConfigId)
                  throws java.lang.Exception
Class constructor

Parameters:
aComponentType - AssemblyLine
aComponentName - String
aLogPattern - String
aConfigId - String
Throws:
java.lang.Exception - if an error occurs.
Method Detail

setComponentType

public void setComponentType(java.lang.String aComponentType)
                      throws java.lang.Exception
Sets the component type

Parameters:
aComponentType - String, AssemblyLine
Throws:
java.lang.Exception - if argument is not a valid component type

getComponentType

public java.lang.String getComponentType()
                                  throws java.lang.Exception
Returns the component type.

Returns:
String
Throws:
java.lang.Exception - if a component type has not been assigned.

setComponentName

public void setComponentName(java.lang.String aComponentName)
                      throws java.lang.Exception
Sets the name of the component.

Parameters:
aComponentName - String , AssemblyLine
Throws:
java.lang.Exception - : never.

getComponentName

public java.lang.String getComponentName()
                                  throws java.lang.Exception
Retrieves component name.

Returns:
String. The component name.
Throws:
java.lang.Exception - : never.

setConfigId

public void setConfigId(java.lang.String aConfigId)
                 throws java.lang.Exception
Sets the configuration id.

Parameters:
aConfigId - String
Throws:
java.lang.Exception - : never.

setConfigInstance

public void setConfigInstance(java.lang.Object configInstance)
                       throws java.lang.Exception
Sets the configuration id using a configInstance.

Parameters:
configInstance - object implementing RSInterface.
Throws:
java.lang.Exception - if configuration cannot be set.

getConfigId

public java.lang.String getConfigId()
                             throws java.lang.Exception
Retrieves configuration ID.

Returns:
the configuration id.
Throws:
java.lang.Exception - : never

setLogPattern

public void setLogPattern(java.lang.String aLogPattern)
                   throws java.lang.Exception
Sets the log pattern.

Parameters:
aLogPattern - String
Throws:
java.lang.Exception - : never.

getLogPattern

public java.lang.String getLogPattern()
                               throws java.lang.Exception
Retrieves log pattern.

Returns:
String. The log pattern
Throws:
java.lang.Exception - : never.

getFileName

public java.lang.String getFileName()
Retrieves file name.

Returns:
String, the file name.

setMaxGenerations

public void setMaxGenerations(java.lang.String number)
Sets max generations of log files

Parameters:
number -

activateOptions

public void activateOptions()
If the component and it`s name are assigned and the log patters is not null this method sets a layout , constructs and sets file name and opens the file where the log output will go.

Specified by:
activateOptions in interface org.apache.log4j.spi.OptionHandler
Overrides:
activateOptions in class org.apache.log4j.FileAppender