org.helma.util
Class RhinoAppender

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by org.helma.util.RhinoAppender
All Implemented Interfaces:
org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

public class RhinoAppender
extends org.apache.log4j.AppenderSkeleton

A log4j appender that passes log events to a Rhino callback function named onLogEvent.

See Also:
RhinoEngine.addCallback(String, String, org.mozilla.javascript.Function), RhinoEngine.invokeCallback(String, Object, Object[])

Field Summary
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Constructor Summary
RhinoAppender()
           
 
Method Summary
protected  void append(org.apache.log4j.spi.LoggingEvent event)
          Tries to get the current RhinoEngine and invoke a callback named onLogEvent, passing the log message and the stack trace rendered as a string as optional second argument.
 void close()
          Close the appender.
 boolean requiresLayout()
          We need a layout, so this returns true.
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
activateOptions, addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RhinoAppender

public RhinoAppender()
Method Detail

append

protected void append(org.apache.log4j.spi.LoggingEvent event)
Tries to get the current RhinoEngine and invoke a callback named onLogEvent, passing the log message and the stack trace rendered as a string as optional second argument.

Specified by:
append in class org.apache.log4j.AppenderSkeleton
Parameters:
event - the log event

requiresLayout

public boolean requiresLayout()
We need a layout, so this returns true.

Returns:
true

close

public void close()
Close the appender.