Package org.apache.log4j.lf5.viewer
Class LogBrokerMonitor
- java.lang.Object
-
- org.apache.log4j.lf5.viewer.LogBrokerMonitor
-
public class LogBrokerMonitor extends Object
LogBrokerMonitor .- Author:
- Michael J. Sikorsky, Robert Shaw, Brad Marlborough, Richard Wan, Brent Sprecher, Richard Hurst
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LogBrokerMonitor(List logLevels)Construct a LogBrokerMonitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddDisplayedProperty(Object messageLine)voidaddMessage(LogRecord lr)Add a log record message to be displayed in the LogTable.protected voidaddTableModelProperties()protected voidcenterFrame(JFrame frame)protected intchangeFontSizeCombo(JComboBox box, int requestedSize)Changes the font selection in the combo box and returns the size actually selected.protected voidclearDetailTextArea()protected voidcloseAfterConfirm()protected JMenuItemcreateAllLogLevelsMenuItem()protected JMenuItemcreateAllLogTableColumnsMenuItem()protected JMenuItemcreateCloseMI()protected JMenuItemcreateConfigureMaxRecords()protected JMenucreateConfigureMenu()protected JMenuItemcreateConfigureReset()protected JMenuItemcreateConfigureSave()protected JTextAreacreateDetailTextArea()protected JMenuItemcreateEditFindMI()protected JMenuItemcreateEditFindNextMI()protected JMenucreateEditMenu()protected JMenuItemcreateEditRestoreAllNDCMI()protected JMenuItemcreateEditSortNDCMI()protected JMenuItemcreateExitMI()protected JMenucreateFileMenu()protected JMenucreateHelpMenu()protected JMenuItemcreateHelpProperties()protected JMenucreateLogLevelColorMenu()protected JComboBoxcreateLogLevelCombo()protected JMenucreateLogLevelMenu()protected LogRecordFiltercreateLogRecordFilter()protected JCheckBoxMenuItemcreateLogTableColumnMenuItem(LogTableColumn column)protected JMenuBarcreateMenuBar()protected JCheckBoxMenuItemcreateMenuItem(LogLevel level)protected voidcreateMRUFileListMI(JMenu menu)Creates a Most Recently Used file list to be displayed in the File menuprotected LogRecordFiltercreateNDCLogRecordFilter(String text)protected JMenuItemcreateNoLogLevelsMenuItem()protected JMenuItemcreateNoLogTableColumnsMenuItem()protected JMenuItemcreateOpenMI()Menu item added to allow log files to be opened with the LF5 GUI.protected JMenuItemcreateOpenURLMI()Menu item added to allow log files loaded from a URL to be opened by the LF5 GUI.protected JMenuItemcreateResetLogLevelColorMenuItem()protected JPanelcreateStatusArea()protected JMenuItemcreateSubMenuItem(LogLevel level)protected JToolBarcreateToolBar()protected JMenucreateViewMenu()voiddispose()Dispose of the frame for the LogBrokerMonitor.protected intfindRecord(int startRow, String searchText, List records)protected voidfindSearchText()JFramegetBaseFrame()booleangetCallSystemExitOnClose()Get the value of whether or not System.exit() will be called when the LogBrokerMonitor is closed.CategoryExplorerTreegetCategoryExplorerTree()DateFormatManagergetDateFormatManager()Get the DateFormatManager for formatting dates.protected intgetFirstSelectedRow()MapgetLogLevelMenuItems()protected IteratorgetLogLevels()protected JCheckBoxMenuItemgetLogTableColumnMenuItem(LogTableColumn column)MapgetLogTableColumnMenuItems()protected IteratorgetLogTableColumns()protected JCheckBoxMenuItemgetMenuItem(LogLevel level)StringgetNDCTextFilter()protected StringgetRecordsDisplayedMessage()protected StringgetStatusText(int displayedRows, int totalRows)JCheckBoxMenuItemgetTableColumnMenuItem(LogTableColumn column)voidhide()Hide the frame for the LogBrokerMonitor.protected voidinitComponents()protected booleanloadLogFile(File file)Loads and parses a log file.protected booleanloadLogFile(URL url)Loads a parses a log file running on a server.protected voidmakeLogTableListenToCategoryExplorer()protected booleanmatches(LogRecord record, String text)Check to see if the any records contain the search string.protected voidpause(int millis)protected voidrefresh(JTextArea textArea)When the fontsize of a JTextArea is changed, the word-wrapped lines may become garbled.protected voidrefreshDetailTextArea()protected voidrequestClose()protected voidrequestExit()protected voidrequestOpen()Uses a JFileChooser to select a file to opened with the LF5 GUI.protected voidrequestOpenMRU(ActionEvent e)Opens a file in the MRU list.protected voidrequestOpenURL()Uses a Dialog box to accept a URL to a file to be opened with the LF5 GUI.protected voidresetConfiguration()protected voidsaveConfiguration()protected voidselectAllLogLevels(boolean selected)protected voidselectAllLogTableColumns(boolean selected)protected voidselectRow(int foundRow)voidsetCallSystemExitOnClose(boolean callSystemExitOnClose)Set the value of whether or not System.exit() will be called when the LogBrokerMonitor is closed.voidsetDateFormatManager(DateFormatManager dfm)Set the date format manager for formatting dates.voidsetFontSize(int fontSize)protected voidsetFontSize(Component component, int fontSize)protected voidsetFontSizeSilently(int fontSize)Does not update gui or cause any events to be fired.voidsetFrameSize(int width, int height)protected voidsetLeastSevereDisplayedLogLevel(LogLevel level)voidsetMaxNumberOfLogRecords(int maxNumberOfLogRecords)protected voidsetMaxRecordConfiguration()voidsetNDCLogRecordFilter(String textFilter)protected voidsetNDCTextFilter(String text)protected voidsetSearchText(String text)voidsetTitle(String title)protected voidsetView(String viewString, LogTable table)voidshow()voidshow(int delay)Show the frame for the LogBrokerMonitor.protected voidshowLogLevelColorChangeDialog(JMenuItem result, LogLevel level)protected voidshowPropertiesDialog(String title)protected voidsortByNDC()protected voidtrackTableScrollPane()Deprecated.tracking is now done automatically.protected voidupdateFrameSize()protected voidupdateMRUList()Removes old file list and creates a new file list with the updated MRU list.protected voidupdateStatusLabel()protected ListupdateView()
-
-
-
Field Detail
-
DETAILED_VIEW
public static final String DETAILED_VIEW
- See Also:
- Constant Field Values
-
_logMonitorFrame
protected JFrame _logMonitorFrame
-
_logMonitorFrameWidth
protected int _logMonitorFrameWidth
-
_logMonitorFrameHeight
protected int _logMonitorFrameHeight
-
_table
protected LogTable _table
-
_categoryExplorerTree
protected CategoryExplorerTree _categoryExplorerTree
-
_searchText
protected String _searchText
-
_NDCTextFilter
protected String _NDCTextFilter
-
_leastSevereDisplayedLogLevel
protected LogLevel _leastSevereDisplayedLogLevel
-
_logTableScrollPane
protected JScrollPane _logTableScrollPane
-
_statusLabel
protected JLabel _statusLabel
-
_lock
protected Object _lock
-
_fontSizeCombo
protected JComboBox _fontSizeCombo
-
_fontSize
protected int _fontSize
-
_fontName
protected String _fontName
-
_currentView
protected String _currentView
-
_loadSystemFonts
protected boolean _loadSystemFonts
-
_trackTableScrollPane
protected boolean _trackTableScrollPane
-
_lastTableViewportSize
protected Dimension _lastTableViewportSize
-
_callSystemExitOnClose
protected boolean _callSystemExitOnClose
-
_displayedLogBrokerProperties
protected List _displayedLogBrokerProperties
-
_logLevelMenuItems
protected Map _logLevelMenuItems
-
_logTableColumnMenuItems
protected Map _logTableColumnMenuItems
-
_levels
protected List _levels
-
_columns
protected List _columns
-
_isDisposed
protected boolean _isDisposed
-
_configurationManager
protected ConfigurationManager _configurationManager
-
_mruFileManager
protected MRUFileManager _mruFileManager
-
_fileLocation
protected File _fileLocation
-
-
Constructor Detail
-
LogBrokerMonitor
public LogBrokerMonitor(List logLevels)
Construct a LogBrokerMonitor.
-
-
Method Detail
-
show
public void show(int delay)
Show the frame for the LogBrokerMonitor. Dispatched to the swing thread.
-
show
public void show()
-
dispose
public void dispose()
Dispose of the frame for the LogBrokerMonitor.
-
hide
public void hide()
Hide the frame for the LogBrokerMonitor.
-
getDateFormatManager
public DateFormatManager getDateFormatManager()
Get the DateFormatManager for formatting dates.
-
setDateFormatManager
public void setDateFormatManager(DateFormatManager dfm)
Set the date format manager for formatting dates.
-
getCallSystemExitOnClose
public boolean getCallSystemExitOnClose()
Get the value of whether or not System.exit() will be called when the LogBrokerMonitor is closed.
-
setCallSystemExitOnClose
public void setCallSystemExitOnClose(boolean callSystemExitOnClose)
Set the value of whether or not System.exit() will be called when the LogBrokerMonitor is closed.
-
addMessage
public void addMessage(LogRecord lr)
Add a log record message to be displayed in the LogTable. This method is thread-safe as it posts requests to the SwingThread rather than processing directly.
-
setMaxNumberOfLogRecords
public void setMaxNumberOfLogRecords(int maxNumberOfLogRecords)
-
getBaseFrame
public JFrame getBaseFrame()
-
setTitle
public void setTitle(String title)
-
setFrameSize
public void setFrameSize(int width, int height)
-
setFontSize
public void setFontSize(int fontSize)
-
addDisplayedProperty
public void addDisplayedProperty(Object messageLine)
-
getLogLevelMenuItems
public Map getLogLevelMenuItems()
-
getLogTableColumnMenuItems
public Map getLogTableColumnMenuItems()
-
getTableColumnMenuItem
public JCheckBoxMenuItem getTableColumnMenuItem(LogTableColumn column)
-
getCategoryExplorerTree
public CategoryExplorerTree getCategoryExplorerTree()
-
getNDCTextFilter
public String getNDCTextFilter()
-
setNDCLogRecordFilter
public void setNDCLogRecordFilter(String textFilter)
-
setSearchText
protected void setSearchText(String text)
-
setNDCTextFilter
protected void setNDCTextFilter(String text)
-
sortByNDC
protected void sortByNDC()
-
findSearchText
protected void findSearchText()
-
getFirstSelectedRow
protected int getFirstSelectedRow()
-
selectRow
protected void selectRow(int foundRow)
-
matches
protected boolean matches(LogRecord record, String text)
Check to see if the any records contain the search string. Searching now supports NDC messages and date.
-
refresh
protected void refresh(JTextArea textArea)
When the fontsize of a JTextArea is changed, the word-wrapped lines may become garbled. This method clears and resets the text of the text area.
-
refreshDetailTextArea
protected void refreshDetailTextArea()
-
clearDetailTextArea
protected void clearDetailTextArea()
-
changeFontSizeCombo
protected int changeFontSizeCombo(JComboBox box, int requestedSize)
Changes the font selection in the combo box and returns the size actually selected.- Returns:
- -1 if unable to select an appropriate font
-
setFontSizeSilently
protected void setFontSizeSilently(int fontSize)
Does not update gui or cause any events to be fired.
-
setFontSize
protected void setFontSize(Component component, int fontSize)
-
updateFrameSize
protected void updateFrameSize()
-
pause
protected void pause(int millis)
-
initComponents
protected void initComponents()
-
createLogRecordFilter
protected LogRecordFilter createLogRecordFilter()
-
createNDCLogRecordFilter
protected LogRecordFilter createNDCLogRecordFilter(String text)
-
updateStatusLabel
protected void updateStatusLabel()
-
getRecordsDisplayedMessage
protected String getRecordsDisplayedMessage()
-
addTableModelProperties
protected void addTableModelProperties()
-
getStatusText
protected String getStatusText(int displayedRows, int totalRows)
-
makeLogTableListenToCategoryExplorer
protected void makeLogTableListenToCategoryExplorer()
-
createStatusArea
protected JPanel createStatusArea()
-
createDetailTextArea
protected JTextArea createDetailTextArea()
-
createMenuBar
protected JMenuBar createMenuBar()
-
createLogLevelMenu
protected JMenu createLogLevelMenu()
-
createAllLogLevelsMenuItem
protected JMenuItem createAllLogLevelsMenuItem()
-
createNoLogLevelsMenuItem
protected JMenuItem createNoLogLevelsMenuItem()
-
createLogLevelColorMenu
protected JMenu createLogLevelColorMenu()
-
createResetLogLevelColorMenuItem
protected JMenuItem createResetLogLevelColorMenuItem()
-
selectAllLogLevels
protected void selectAllLogLevels(boolean selected)
-
getMenuItem
protected JCheckBoxMenuItem getMenuItem(LogLevel level)
-
showLogLevelColorChangeDialog
protected void showLogLevelColorChangeDialog(JMenuItem result, LogLevel level)
-
createMenuItem
protected JCheckBoxMenuItem createMenuItem(LogLevel level)
-
createViewMenu
protected JMenu createViewMenu()
-
getLogTableColumnMenuItem
protected JCheckBoxMenuItem getLogTableColumnMenuItem(LogTableColumn column)
-
createLogTableColumnMenuItem
protected JCheckBoxMenuItem createLogTableColumnMenuItem(LogTableColumn column)
-
updateView
protected List updateView()
-
createAllLogTableColumnsMenuItem
protected JMenuItem createAllLogTableColumnsMenuItem()
-
createNoLogTableColumnsMenuItem
protected JMenuItem createNoLogTableColumnsMenuItem()
-
selectAllLogTableColumns
protected void selectAllLogTableColumns(boolean selected)
-
createFileMenu
protected JMenu createFileMenu()
-
createOpenMI
protected JMenuItem createOpenMI()
Menu item added to allow log files to be opened with the LF5 GUI.
-
createOpenURLMI
protected JMenuItem createOpenURLMI()
Menu item added to allow log files loaded from a URL to be opened by the LF5 GUI.
-
createCloseMI
protected JMenuItem createCloseMI()
-
createMRUFileListMI
protected void createMRUFileListMI(JMenu menu)
Creates a Most Recently Used file list to be displayed in the File menu
-
createExitMI
protected JMenuItem createExitMI()
-
createConfigureMenu
protected JMenu createConfigureMenu()
-
createConfigureSave
protected JMenuItem createConfigureSave()
-
createConfigureReset
protected JMenuItem createConfigureReset()
-
createConfigureMaxRecords
protected JMenuItem createConfigureMaxRecords()
-
saveConfiguration
protected void saveConfiguration()
-
resetConfiguration
protected void resetConfiguration()
-
setMaxRecordConfiguration
protected void setMaxRecordConfiguration()
-
createHelpMenu
protected JMenu createHelpMenu()
-
createHelpProperties
protected JMenuItem createHelpProperties()
-
showPropertiesDialog
protected void showPropertiesDialog(String title)
-
createEditMenu
protected JMenu createEditMenu()
-
createEditFindNextMI
protected JMenuItem createEditFindNextMI()
-
createEditFindMI
protected JMenuItem createEditFindMI()
-
createEditSortNDCMI
protected JMenuItem createEditSortNDCMI()
-
createEditRestoreAllNDCMI
protected JMenuItem createEditRestoreAllNDCMI()
-
createToolBar
protected JToolBar createToolBar()
-
createLogLevelCombo
protected JComboBox createLogLevelCombo()
-
setLeastSevereDisplayedLogLevel
protected void setLeastSevereDisplayedLogLevel(LogLevel level)
-
trackTableScrollPane
protected void trackTableScrollPane()
Deprecated.tracking is now done automatically.Ensures that the Table's ScrollPane Viewport will "track" with updates to the Table. When the vertical scroll bar is at its bottom anchor and tracking is enabled then viewport will stay at the bottom most point of the component. The purpose of this feature is to allow a developer to watch the table as messages arrive and not have to scroll after each new message arrives. When the vertical scroll bar is at any other location, then no tracking will happen.
-
centerFrame
protected void centerFrame(JFrame frame)
-
requestOpen
protected void requestOpen()
Uses a JFileChooser to select a file to opened with the LF5 GUI.
-
requestOpenURL
protected void requestOpenURL()
Uses a Dialog box to accept a URL to a file to be opened with the LF5 GUI.
-
updateMRUList
protected void updateMRUList()
Removes old file list and creates a new file list with the updated MRU list.
-
requestClose
protected void requestClose()
-
requestOpenMRU
protected void requestOpenMRU(ActionEvent e)
Opens a file in the MRU list.
-
requestExit
protected void requestExit()
-
closeAfterConfirm
protected void closeAfterConfirm()
-
getLogLevels
protected Iterator getLogLevels()
-
getLogTableColumns
protected Iterator getLogTableColumns()
-
loadLogFile
protected boolean loadLogFile(File file)
Loads and parses a log file.
-
loadLogFile
protected boolean loadLogFile(URL url)
Loads a parses a log file running on a server.
-
-