org.glite.rgma.log4j
Class Appender

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by org.glite.rgma.log4j.Appender
All Implemented Interfaces:
org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

public class Appender
extends org.apache.log4j.AppenderSkeleton

Class traps any log4j calls and then publishes them using an R-GMA 'In-Memory' Primary Producer.


Constructor Summary
Appender()
           
 
Method Summary
 void activateOptions()
          Method called by the log4j system once all the properties have been initialised from the config file.
 void append(org.apache.log4j.spi.LoggingEvent event)
          Log4j calls this method when a logging event is generated.
 void close()
          Called when the log4j system terminates - provides hook in-order to cleanup the rgma producer.
 java.lang.String getJobName()
          Returns the job name of the application.
 boolean requiresLayout()
          Indicates this appender should format any logging events.
 void setJobName(java.lang.String jobName)
          Sets the job name (initialised by the log4j system).
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Appender

public Appender()
Method Detail

append

public void append(org.apache.log4j.spi.LoggingEvent event)
Log4j calls this method when a logging event is generated.

Specified by:
append in class org.apache.log4j.AppenderSkeleton

requiresLayout

public boolean requiresLayout()
Indicates this appender should format any logging events. In this case the dafault log4j formatter will be used.


activateOptions

public void activateOptions()
Method called by the log4j system once all the properties have been initialised from the config file. The Producer is created here because the predicate depends upon the JobName thats parsed from the log4j properties file.

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

close

public void close()
Called when the log4j system terminates - provides hook in-order to cleanup the rgma producer.


setJobName

public void setJobName(java.lang.String jobName)
Sets the job name (initialised by the log4j system).


getJobName

public java.lang.String getJobName()
Returns the job name of the application.