Package org.apache.log4j.chainsaw
Class ChainsawAppender
- java.lang.Object
-
- org.apache.log4j.AppenderSkeleton
-
- org.apache.log4j.chainsaw.ChainsawAppender
-
- All Implemented Interfaces:
org.apache.log4j.Appender,org.apache.log4j.spi.OptionHandler
public class ChainsawAppender extends org.apache.log4j.AppenderSkeletonChainsawAppender receives LoggingEvents from the local Log4J environment, and appends them into a model that can be used inside a Swing GUI- Version:
- 1.0
- Author:
- Paul Smith
-
-
Constructor Summary
Constructors Constructor Description ChainsawAppender()Constructor, initialises the singleton instance of the appender
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateOptions()Instantiates and activates an instance of a ChainsawViewer to view the contents of this appender.protected voidappend(org.apache.log4j.spi.LoggingEvent aEvent)Appends the eventvoidclose()Close does nothingorg.apache.log4j.AppendergetAppender()StringgetApplication()Returns value of the Application option.StringgetViewerClass()Gets the viewer class to use to view the events.booleanrequiresLayout()This appender does not require layout and so return falsevoidsetAppender(org.apache.log4j.Appender appender)voidsetApplication(String lapp)The Application option takes a string value which should be the name of the application getting loggedvoidsetViewerClass(String classname)Sets the viewer class to use to view the events.
-
-
-
Method Detail
-
requiresLayout
public boolean requiresLayout()
This appender does not require layout and so return false- Returns:
- false and only false
-
getAppender
public org.apache.log4j.Appender getAppender()
-
setAppender
public void setAppender(org.apache.log4j.Appender appender)
-
append
protected void append(org.apache.log4j.spi.LoggingEvent aEvent)
Appends the event- Specified by:
appendin classorg.apache.log4j.AppenderSkeleton- Parameters:
aEvent- the LoggingEvent to append
-
activateOptions
public void activateOptions()
Instantiates and activates an instance of a ChainsawViewer to view the contents of this appender.- Specified by:
activateOptionsin interfaceorg.apache.log4j.spi.OptionHandler- Overrides:
activateOptionsin classorg.apache.log4j.AppenderSkeleton
-
close
public void close()
Close does nothing
-
setViewerClass
public void setViewerClass(String classname)
Sets the viewer class to use to view the events. The class must implement the ChainsawViewer interface.- Parameters:
classname- The class name of the viewer class.
-
getViewerClass
public String getViewerClass()
Gets the viewer class to use to view the events.- Returns:
- The class name of the viewer class.
-
setApplication
public void setApplication(String lapp)
The Application option takes a string value which should be the name of the application getting logged
-
getApplication
public String getApplication()
Returns value of the Application option.
-
-