Package org.apache.log4j.chainsaw
Chainsaw is a GUI log viewer and filter for the log4j package. By default it listens for LoggingEvent objects sent using the SocketAppender and displays them in a table. The events can be filtered based on:
- Level
- Thread name
- Logger
- Message
- NDC
All the details for each event can be displayed by selecting the event in the table.
Chainsaw also supports loading a events logged to a file using the XMLLayout format. This is great for analysing log files, and means you do not need to keep Chainsaw running continously. It is easy to add support for loading events from other sources like JDBC.
A picture is worth a thousand words:
Finally, why is it called chainsaw? Because it cuts your log (file) down to size. :-)
Requirements
Chainsaw is based on the Swing API and requires JDK 1.4 or later.
Running chainsaw
Setup
You need to include the log4j.jar and xstream.jar in the classpath.
Usage
The command line usage is:
java -D<property>=<value> org.apache.log4j.chainsaw.LogUI
Configuring Log4J
You will need to configure log4j to send logging events to Chainsaw. There is an example Log4j xml configuration file included with Chainsaw, you can view it inside the Chainsaw GUI by clicking on the button in the welcome screen.
-
Interface Summary Interface Description ChainsawViewer Chainsaw compatible gui viewers must implement this interface in order to be opened and configured by the ChainsawAppender class.EventBatchListener Implementations of this interface like to be notified of arriving batches of LoggingEvents, but may only be interested in those coming from a particular sourceEventContainer To allow pluggable TableModel implementations for Chainsaw, this interface has been factored out.EventCountListener Listeners can be notified when the # of events in a particular model changesLoggerNameListener Implementations are notified when new Logger names are added to the related LoggerNameModel instance.LoggerNameModel Implementations of this model contain all the known Logger names within it's model space.NewKeyListener Interested parties are notified when a MDC/Property key has arrived that has not been seen before by the source ModelShutdownListener Chainsaw notifies these Listeners when the user has requested it to shutdown.SortTableModel An extended TableModel interface that allows Column sorting -
Class Summary Class Description AbstractPreferencePanel Some basic plumbing for Preference related dialogs.ApplicationPreferenceModel Encapsulates the Chainsaw Application wide propertiesApplicationPreferenceModelPanel A panel used by the user to modify any application-wide preferences.ApplicationPreferenceModelSaver Helper class that helps delegate the work of loading and saving the values of the ApplicationPreferenceModel, allowing that class to remain a simple bean.BasicPrefPanel All of the Preferences panels used in this class extend from this, it is used to provide standard L&F required by all.ChainsawAppender ChainsawAppender receives LoggingEvents from the local Log4J environment, and appends them into a model that can be used inside a Swing GUIChainsawAppenderHandler A handler class that either extends a particular appender hierarchy or can be bound into the Log4j appender framework, and queues events, to be later dispatched to registered/interested parties.ChainsawColumns ChainsawConstants Constants used throught Chainsaw.ChainsawStatusBar A general purpose status bar for all Frame windowsCheckListCellRenderer A ListCellRenderer that display a check box if the value has been "checked".ColumnComparator CopyEventsToClipboardAction CyclicBufferList CyclicBuffer implementation that is Object generic, and implements the List interface.DockablePanel Extends the functionality of a JPanel by providing a 'docked' state.ExpressionRuleContext A popup menu which assists in building expression rules.Generator Class designed to stress, and/or test the Chainsaw GUI by sending it lots of Logging Events.GeneratorBeanInfo A BeanInfo class to be used as meta-data about the Generator pluginJSortTable A Sortable JTable implementation that allows a user to click on a specific Column and have the row information sorted by that column.JTextComponentFormatter Apply system font and size (normal size + 1) rule if the JEditorPane document contains html.LogFilePatternLayoutBuilder LoggerNameModelSupport An implementation of LoggerNameModel which can be used as a delegateLoggerNameTree LoggerNameTree is used to display a TreeModel of LoggerNames.LoggingEventWrapper Wrap access to a LoggingEvent.LogPanel A LogPanel provides a view to a collection of LoggingEvents.
As events are received, the keywords in the 'tab identifier' application preference are replaced with the values from the received event.LogPanelPreferenceModel Used to encapsulate all the preferences for a given LogPanelLogPanelPreferencePanel GUI panel used to manipulate the PreferenceModel for a Log PanelLogUI The main entry point for Chainsaw, this class represents the first frame that is used to display a Welcome panel, and any other panels that are generated because Logging Events are streamed via a Receiver, or other mechanism.ModifiableListModel NewKeyEvent An event representing when a Key has arrived inside a Chainsaw model that has not been seen previously.PopupListener Ensures that a specific popupMenu is displayed when the relevant mouse events are trapped.ProgressPanel A simple ProgressPanel that can be used, a little more flexible than ProgressMonitor when you want it to be shown REGARDLESS of any timeouts etc.RuleMediator A mediator class that implements the Rule interface, by combining several optional rules used by Chainsaw's filtering GUI's into a single Rule.SavableTabSetting This class is used to in saving and loading the tab settings of Chainsaw....SmallButton A better button class that has nice roll over effects.SortArrowIcon An Icon that is a Nice arrow to be used for displaying which Column is being used for sorting.SortHeaderRenderer A Table Column header renederer that displays a nice Up/Down arrow depending on whether this column is the current sort column or not, and which way the sort is functioningTableColorizingRenderer A specific TableCellRenderer that colourizes a particular cell based on some ColourFilters that have been stored according to the value for the rowWelcomePanel An initial Welcome Panel that is used when Chainsaw starts up, can displays a HTML pages based on URLs.
