├── .asf.yaml ├── .flattened-pom.xml ├── .github └── workflows │ └── chainsaw.yml ├── .gitignore ├── .mvn └── jvm.config ├── HOWTOBUILD.txt ├── LICENSE ├── NOTICE ├── README.md ├── RELEASING ├── TODO ├── build.properties.sample ├── doap_chainsaw.rdf ├── pom.xml ├── sign-artifacts.sh ├── spotbugs-exclude.xml └── src ├── assembly ├── bin.xml └── standalone.xml ├── changes └── changes.xml ├── main ├── java │ └── org │ │ └── apache │ │ └── log4j │ │ ├── ULogger.java │ │ ├── chainsaw │ │ ├── AbstractPreferencePanel.java │ │ ├── ApplicationPreferenceModel.java │ │ ├── ApplicationPreferenceModelPanel.java │ │ ├── BasicPrefPanel.java │ │ ├── ChainsawAppender.java │ │ ├── ChainsawColumns.java │ │ ├── ChainsawConstants.java │ │ ├── ChainsawCyclicBufferTableModel.java │ │ ├── ChainsawEventBatchListener.java │ │ ├── ChainsawStarter.java │ │ ├── ChainsawStatusBar.java │ │ ├── ChainsawToolBarAndMenus.java │ │ ├── ChainsawViewer.java │ │ ├── CheckListCellRenderer.java │ │ ├── ColumnComparator.java │ │ ├── CopyEventsToClipboardAction.java │ │ ├── CyclicBufferList.java │ │ ├── DockablePanel.java │ │ ├── EventContainer.java │ │ ├── EventCountListener.java │ │ ├── ExpressionRuleContext.java │ │ ├── JTextComponentFormatter.java │ │ ├── LogFilePatternLayoutBuilder.java │ │ ├── LoggingEventWrapper.java │ │ ├── ModifiableListModel.java │ │ ├── NewKeyEvent.java │ │ ├── NewKeyListener.java │ │ ├── PopupListener.java │ │ ├── ProgressPanel.java │ │ ├── ReceiverConfigurationPanel.java │ │ ├── ReceiverEventListener.java │ │ ├── RuleMediator.java │ │ ├── ShutdownListener.java │ │ ├── ShutdownManager.java │ │ ├── SortTableModel.java │ │ ├── TableColorizingRenderer.java │ │ ├── color │ │ │ ├── ColorPanel.java │ │ │ ├── Colorizer.java │ │ │ └── RuleColorizer.java │ │ ├── components │ │ │ ├── about │ │ │ │ └── ChainsawAbout.java │ │ │ ├── elements │ │ │ │ ├── SmallButton.java │ │ │ │ ├── SmallToggleButton.java │ │ │ │ ├── TabIconHandler.java │ │ │ │ └── sorttable │ │ │ │ │ ├── JSortTable.java │ │ │ │ │ ├── SortArrowIcon.java │ │ │ │ │ └── SortHeaderRenderer.java │ │ │ ├── loggernamepanel │ │ │ │ ├── LoggerNameListener.java │ │ │ │ ├── LoggerNameModel.java │ │ │ │ ├── LoggerNameModelSupport.java │ │ │ │ └── LoggerNameTreePanel.java │ │ │ ├── logpanel │ │ │ │ ├── AutoFilterComboBox.java │ │ │ │ ├── ColumnNameKeywordMapper.java │ │ │ │ ├── ElementFactory.java │ │ │ │ ├── LogPanel.java │ │ │ │ ├── LogPanelLoggerTreeModel.java │ │ │ │ ├── LogPanelPreferenceModel.java │ │ │ │ └── LogPanelPreferencePanel.java │ │ │ ├── splash │ │ │ │ ├── ChainsawSplash.java │ │ │ │ └── SplashViewer.java │ │ │ ├── tabbedpane │ │ │ │ ├── ChainsawTabbedPane.java │ │ │ │ └── SavableTabSetting.java │ │ │ ├── tutorial │ │ │ │ ├── Generator.java │ │ │ │ ├── GeneratorBeanInfo.java │ │ │ │ ├── RandomWordGenerator.java │ │ │ │ └── TutorialFrame.java │ │ │ └── welcome │ │ │ │ └── WelcomePanel.java │ │ ├── dnd │ │ │ └── FileDnDTarget.java │ │ ├── doc-files │ │ │ └── Chainsawv2.gif │ │ ├── file │ │ │ ├── FileMenu.java │ │ │ └── FileSaveAction.java │ │ ├── filter │ │ │ ├── EventTypeEntryContainer.java │ │ │ └── FilterModel.java │ │ ├── help │ │ │ ├── HelpLocator.java │ │ │ └── HelpManager.java │ │ ├── helper │ │ │ ├── OkCancelPanel.java │ │ │ ├── SwingHelper.java │ │ │ └── TableCellEditorFactory.java │ │ ├── icons │ │ │ ├── ChainsawIcons.java │ │ │ ├── LevelIconFactory.java │ │ │ └── LineIconFactory.java │ │ ├── layout │ │ │ ├── DefaultLayoutFactory.java │ │ │ ├── EventDetailLayout.java │ │ │ └── LayoutEditorPane.java │ │ ├── logevents │ │ │ ├── ChainsawLoggingEvent.java │ │ │ ├── ChainsawLoggingEventBuilder.java │ │ │ ├── Level.java │ │ │ └── LocationInfo.java │ │ ├── logui │ │ │ ├── LogUI.java │ │ │ ├── LogUIPanelBuilder.java │ │ │ ├── LogUiKeyStrokeCreator.java │ │ │ └── LogUiReceiversPanel.java │ │ ├── osx │ │ │ └── OSXIntegration.java │ │ ├── prefs │ │ │ ├── AbstractSettingsEvent.java │ │ │ ├── LoadSettingsEvent.java │ │ │ ├── MRUFileList.java │ │ │ ├── ProfileManager.java │ │ │ ├── Profileable.java │ │ │ ├── SaveSettingsEvent.java │ │ │ ├── SettingsEvent.java │ │ │ ├── SettingsListener.java │ │ │ └── SettingsManager.java │ │ ├── receiver │ │ │ ├── ChainsawReceiver.java │ │ │ ├── ChainsawReceiverFactory.java │ │ │ └── ChainsawReceiverSkeleton.java │ │ ├── receivers │ │ │ ├── NewReceiverDialogPanel.java │ │ │ ├── PluginPropertyEditorPanel.java │ │ │ ├── ReceiverTreeCellRenderer.java │ │ │ ├── ReceiversPanel.java │ │ │ ├── ReceiversTreeModel.java │ │ │ └── VisualReceiver.java │ │ ├── vfs │ │ │ ├── VFSLogFilePatternReceiver.java │ │ │ ├── VFSLogFilePatternReceiverBeanInfo.java │ │ │ └── VFSLogFilePatternReceiverFactory.java │ │ └── zeroconf │ │ │ ├── ZeroConfDeviceModel.java │ │ │ ├── ZeroConfPlugin.java │ │ │ └── ZeroConfPreferenceModel.java │ │ ├── helpers │ │ ├── Constants.java │ │ └── MessageFormatter.java │ │ ├── net │ │ ├── AddressBased.java │ │ ├── ECSLogEvent.java │ │ ├── JsonReceiver.java │ │ ├── JsonReceiverFactory.java │ │ ├── MulticastReceiver.java │ │ ├── MulticastReceiverBeanInfo.java │ │ ├── MulticastReceiverFactory.java │ │ ├── NetworkBased.java │ │ ├── PortBased.java │ │ ├── SocketNodeEventListener.java │ │ ├── UDPReceiver.java │ │ ├── UDPReceiverFactory.java │ │ ├── XMLReceiverFactory.java │ │ └── XMLSocketReceiver.java │ │ ├── rule │ │ ├── AbstractRule.java │ │ ├── AndRule.java │ │ ├── ColorRule.java │ │ ├── EqualsRule.java │ │ ├── ExistsRule.java │ │ ├── ExpressionRule.java │ │ ├── InFixToPostFix.java │ │ ├── InequalityRule.java │ │ ├── LevelEqualsRule.java │ │ ├── LevelInequalityRule.java │ │ ├── LikeRule.java │ │ ├── NotEqualsRule.java │ │ ├── NotLevelEqualsRule.java │ │ ├── NotRule.java │ │ ├── OrRule.java │ │ ├── PartialTextMatchRule.java │ │ ├── Rule.java │ │ ├── RuleFactory.java │ │ ├── TimestampEqualsRule.java │ │ └── TimestampInequalityRule.java │ │ ├── scheduler │ │ ├── Job.java │ │ └── Scheduler.java │ │ ├── spi │ │ ├── Decoder.java │ │ ├── ErrorItem.java │ │ ├── LoggingEventFieldResolver.java │ │ ├── NOPULogger.java │ │ └── SimpleULogger.java │ │ ├── varia │ │ ├── LogFilePatternReceiver.java │ │ ├── LogFilePatternReceiverBeanInfo.java │ │ └── LogFilePatternReceiverFactory.java │ │ └── xml │ │ ├── Log4jEntityResolver.java │ │ ├── LogFileXMLReceiver.java │ │ ├── UtilLoggingEntityResolver.java │ │ ├── UtilLoggingXMLDecoder.java │ │ └── XMLDecoder.java └── resources │ ├── META-INF │ ├── LICENSE │ ├── NOTICE │ └── services │ │ └── org.apache.log4j.chainsaw.receiver.ChainsawReceiverFactory │ ├── log4j2.xml │ ├── logo.icns │ ├── org │ └── apache │ │ └── log4j │ │ ├── chainsaw │ │ ├── ChainsawAbout.html │ │ ├── Details_UDPReceiver.html │ │ ├── Details_XMLSocketReceiver.html │ │ ├── WelcomePanel.html │ │ ├── favourites │ │ │ └── package.html │ │ ├── help │ │ │ ├── release-notes.html │ │ │ └── tutorial.html │ │ ├── icons │ │ │ ├── About16.gif │ │ │ ├── About24.gif │ │ │ ├── Back16.gif │ │ │ ├── Back24.gif │ │ │ ├── Bean16.gif │ │ │ ├── Bean24.gif │ │ │ ├── Copy16.gif │ │ │ ├── Copy24.gif │ │ │ ├── Cut16.gif │ │ │ ├── Cut24.gif │ │ │ ├── Delete16.gif │ │ │ ├── Delete24.gif │ │ │ ├── Down16.gif │ │ │ ├── Edit16.gif │ │ │ ├── Edit24.gif │ │ │ ├── Export16.gif │ │ │ ├── Export24.gif │ │ │ ├── Find16.gif │ │ │ ├── Find24.gif │ │ │ ├── Forward16.gif │ │ │ ├── Forward24.gif │ │ │ ├── Help16.gif │ │ │ ├── Help24.gif │ │ │ ├── Home16.gif │ │ │ ├── Home24.gif │ │ │ ├── Host16.gif │ │ │ ├── Host24.gif │ │ │ ├── Import16.gif │ │ │ ├── Import24.gif │ │ │ ├── Information16.gif │ │ │ ├── Information24.gif │ │ │ ├── LICENSE │ │ │ ├── New16.gif │ │ │ ├── New24.gif │ │ │ ├── Open16.gif │ │ │ ├── Open24.gif │ │ │ ├── Pause16.gif │ │ │ ├── Pause24.gif │ │ │ ├── Play16.gif │ │ │ ├── Play24.gif │ │ │ ├── Preferences16.gif │ │ │ ├── Preferences24.gif │ │ │ ├── Redo16.gif │ │ │ ├── Redo24.gif │ │ │ ├── Refresh16.gif │ │ │ ├── Refresh24.gif │ │ │ ├── RowInsertAfter16.gif │ │ │ ├── RowInsertAfter24.gif │ │ │ ├── SaveAs16.gif │ │ │ ├── SaveAs24.gif │ │ │ ├── Server16.gif │ │ │ ├── Server24.gif │ │ │ ├── Stop16.gif │ │ │ ├── Stop24.gif │ │ │ ├── TipOfTheDay16.gif │ │ │ ├── TipOfTheDay24.gif │ │ │ ├── Up16.gif │ │ │ ├── Zoom16.gif │ │ │ ├── Zoom24.gif │ │ │ ├── ZoomIn16.gif │ │ │ ├── ZoomIn24.gif │ │ │ ├── ZoomOut16.gif │ │ │ ├── ZoomOut24.gif │ │ │ └── channelexplorer_satellite.gif │ │ ├── layout │ │ │ ├── DefaultDetailLayout.html │ │ │ └── FullDetailLayout.html │ │ ├── log4j-receiver-sample.xml │ │ ├── logo.png │ │ ├── package.html │ │ ├── prefs │ │ │ ├── default.properties │ │ │ └── logpanel.properties │ │ ├── receivers │ │ │ └── known.receivers │ │ ├── stylesheet.css │ │ └── zeroconf │ │ │ └── ZeroConfPlugin.html │ │ └── xml │ │ └── log4j.dtd │ └── pages │ ├── about.html │ ├── img │ └── logo.png │ └── stylesheet.css ├── site ├── apt │ ├── colorizing-output.apt │ ├── configuration-library.apt │ ├── distributionnotes.apt │ ├── expression-rules.apt │ ├── index.apt │ ├── quicktour.apt │ ├── roadmap.apt │ ├── viewing-log-events.apt │ └── zeroconf.apt ├── asciidoc │ └── download.adoc ├── resources │ ├── css │ │ ├── maven-base.css │ │ └── site.css │ └── images │ │ ├── chainsaw-1.jpg │ │ ├── chainsaw-configure-json.png │ │ ├── chainsaw-log-panel.png │ │ ├── chainsaw-new-receiver.png │ │ ├── chainsaw-overview.png │ │ ├── chainsaw-with-events.png │ │ ├── chainsaw-with-receiver.png │ │ ├── chainsaw-with-receivers.png │ │ ├── color-menu-bar.png │ │ ├── color-menu-click.png │ │ ├── color-selection-menu.png │ │ ├── details-pane.png │ │ ├── log-pane.png │ │ ├── logger-pane.png │ │ ├── logo.png │ │ └── ls-logo.jpg ├── site.vm └── site.xml └── test ├── java └── org │ └── apache │ └── log4j │ └── xml │ └── XMLDecoderTest.java └── resources └── org └── apache └── log4j ├── db ├── append-with-drivermanager1.xml └── read-with-drivermanager1.xml ├── rewrite ├── map.log ├── map.xml ├── property.log ├── property.xml ├── reflection.log └── reflection.xml └── xml ├── xmlLayout.1.xml └── xsltLayout.1.xml /.asf.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to you under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | notifications: 19 | jira_options: link label 20 | 21 | github: 22 | description: "Apache Chainsaw is a GUI log viewer" 23 | homepage: http://logging.apache.org/chainsaw 24 | labels: 25 | - apache 26 | - logging 27 | - java 28 | features: 29 | issues: true 30 | -------------------------------------------------------------------------------- /.github/workflows/chainsaw.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to you under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | name: chainsaw 18 | 19 | on: [push, pull_request] 20 | 21 | jobs: 22 | build: 23 | 24 | runs-on: ${{ matrix.os }} 25 | 26 | strategy: 27 | matrix: 28 | os: [ macos-latest ] 29 | 30 | steps: 31 | 32 | - name: Checkout repository 33 | uses: actions/checkout@v2 34 | 35 | # JDK 11 is needed for the build. 36 | # Search `maven-toolchains-plugin` usages for details. 37 | - name: Setup JDK 11 38 | uses: actions/setup-java@v2.4.0 39 | with: 40 | distribution: temurin 41 | java-version: 17 42 | java-package: jdk 43 | architecture: x64 44 | cache: maven 45 | 46 | - name: Inspect environment (Linux) 47 | if: runner.os == 'Linux' 48 | run: env | grep '^JAVA' 49 | 50 | - name: Inspect environment (Windows) 51 | if: runner.os == 'Windows' 52 | run: set java 53 | 54 | - name: Inspect environment (MacOS) 55 | if: runner.os == 'macOS' 56 | run: env | grep '^JAVA' 57 | 58 | - name: Maven "build" 59 | timeout-minutes: 60 60 | shell: bash 61 | run: | 62 | mvn site:site 63 | mvn install 64 | 65 | # - name: archive dmg 66 | # timeout-minutes: 60 67 | # shell: bash 68 | # run: find target -name \*.dmg 69 | # 70 | # - uses: actions/upload-artifact@v3 71 | # with: 72 | # name: chainsaw.dmg 73 | # path: target/*.dmg 74 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .classpath 3 | .project 4 | .idea/ 5 | *.iml 6 | .DS_Store 7 | *.swp 8 | /.settings/ 9 | -------------------------------------------------------------------------------- /.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED 2 | --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED 3 | --add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED 4 | --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED 5 | --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED 6 | --add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED 7 | --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED 8 | --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED 9 | --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED 10 | --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED 11 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache Chainsaw 2 | Copyright 2007-2023 The Apache Software Foundation 3 | 4 | This product includes software developed by 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Apache Chainsaw 19 | 20 | Apache Chainsaw is a GUI log file viewer 21 | 22 | More information can be found on the Chainsaw website: http://logging.apache.org/chainsaw/2.x/ 23 | 24 | ## Starting 25 | 26 | Please start the ChainsawStarter class, which has a main method. 27 | 28 | ## Issue tracking 29 | 30 | We have been using Jira in the past: 31 | https://issues.apache.org/jira/browse/CHAINSAW 32 | 33 | The current issue tracker is hosted by GitHub: 34 | https://github.com/apache/logging-chainsaw/issues 35 | -------------------------------------------------------------------------------- /RELEASING: -------------------------------------------------------------------------------- 1 | 17 | 18 | https://cwiki.apache.org/confluence/display/LOGGING/Chainsaw+Release+Guide 19 | -------------------------------------------------------------------------------- /build.properties.sample: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Chainsaw requires the following jars to build and run: 17 | # * Jakarta Commons VFS 1.0 RC1+ (requires sub-dependecy of Jakarta Commons Logging). 18 | # * XStream - http://xstream.codehaus.org (BSD License) 19 | # * Log4j 1.3 jars 20 | # 21 | # Place the Jars in a local 'lib' folder, and Chainsaw should compile and run 22 | # 23 | # Jakarta Commons VFS Required if you wish to compile and include the 24 | # org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver virtual file system receiver 25 | # to access log files in Chainsaw, but is optional. 26 | # 27 | # See http://jakarta.apache.org/commons/sandbox/vfs/filesystems.html 28 | # for a full description of supported file systems (ssh, zip, etc). 29 | # 30 | # See http://jakarta.apache.org/commons/sandbox/vfs/download.html for 31 | # file system-specific jars required when running Chainsaw with a VFSLogFilePatternReceiver 32 | # 33 | # NOTE: VFS requires Commons logging JAR to run 34 | 35 | # Dependencies directory 36 | deps.dir=lib 37 | 38 | # The location of the log4j source code (unpacked), required if you want to build the HTML JavaDoc for the Receivers 39 | # into the Chainsaw GUI. This is a MUST for building the complete distribution 40 | log4j.src=../log4j/ 41 | -------------------------------------------------------------------------------- /doap_chainsaw.rdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 25 | 26 | 2007-02-09 27 | 28 | Apache Chainsaw 29 | 30 | 31 | Apache Chainsaw is a GUI log viewer. 32 | 33 | 34 | 35 | Java 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /sign-artifacts.sh: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | #!/bin/bash 17 | 18 | # script to generate .asc, .md5, and .sha512 files for built artifacts 19 | 20 | if [[ $# -ne 1 ]] 21 | then 22 | echo "Usage: $0 gpg-key-id" 23 | exit 1 24 | fi 25 | 26 | GPG_KEY="$1" 27 | 28 | cd target 29 | for f in apache-chainsaw-*-bin.* apache-chainsaw-*-standalone.* apache-chainsaw-*-src.* 30 | do 31 | gpg --default-key="$GPG_KEY" --sign --detach-sign --armor "$f" 32 | shasum -a 512 "$f" >"$f.sha512" 33 | done 34 | -------------------------------------------------------------------------------- /spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/assembly/bin.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 23 | bin 24 | 25 | zip 26 | tar.gz 27 | 28 | true 29 | 30 | 31 | 32 | 33 | 34 | 35 | LICENSE 36 | NOTICE 37 | build.xml 38 | pom.xml 39 | src/** 40 | 41 | 42 | 43 | target 44 | . 45 | 46 | apache-chainsaw-${project.version}.jar 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/assembly/standalone.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | standalone 20 | 21 | zip 22 | tar.gz 23 | 24 | true 25 | 26 | 27 | target/appassembler/bin 28 | bin 29 | unix 30 | 0755 31 | 0755 32 | 33 | 34 | target/appassembler/repo 35 | repo 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/BasicPrefPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import javax.swing.*; 20 | 21 | /** 22 | * All of the Preferences panels used in this class extend from 23 | * this, it is used to provide standard L&F required by all. 24 | * 25 | * @author Paul Smith 26 | */ 27 | public abstract class BasicPrefPanel extends JPanel { 28 | private String title; 29 | 30 | protected BasicPrefPanel(String title) { 31 | this.title = title; 32 | } 33 | 34 | /** 35 | * @return Returns the title. 36 | */ 37 | public final String getTitle() { 38 | return title; 39 | } 40 | 41 | /** 42 | * @param title The title to set. 43 | */ 44 | public final void setTitle(String title) { 45 | this.title = title; 46 | } 47 | 48 | public String toString() { 49 | return getTitle(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/ChainsawAppender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.time.Instant; 20 | import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEventBuilder; 21 | import org.apache.log4j.chainsaw.receiver.ChainsawReceiver; 22 | import org.apache.log4j.chainsaw.receiver.ChainsawReceiverSkeleton; 23 | import org.apache.logging.log4j.core.LogEvent; 24 | import org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender; 25 | import org.apache.logging.log4j.core.config.plugins.Plugin; 26 | import org.apache.logging.log4j.core.config.plugins.PluginAttribute; 27 | import org.apache.logging.log4j.core.config.plugins.PluginFactory; 28 | 29 | @Plugin(name = "ChainsawAppender", category = "Core", elementType = "appender", printObject = true) 30 | public final class ChainsawAppender extends AbstractOutputStreamAppender { 31 | 32 | private ChainsawAppenderReceiver receiver = new ChainsawAppenderReceiver(); 33 | 34 | private ChainsawAppender(String name) { 35 | super(name, null, null, true, true, null); 36 | } 37 | 38 | @PluginFactory 39 | public static ChainsawAppender createAppender(@PluginAttribute("name") String name) { 40 | System.out.println("create the chainsaw appender"); 41 | 42 | if (name == null) { 43 | LOGGER.error("No name provided for ChainsawAppender"); 44 | return null; 45 | } 46 | 47 | return new ChainsawAppender(name); 48 | } 49 | 50 | @Override 51 | public void append(final LogEvent event) { 52 | ChainsawLoggingEventBuilder builder = new ChainsawLoggingEventBuilder(); 53 | 54 | builder.setLevelFromString(event.getLevel().name()) 55 | .setLogger(event.getLoggerName()) 56 | .setMessage(event.getMessage().getFormattedMessage()) 57 | .setThreadName(event.getThreadName()) 58 | .setTimestamp(Instant.ofEpochMilli(event.getInstant().getEpochMillisecond())); 59 | 60 | receiver.append(builder.create()); 61 | } 62 | 63 | public ChainsawReceiver getReceiver() { 64 | return receiver; 65 | } 66 | 67 | class ChainsawAppenderReceiver extends ChainsawReceiverSkeleton { 68 | 69 | @Override 70 | public void start() {} 71 | 72 | @Override 73 | public void shutdown() {} 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/ChainsawColumns.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.awt.*; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | import javax.swing.*; 23 | import org.apache.log4j.chainsaw.icons.ChainsawIcons; 24 | 25 | /** 26 | * @author Paul Smith <psmith@apache.org> 27 | */ 28 | public class ChainsawColumns { 29 | private static final List columnNames = new ArrayList<>(); 30 | 31 | static { 32 | columnNames.add(ChainsawConstants.TIMESTAMP_COL_NAME); 33 | columnNames.add(ChainsawConstants.LOG4J_MARKER_COL_NAME); 34 | columnNames.add(ChainsawConstants.LEVEL_COL_NAME); 35 | columnNames.add(ChainsawConstants.LOGGER_COL_NAME); 36 | columnNames.add(ChainsawConstants.MESSAGE_COL_NAME); 37 | 38 | // NOTE: ID must ALWAYS be last field because the model adds this value itself as an identifier to the end of 39 | // the consructed vector 40 | columnNames.add(ChainsawConstants.ID_COL_NAME); 41 | } 42 | 43 | public static final int INDEX_TIMESTAMP_COL_NAME = 1; 44 | public static final int INDEX_LOG4J_MARKER_COL_NAME = 2; 45 | public static final int INDEX_LEVEL_COL_NAME = 3; 46 | public static final int INDEX_LOGGER_COL_NAME = 4; 47 | public static final int INDEX_MESSAGE_COL_NAME = 5; 48 | public static final int INDEX_ID_COL_NAME = 6; 49 | 50 | public static final Cursor CURSOR_FOCUS_ON; 51 | 52 | static { 53 | CURSOR_FOCUS_ON = Toolkit.getDefaultToolkit() 54 | .createCustomCursor(new ImageIcon(ChainsawIcons.WINDOW_ICON).getImage(), new Point(3, 3), "FocusOn"); 55 | } 56 | 57 | private ChainsawColumns() {} 58 | 59 | public static List getColumnsNames() { 60 | return columnNames; 61 | } 62 | 63 | /** 64 | * Given the index which matches one of the static constants in this class, returns the resolved 65 | * Column name as a string label. 66 | * 67 | * @param columnIndex (note this is a 1 based collection) 68 | * @return column name 69 | */ 70 | public static String getColumnName(int columnIndex) { 71 | return getColumnsNames().get(columnIndex - 1).toString(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/ChainsawEventBatchListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.util.List; 20 | import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEvent; 21 | 22 | /** 23 | * 24 | */ 25 | public interface ChainsawEventBatchListener { 26 | void receiveChainsawEventBatch(List events); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/ChainsawViewer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | /** 20 | * Chainsaw compatible gui viewers must implement this interface 21 | * in order to be opened and configured by the ChainsawAppender class. 22 | * 23 | * @author Mark Womack 24 | */ 25 | public interface ChainsawViewer { 26 | /** 27 | * Called when the viewer should activate. 28 | * 29 | * @param model The ChainsawAppender model instance the viewer should use. 30 | */ 31 | void activateViewer(ChainsawAppender model); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/CheckListCellRenderer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.awt.*; 20 | import javax.swing.*; 21 | import javax.swing.border.Border; 22 | import javax.swing.table.TableColumn; 23 | 24 | /** 25 | * A ListCellRenderer that display a check box if the value 26 | * has been "checked". 27 | *

28 | * Borrowed heavily from the excellent book "Swing, 2nd Edition" by 29 | * Matthew Robinson & Pavel Vorobiev. 30 | * 31 | * @author Paul Smith 32 | */ 33 | public abstract class CheckListCellRenderer extends JCheckBox implements ListCellRenderer { 34 | private final Border noFocusBorder = BorderFactory.createEmptyBorder(1, 1, 1, 1); 35 | 36 | /** 37 | * 38 | */ 39 | public CheckListCellRenderer() { 40 | super(); 41 | setOpaque(true); 42 | setBorder(noFocusBorder); 43 | } 44 | 45 | /* (non-Javadoc) 46 | * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int, boolean, boolean) 47 | */ 48 | public Component getListCellRendererComponent( 49 | JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 50 | setText(((TableColumn) value).getHeaderValue().toString()); 51 | setBackground(isSelected ? list.getSelectionBackground() : list.getBackground()); 52 | setForeground(isSelected ? list.getSelectionForeground() : list.getForeground()); 53 | setFont(list.getFont()); 54 | setBorder(cellHasFocus ? UIManager.getBorder("List.focusCellHighlightBorder") : noFocusBorder); 55 | 56 | setSelected(isSelected(value)); 57 | return this; 58 | } 59 | 60 | /** 61 | * @param value 62 | * @return selected flag 63 | */ 64 | protected abstract boolean isSelected(Object value); 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/CopyEventsToClipboardAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.awt.*; 20 | import java.awt.datatransfer.StringSelection; 21 | import java.awt.event.ActionEvent; 22 | import java.util.List; 23 | import javax.swing.*; 24 | import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEvent; 25 | import org.apache.log4j.chainsaw.logui.LogUI; 26 | 27 | public class CopyEventsToClipboardAction extends AbstractAction { 28 | 29 | private static final long serialVersionUID = 1L; 30 | private static final int EVENTSIZE_FUDGE_FACTOR = 128; // guestimate 128 chars per event 31 | private final LogUI logUi; 32 | 33 | /** 34 | * Layout pattern uses a simple but concise format that reads well and has a fixed size set of 35 | * useful columns before the message. Nice format for pasting into issue trackers. 36 | */ 37 | // private final Layout layout = new EnhancedPatternLayout( 38 | // "[%d{ISO8601} %-5p][%20.20c][%t] %m%n"); 39 | 40 | public CopyEventsToClipboardAction(LogUI parent) { 41 | super("Copy events to clipboard"); 42 | this.logUi = parent; 43 | 44 | putValue( 45 | Action.SHORT_DESCRIPTION, 46 | "Copies to the clipboard currently visible events to a human-readable, log-like format"); 47 | } 48 | 49 | public void actionPerformed(ActionEvent e) { 50 | List filteredEvents = logUi.getCurrentLogPanel().getFilteredEvents(); 51 | StringBuilder writer = new StringBuilder(filteredEvents.size() * EVENTSIZE_FUDGE_FACTOR); 52 | for (Object filteredEvent : filteredEvents) { 53 | ChainsawLoggingEvent event = ((LoggingEventWrapper) filteredEvent).getLoggingEvent(); 54 | writer.append(event.m_message); 55 | } 56 | 57 | StringSelection stringSelection = new StringSelection(writer.toString()); 58 | Toolkit.getDefaultToolkit().getSystemClipboard().setContents(stringSelection, stringSelection); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/DockablePanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.awt.*; 20 | import javax.swing.*; 21 | 22 | /** 23 | * Extends the functionality of a JPanel by providing a 'docked' state. 24 | * 25 | * @author Scott Deboy <sdeboy@apache.org> 26 | * @author Paul Smith <psmith@apache.org> 27 | */ 28 | public class DockablePanel extends JPanel { 29 | private boolean isDocked = true; 30 | 31 | public void setDocked(boolean docked) { 32 | boolean oldVal = isDocked; 33 | isDocked = docked; 34 | firePropertyChange("docked", oldVal, isDocked); 35 | } 36 | 37 | public boolean isDocked() { 38 | return isDocked; 39 | } 40 | 41 | public Dimension getPreferredSize() { 42 | return new Dimension(1024, 768); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/EventCountListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.util.EventListener; 20 | 21 | /** 22 | * Listeners can be notified when the # of events in a particular model 23 | * changes 24 | * 25 | * @author Scott Deboy <sdeboy@apache.org> 26 | */ 27 | public interface EventCountListener extends EventListener { 28 | void eventCountChanged(int currentCount, int totalCount); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/JTextComponentFormatter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.awt.*; 20 | import javax.swing.*; 21 | import javax.swing.text.Document; 22 | import javax.swing.text.JTextComponent; 23 | import javax.swing.text.html.HTMLDocument; 24 | 25 | /** 26 | * Apply system font and size (normal size + 1) rule if the JEditorPane document contains html. 27 | */ 28 | public class JTextComponentFormatter { 29 | public static void applySystemFontAndSize(JTextComponent textComponent) { 30 | Document document = textComponent.getDocument(); 31 | if (document instanceof HTMLDocument) { 32 | Font font = UIManager.getFont("Label.font"); 33 | String bodyRule = 34 | "body { font-family: " + font.getFamily() + "; font-size: " + (font.getSize() + 1) + "pt; }"; 35 | ((HTMLDocument) document).getStyleSheet().addRule(bodyRule); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/ModifiableListModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import javax.swing.*; 20 | 21 | /** 22 | * @author Paul Smith <psmith@apache.org> 23 | */ 24 | public class ModifiableListModel extends DefaultListModel { 25 | public void fireContentsChanged() { 26 | fireContentsChanged(this, 0, this.size()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/NewKeyEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.util.EventObject; 20 | 21 | /** 22 | * An event representing when a Key has arrived inside a Chainsaw model that has 23 | * not been seen previously. 24 | * 25 | * @author Paul Smith <psmith@apache.org> 26 | */ 27 | public class NewKeyEvent extends EventObject { 28 | private final int newModelIndex; 29 | private final Object key; 30 | private final Object value; 31 | 32 | public NewKeyEvent(Object source, int newModelIndex, Object key, Object value) { 33 | super(source); 34 | this.newModelIndex = newModelIndex; 35 | this.key = key; 36 | this.value = value; 37 | } 38 | 39 | public Object getKey() { 40 | return key; 41 | } 42 | 43 | public int getNewModelIndex() { 44 | return newModelIndex; 45 | } 46 | 47 | public Object getValue() { 48 | return value; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/NewKeyListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.util.EventListener; 20 | 21 | /** 22 | * Interested parties are notified when a MDC/Property key has arrived 23 | * that has not been seen before by the source Model 24 | * 25 | * @author Paul Smith 26 | */ 27 | public interface NewKeyListener extends EventListener { 28 | 29 | /** 30 | * @param e the new key event being added 31 | */ 32 | void newKeyAdded(NewKeyEvent e); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/PopupListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.awt.event.MouseAdapter; 20 | import java.awt.event.MouseEvent; 21 | import javax.swing.*; 22 | 23 | /** 24 | * Ensures that a specific popupMenu is displayed when the relevant 25 | * mouse events are trapped. 26 | * 27 | * @author Scott Deboy <sdeboy@apache.org> 28 | * @author Paul Smith <psmith@apache.org> 29 | */ 30 | public class PopupListener extends MouseAdapter { 31 | final JPopupMenu popupMenu; 32 | 33 | public PopupListener(JPopupMenu popupMenu) { 34 | this.popupMenu = popupMenu; 35 | } 36 | 37 | @Override 38 | public void mousePressed(MouseEvent e) { 39 | checkPopup(e); 40 | } 41 | 42 | @Override 43 | public void mouseReleased(MouseEvent e) { 44 | checkPopup(e); 45 | } 46 | 47 | @Override 48 | public void mouseClicked(MouseEvent e) { 49 | checkPopup(e); 50 | } 51 | 52 | private void checkPopup(MouseEvent e) { 53 | if (e.isPopupTrigger()) { 54 | popupMenu.show(e.getComponent(), e.getX(), e.getY()); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/ProgressPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.awt.*; 20 | import java.lang.reflect.InvocationTargetException; 21 | import javax.swing.*; 22 | 23 | /** 24 | * A simple ProgressPanel that can be used, a little more flexible 25 | * than ProgressMonitor when you want it to be shown REGARDLESS 26 | * of any timeouts etc. 27 | * 28 | * @author Paul Smith <psmith@apache.org> 29 | */ 30 | public class ProgressPanel extends JPanel { 31 | private final JLabel messageLabel = new JLabel(); 32 | private final JProgressBar progressBar; 33 | 34 | ProgressPanel(int min, int max, String msg) { 35 | this.progressBar = new JProgressBar(min, max); 36 | setBorder(BorderFactory.createLineBorder(Color.black, 1)); 37 | messageLabel.setHorizontalAlignment(SwingConstants.CENTER); 38 | messageLabel.setText(msg); 39 | setLayout(new BorderLayout()); 40 | 41 | add(progressBar, BorderLayout.CENTER); 42 | add(messageLabel, BorderLayout.SOUTH); 43 | } 44 | 45 | public void setMessage(final String string) { 46 | SwingUtilities.invokeLater(() -> messageLabel.setText(string)); 47 | } 48 | 49 | public void setProgress(final int progress) { 50 | try { 51 | Runnable runnable = () -> progressBar.setValue(progress); 52 | if (!SwingUtilities.isEventDispatchThread()) { 53 | SwingUtilities.invokeAndWait(runnable); 54 | } else { 55 | runnable.run(); 56 | } 57 | } catch (InterruptedException | InvocationTargetException e) { 58 | // TODO Auto-generated catch block 59 | e.printStackTrace(); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/ReceiverEventListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import org.apache.log4j.chainsaw.receiver.ChainsawReceiver; 20 | 21 | /** 22 | * A ReceiverEventListener is an interface that lets you listen to events, such 23 | * as receivers being added or removed. 24 | */ 25 | public interface ReceiverEventListener { 26 | 27 | public void receiverAdded(ChainsawReceiver rx); 28 | 29 | public void receiverRemoved(ChainsawReceiver rx); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/ShutdownListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import java.util.EventListener; 20 | import org.apache.log4j.chainsaw.logui.LogUI; 21 | 22 | /** 23 | * Chainsaw notifies these Listeners when the user has requested 24 | * it to shutdown. 25 | *

26 | * Listeners should use this opportunity to release any resources 27 | * and/or perform any clean up activity. 28 | *

29 | * Listeners should NOT perform the action of actual shutting down 30 | * however (i.e. do not call System.exit()). 31 | * 32 | * @author Paul Smith <psmith@apache.org> 33 | * @see LogUI#addShutdownListener(ShutdownListener) 34 | */ 35 | public interface ShutdownListener extends EventListener { 36 | 37 | void shuttingDown(); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/SortTableModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw; 18 | 19 | import javax.swing.table.TableModel; 20 | 21 | /** 22 | * An extended TableModel interface that allows Column sorting 23 | * 24 | * @author Claude Duguay 25 | */ 26 | public interface SortTableModel extends TableModel { 27 | void sortColumn(int col, boolean ascending); 28 | 29 | void sort(); 30 | 31 | boolean isSortable(int col); 32 | 33 | boolean isSortEnabled(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/color/Colorizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.color; 18 | 19 | import java.awt.Color; 20 | import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEvent; 21 | 22 | /** 23 | * Given a LoggingEvent, can determine an appropriate 24 | * Color to use based on whatever this implementation 25 | * has been coded. 26 | * 27 | * @author Paul Smith <psmith@apache.org> 28 | * @author Scott Deboy <sdeboy@apache.org> 29 | */ 30 | public interface Colorizer { 31 | /** 32 | * Given a LoggingEvent, returns a Color to use for background, 33 | * or null if this instance cannot determine one, or that 34 | * the standard color should be used. 35 | * 36 | * @param event the ChainsawLoggingEvent 37 | * @return background color or null 38 | */ 39 | Color getBackgroundColor(ChainsawLoggingEvent event); 40 | 41 | Color getForegroundColor(ChainsawLoggingEvent event); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/components/elements/sorttable/SortArrowIcon.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.components.elements.sorttable; 18 | 19 | import java.awt.*; 20 | import javax.swing.*; 21 | 22 | /** 23 | * An Icon that is a Nice arrow to be used for displaying which 24 | * Column is being used for sorting. 25 | * 26 | * @author Claude Duguay 27 | */ 28 | public class SortArrowIcon implements Icon { 29 | public static final int NONE = 0; 30 | public static final int DECENDING = 1; 31 | public static final int ASCENDING = 2; 32 | protected int direction; 33 | protected int width = 8; 34 | protected int height = 8; 35 | 36 | public SortArrowIcon(int direction) { 37 | this.direction = direction; 38 | } 39 | 40 | public int getIconWidth() { 41 | return width; 42 | } 43 | 44 | public int getIconHeight() { 45 | return height; 46 | } 47 | 48 | public void paintIcon(Component c, Graphics g, int x, int y) { 49 | Color bg = c.getBackground(); 50 | Color light = bg.brighter(); 51 | Color shade = bg.darker(); 52 | 53 | int w = width; 54 | int h = height; 55 | int m = w / 2; 56 | 57 | if (direction == ASCENDING) { 58 | g.setColor(shade); 59 | g.drawLine(x, y, x + w, y); 60 | g.drawLine(x, y, x + m, y + h); 61 | g.setColor(light); 62 | g.drawLine(x + w, y, x + m, y + h); 63 | } 64 | 65 | if (direction == DECENDING) { 66 | g.setColor(shade); 67 | g.drawLine(x + m, y, x, y + h); 68 | g.setColor(light); 69 | g.drawLine(x, y + h, x + w, y + h); 70 | g.drawLine(x + m, y, x + w, y + h); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/components/loggernamepanel/LoggerNameListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.components.loggernamepanel; 18 | 19 | import java.util.EventListener; 20 | 21 | /** 22 | * Implementations are notified when new Logger names 23 | * are added to the related LoggerNameModel instance. 24 | * 25 | * @author Paul Smith <psmith@apache.org> 26 | */ 27 | public interface LoggerNameListener extends EventListener { 28 | /** 29 | * Called by LoggerNameModel instances when a new unique 30 | * Logger name string has been introduced into the model 31 | * 32 | * @param loggerName the new, unique loggerName 33 | */ 34 | void loggerNameAdded(String loggerName); 35 | 36 | /** 37 | * Logger names were reset (used to clear the tree model) 38 | */ 39 | void reset(); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/components/loggernamepanel/LoggerNameModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.components.loggernamepanel; 18 | 19 | import java.util.Collection; 20 | 21 | /** 22 | * Implementations of this model contain all the known Logger 23 | * names within it's model space. 24 | * 25 | * @author Paul Smith psmith@apache.org 26 | */ 27 | public interface LoggerNameModel { 28 | 29 | /** 30 | * Returns an unmodifiable Collection of the uniquely 31 | * known LoggerNames within this model. 32 | * 33 | * @return unmodifiable Collection of Logger name Strings 34 | */ 35 | Collection getLoggerNames(); 36 | 37 | /** 38 | * Attempts to add the loggerName to the model, and returns 39 | * true if it does, i.e that the loggerName is new, otherwise 40 | * it is ignored. 41 | *

42 | * If the loggerName is new for this model, all the LoggerNameListeners 43 | * are notified using this thread. 44 | * 45 | * @param loggerName the logger name to add 46 | */ 47 | boolean addLoggerName(String loggerName); 48 | 49 | /** 50 | * The logger names have been cleared 51 | */ 52 | void reset(); 53 | 54 | void addLoggerNameListener(LoggerNameListener l); 55 | 56 | void removeLoggerNameListener(LoggerNameListener l); 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/components/logpanel/ElementFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.components.logpanel; 18 | 19 | import java.awt.event.InputEvent; 20 | import java.awt.event.KeyEvent; 21 | import javax.swing.*; 22 | import org.apache.log4j.chainsaw.components.elements.SmallButton; 23 | import org.apache.log4j.chainsaw.icons.ChainsawIcons; 24 | 25 | public class ElementFactory { 26 | public static SmallButton createFindNextButton(Runnable action) { 27 | SmallButton button = new SmallButton.Builder() 28 | .action(action) 29 | .name("Find next") 30 | .text("") 31 | .smallIconUrl(ChainsawIcons.DOWN) 32 | .shortDescription("Find the next occurrence of the rule from the current row") 33 | .keyStroke(KeyStroke.getKeyStroke("F3")) 34 | .build(); 35 | 36 | button.getActionMap().put(button.getActionName(), button.getAction()); 37 | button.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) 38 | .put(button.getActionAcceleratorKey(), button.getActionName()); 39 | return button; 40 | } 41 | 42 | public static SmallButton createFindPreviousButton(Runnable action) { 43 | SmallButton button = new SmallButton.Builder() 44 | .action(action) 45 | .name("Find previous") 46 | .text("") 47 | .smallIconUrl(ChainsawIcons.UP) 48 | .shortDescription("Find the previous occurrence of the rule from the current row") 49 | .keyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_F3, InputEvent.SHIFT_MASK)) 50 | .build(); 51 | 52 | button.getActionMap().put(button.getActionName(), button.getAction()); 53 | button.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) 54 | .put(button.getActionAcceleratorKey(), button.getActionName()); 55 | return button; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/components/splash/SplashViewer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.components.splash; 18 | 19 | import java.awt.*; 20 | import org.apache.log4j.chainsaw.helper.SwingHelper; 21 | 22 | public class SplashViewer { 23 | private ChainsawSplash splash; 24 | 25 | public void showSplash(Frame owner) { 26 | splash = new ChainsawSplash(owner); 27 | SwingHelper.centerOnScreen(splash); 28 | splash.setVisible(true); 29 | } 30 | 31 | public void removeSplash() { 32 | if (splash != null) { 33 | splash.setVisible(false); 34 | splash.dispose(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/components/tabbedpane/SavableTabSetting.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.components.tabbedpane; 18 | 19 | /** 20 | * This class is used to in saving and loading the tab settings 21 | * of Chainsaw.... 22 | */ 23 | public class SavableTabSetting { 24 | private boolean welcome = false; 25 | private boolean chainsawLog = false; 26 | private boolean zeroConf = false; 27 | // not used currently, but leaving it here to prevent xstream exception for older clients 28 | private boolean dragdrop = false; 29 | 30 | public void setWelcome(boolean welcome) { 31 | this.welcome = welcome; 32 | } 33 | 34 | public void setChainsawLog(boolean chainsawLog) { 35 | this.chainsawLog = chainsawLog; 36 | } 37 | 38 | public void setZeroconf(boolean zeroConf) { 39 | this.zeroConf = zeroConf; 40 | } 41 | 42 | public boolean isWelcome() { 43 | return welcome; 44 | } 45 | 46 | public boolean isChainsawLog() { 47 | return chainsawLog; 48 | } 49 | 50 | public boolean isZeroconf() { 51 | return zeroConf; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/components/tutorial/GeneratorBeanInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.components.tutorial; 18 | 19 | import java.beans.PropertyDescriptor; 20 | import java.beans.SimpleBeanInfo; 21 | 22 | /** 23 | * A BeanInfo class to be used as meta-data about the 24 | * Generator plugin 25 | * 26 | * @author Paul Smith <psmith@apache.org> 27 | */ 28 | public class GeneratorBeanInfo extends SimpleBeanInfo { 29 | /* (non-Javadoc) 30 | * @see java.beans.BeanInfo#getPropertyDescriptors() 31 | */ 32 | public PropertyDescriptor[] getPropertyDescriptors() { 33 | try { 34 | return new PropertyDescriptor[] { 35 | new PropertyDescriptor("name", Generator.class), 36 | }; 37 | } catch (Exception e) { 38 | } 39 | 40 | return null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/components/tutorial/RandomWordGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.components.tutorial; 18 | 19 | import java.security.SecureRandom; 20 | 21 | public class RandomWordGenerator { 22 | SecureRandom random = new SecureRandom(); 23 | private final String[] SYLLABLES = { 24 | "can", "cen", "cin", "con", "cun", 25 | "na", "ne", "ni", "no", "nu", 26 | "ta", "te", "ti", "to", "tu", 27 | "la", "le", "li", "lo", "lu", 28 | "ma", "me", "mi", "mo", "mu", 29 | "ra", "re", "ri", "ro", "ru", 30 | "da", "de", "di", "do", "du", 31 | "fa", "fe", "fi", "fo", "fu", 32 | "sa", "se", "fi", "so", "su" 33 | }; 34 | 35 | public String generateWord(int length) { 36 | StringBuilder word = new StringBuilder(length); 37 | for (int i = 0; i < length; i++) { 38 | word.append(SYLLABLES[random.nextInt(SYLLABLES.length)]); 39 | } 40 | return word.toString(); 41 | } 42 | 43 | public String generateSentence(int words) { 44 | StringBuilder sentence = new StringBuilder(words); 45 | for (int i = 0; i < words; i++) { 46 | int randomSyllables = random.nextInt(6) + 2; // 2-7 syllabiles 47 | sentence.append(generateWord(randomSyllables)).append(" "); 48 | } 49 | return sentence.toString().trim(); 50 | } 51 | 52 | public String generateSentence() { 53 | int words = random.nextInt(12) + 4; 54 | return generateSentence(words); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/doc-files/Chainsawv2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/java/org/apache/log4j/chainsaw/doc-files/Chainsawv2.gif -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/filter/FilterModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.filter; 18 | 19 | import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEvent; 20 | import org.apache.log4j.chainsaw.logevents.LocationInfo; 21 | 22 | /** 23 | * This class is used as a Model for Filtering, and retains the unique entries that 24 | * come through over a set of LoggingEvents 25 | * 26 | * @author Paul Smith <psmith@apache.org> 27 | * @author Scott Deboy <sdeboy@apache.org> 28 | */ 29 | public class FilterModel { 30 | private EventTypeEntryContainer eventContainer = new EventTypeEntryContainer(); 31 | 32 | public void processNewLoggingEvent(ChainsawLoggingEvent event) { 33 | 34 | eventContainer.addLevel(event.m_level); 35 | eventContainer.addLogger(event.m_logger); 36 | eventContainer.addThread(event.m_threadName); 37 | eventContainer.addNDC(event.m_ndc); 38 | eventContainer.addProperties(event.getProperties()); 39 | 40 | LocationInfo info = event.m_locationInfo; 41 | if (info != null) { 42 | eventContainer.addClass(info.className); 43 | eventContainer.addMethod(info.methodName); 44 | eventContainer.addFileName(info.fileName); 45 | } 46 | } 47 | 48 | public EventTypeEntryContainer getContainer() { 49 | return eventContainer; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/helper/OkCancelPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.helper; 18 | 19 | import java.awt.*; 20 | import javax.swing.*; 21 | 22 | public class OkCancelPanel extends JPanel { 23 | private final JButton cancelButton = new JButton(" Cancel "); 24 | private final JButton okButton = new JButton(" OK "); 25 | 26 | public OkCancelPanel() { 27 | setLayout(new GridBagLayout()); 28 | 29 | cancelButton.setDefaultCapable(true); 30 | 31 | GridBagConstraints c = new GridBagConstraints(); 32 | 33 | c.fill = GridBagConstraints.HORIZONTAL; 34 | c.weightx = 1.0; 35 | 36 | add(Box.createHorizontalGlue(), c); 37 | 38 | c.insets = new Insets(5, 5, 5, 5); 39 | c.weightx = 0.0; 40 | c.fill = GridBagConstraints.NONE; 41 | c.anchor = GridBagConstraints.SOUTHEAST; 42 | 43 | add(okButton, c); 44 | add(cancelButton, c); 45 | // add(Box.createHorizontalStrut(6)); 46 | } 47 | 48 | /** 49 | * @return Returns the cancelButton. 50 | */ 51 | public final JButton getCancelButton() { 52 | return cancelButton; 53 | } 54 | 55 | /** 56 | * @return Returns the okButton. 57 | */ 58 | public final JButton getOkButton() { 59 | return okButton; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/helper/TableCellEditorFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.helper; 18 | 19 | import javax.swing.*; 20 | import javax.swing.table.TableCellEditor; 21 | import org.apache.log4j.chainsaw.logevents.Level; 22 | 23 | /** 24 | * @author Paul Smith <psmith@apache.org> 25 | */ 26 | public class TableCellEditorFactory { 27 | 28 | /** 29 | * Creates a TableCellEditor to be used for editing boolean values 30 | * 31 | * @return TableCellEditor 32 | */ 33 | public static final TableCellEditor createBooleanTableCellEditor() { 34 | 35 | JComboBox comboBox = new JComboBox<>(new Boolean[] {Boolean.TRUE, Boolean.FALSE}); 36 | return new DefaultCellEditor(comboBox); 37 | } 38 | 39 | /** 40 | * 41 | */ 42 | private TableCellEditorFactory() {} 43 | 44 | /** 45 | * @return table cell editor 46 | */ 47 | public static Object createLevelTableCellEditor() { 48 | JComboBox comboBox = new JComboBox<>(new Level[] { 49 | Level.TRACE, Level.DEBUG, Level.INFO, Level.WARN, Level.ERROR, Level.FATAL, Level.OFF, Level.ALL 50 | }); 51 | return new DefaultCellEditor(comboBox); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/icons/LevelIconFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.icons; 18 | 19 | import java.awt.*; 20 | import java.net.URL; 21 | import java.util.HashMap; 22 | import java.util.Map; 23 | import javax.swing.*; 24 | import javax.swing.plaf.metal.MetalLookAndFeel; 25 | 26 | /** 27 | */ 28 | public class LevelIconFactory { 29 | private static final LevelIconFactory instance = new LevelIconFactory(); 30 | private final Map iconMap = new HashMap<>(); 31 | 32 | private LevelIconFactory() { 33 | // reuse ERROR icon for FATAL level 34 | String[] iconFileNames = new String[] {"Warn.gif", "Inform.gif", "Error.gif", "Error.gif"}; 35 | String[] iconLabels = new String[] {"WARN", "INFO", "ERROR", "FATAL"}; 36 | 37 | for (int i = 0; i < iconLabels.length; i++) { 38 | URL resourceURL = UIManager.getLookAndFeel().getClass().getResource("icons/" + iconFileNames[i]); 39 | if (resourceURL == null) { 40 | resourceURL = MetalLookAndFeel.class.getResource("icons/" + iconFileNames[i]); 41 | } 42 | if (resourceURL == null) { 43 | iconMap.put(iconLabels[i], ChainsawIcons.ICON_DEBUG); 44 | } else { 45 | 46 | final ImageIcon icon = new ImageIcon(resourceURL); 47 | double scalex = .5; 48 | double scaley = .5; 49 | final int newWidth = (int) (scalex * icon.getIconWidth()); 50 | final int newHeight = (int) (scaley * icon.getIconHeight()); 51 | Image iconImage = icon.getImage().getScaledInstance(newWidth, newHeight, Image.SCALE_SMOOTH); 52 | iconMap.put(iconLabels[i], new ImageIcon(iconImage)); 53 | } 54 | } 55 | // reuse DEBUG icon for TRACE level 56 | iconMap.put("TRACE", ChainsawIcons.ICON_DEBUG); 57 | iconMap.put("DEBUG", ChainsawIcons.ICON_DEBUG); 58 | } 59 | 60 | public static final LevelIconFactory getInstance() { 61 | return instance; 62 | } 63 | 64 | public Map getLevelToIconMap() { 65 | return iconMap; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/logevents/ChainsawLoggingEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.logevents; 18 | 19 | import java.time.Instant; 20 | import java.util.HashMap; 21 | import java.util.Map; 22 | import java.util.Set; 23 | 24 | /** 25 | * The ChainsawLoggingEvent is a Chainsaw-specific type of logging event. This 26 | * ensures that logging events that we get from other sources all conform to 27 | * the same type of event, not just the Log4j1 style of logging event. 28 | * 29 | * ChainsawLoggingEvents are immutable, so use the ChainsawLoggingEventBuilder 30 | * class to construct one. 31 | */ 32 | public class ChainsawLoggingEvent { 33 | 34 | public final Instant m_timestamp; 35 | public final Level m_level; 36 | public final String m_message; 37 | public final String m_threadName; 38 | public final String m_logger; 39 | public final LocationInfo m_locationInfo; 40 | public final String m_ndc; 41 | public final Map m_mdc; 42 | private Map m_properties; 43 | 44 | ChainsawLoggingEvent(ChainsawLoggingEventBuilder b) { 45 | m_timestamp = b.m_timestamp; 46 | m_level = b.m_level; 47 | m_message = b.m_message; 48 | m_threadName = b.m_threadName; 49 | m_logger = b.m_logger; 50 | m_locationInfo = b.m_locationInfo; 51 | m_ndc = b.m_ndc; 52 | m_mdc = b.m_mdc; 53 | m_properties = new HashMap<>(); 54 | } 55 | 56 | public void setProperty(String name, String value) { 57 | m_properties.put(name, value); 58 | } 59 | 60 | public String removeProperty(String name) { 61 | return m_properties.remove(name); 62 | } 63 | 64 | public String getProperty(String name) { 65 | return m_properties.get(name); 66 | } 67 | 68 | public Set getPropertyKeySet() { 69 | return m_properties.keySet(); 70 | } 71 | 72 | public Map getProperties() { 73 | return new HashMap<>(m_properties); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/logevents/Level.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.logevents; 18 | 19 | /** 20 | * 21 | */ 22 | public enum Level { 23 | ALL, 24 | TRACE, 25 | DEBUG, 26 | INFO, 27 | WARN, 28 | ERROR, 29 | FATAL, 30 | OFF 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/logevents/LocationInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.logevents; 18 | 19 | /** 20 | * Represents the location of a logging message. 21 | */ 22 | public class LocationInfo { 23 | public final String fileName; 24 | public final String className; 25 | public final String methodName; 26 | public final int lineNumber; 27 | 28 | public LocationInfo(final String file, final String classname, final String method, final int line) { 29 | this.fileName = file; 30 | this.className = classname; 31 | this.methodName = method; 32 | this.lineNumber = line; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/osx/OSXIntegration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.osx; 18 | 19 | import java.awt.Desktop; 20 | import org.apache.log4j.chainsaw.logui.LogUI; 21 | 22 | /** 23 | * This class leverages the 'Desktop' awt API in order to follow Mac-specific UI guidelines. 24 | *

25 | * 26 | * @author psmith 27 | * @see "http://developer.apple.com/documentation/Java/index.html" 28 | */ 29 | public class OSXIntegration { 30 | public static final boolean IS_OSX = System.getProperty("os.name").startsWith("Mac OS X"); 31 | private static final Desktop desktop = Desktop.getDesktop(); 32 | 33 | public static void init(final LogUI logUI) { 34 | if (desktop.isSupported(Desktop.Action.APP_ABOUT)) { 35 | desktop.setAboutHandler(e -> logUI.showAboutBox()); 36 | } 37 | 38 | if (desktop.isSupported(Desktop.Action.APP_PREFERENCES)) { 39 | desktop.setPreferencesHandler(e -> logUI.showApplicationPreferences()); 40 | } 41 | 42 | if (desktop.isSupported(Desktop.Action.APP_QUIT_HANDLER)) { 43 | desktop.setQuitHandler((e, r) -> { 44 | if (logUI.exit()) { 45 | r.performQuit(); 46 | } else { 47 | r.cancelQuit(); 48 | } 49 | }); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/prefs/AbstractSettingsEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.prefs; 18 | 19 | import java.io.File; 20 | import java.util.EventObject; 21 | 22 | /** 23 | * @author psmith 24 | */ 25 | class AbstractSettingsEvent extends EventObject { 26 | 27 | private final File settingsLocation; 28 | 29 | /** 30 | * @param source 31 | */ 32 | public AbstractSettingsEvent(Object source, File settingsLocation) { 33 | super(source); 34 | this.settingsLocation = settingsLocation; 35 | } 36 | 37 | public File getSettingsLocation() { 38 | return this.settingsLocation; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/prefs/LoadSettingsEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.prefs; 18 | 19 | import java.util.*; 20 | 21 | /** 22 | * @author Paul Smith <psmith@apache.org> 23 | */ 24 | public class LoadSettingsEvent extends SettingsEvent { 25 | 26 | LoadSettingsEvent(Object source, Properties properties) { 27 | super(source); 28 | this.properties = properties; 29 | } 30 | 31 | public String getSetting(String key) { 32 | return properties.getProperty(key); 33 | } 34 | 35 | public boolean asBoolean(String key) { 36 | return Boolean.valueOf(getSetting(key)); 37 | } 38 | 39 | public int asInt(String key) { 40 | String val = getSetting(key); 41 | try { 42 | return Integer.parseInt(val); 43 | } catch (NumberFormatException e) { 44 | e.printStackTrace(); 45 | throw new RuntimeException("An error occurred retrieving the Integer value of the setting '" + key + "'"); 46 | } 47 | } 48 | 49 | private final Properties properties; 50 | 51 | /** 52 | * Returns an unmodifiable Collection of values whose 53 | * setting key begins (String.startsWith()) the specified 54 | * string. 55 | * 56 | * @param string 57 | */ 58 | public Collection getSettingsStartingWith(String string) { 59 | Collection c = new ArrayList(); 60 | 61 | for (Map.Entry objectObjectEntry : properties.entrySet()) { 62 | Map.Entry entry = objectObjectEntry; 63 | if (entry.getKey().toString().startsWith(string)) { 64 | c.add(entry.getValue()); 65 | } 66 | } 67 | 68 | return Collections.unmodifiableCollection(c); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/prefs/ProfileManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.prefs; 18 | 19 | /** 20 | * @author Paul Smith <psmith@apache.org> 21 | */ 22 | public class ProfileManager { 23 | 24 | private static final ProfileManager instance = new ProfileManager(); 25 | 26 | public static final ProfileManager getInstance() { 27 | return instance; 28 | } 29 | 30 | public void configure(Profileable p) { 31 | // Properties props = new Properties(SettingsManager.getInstance().getDefaultSettings()); 32 | // LoadSettingsEvent event = new LoadSettingsEvent(this, props); 33 | // p.loadSettings(event); 34 | } 35 | 36 | public void configure(Profileable p, String profileName) { 37 | throw new UnsupportedOperationException("Not implemented as yet"); 38 | } 39 | 40 | private ProfileManager() {} 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/prefs/Profileable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.prefs; 18 | 19 | /** 20 | * A component implementing this interface is interested in being able to 21 | * configure itself. 22 | *

23 | * Since this interface extends SettingsListener, the component 24 | * will receive Load and Save settings events as described 25 | * in SettingsManager 26 | * 27 | * @author Paul Smith <psmith@apache.org> 28 | * @see org.apache.log4j.chainsaw.prefs.SettingsManager 29 | */ 30 | public interface Profileable extends SettingsListener { 31 | 32 | /** 33 | * Must be able to provide a name which is used to determine at a minimum, 34 | * the default profile name prefix for this component. 35 | */ 36 | String getNamespace(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/prefs/SaveSettingsEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.prefs; 18 | 19 | import java.io.File; 20 | import java.util.Properties; 21 | 22 | /** 23 | * @author Paul Smith <psmith@apache.org> 24 | */ 25 | public class SaveSettingsEvent extends AbstractSettingsEvent { 26 | 27 | SaveSettingsEvent(Object source, File settingsLocation) { 28 | super(source, settingsLocation); 29 | } 30 | 31 | public void saveSetting(String key, int value) { 32 | saveSetting(key, "" + value); 33 | } 34 | 35 | public void saveSetting(String key, double value) { 36 | saveSetting(key, "" + value); 37 | } 38 | 39 | public void saveSetting(String key, Object value) { 40 | saveSetting(key, value.toString()); 41 | } 42 | 43 | public void saveSetting(String key, String value) { 44 | properties.put(key, value); 45 | } 46 | 47 | Properties getProperties() { 48 | return properties; 49 | } 50 | 51 | private Properties properties = new Properties(); 52 | 53 | /** 54 | * @param string 55 | * @param b 56 | */ 57 | public void saveSetting(String string, boolean b) { 58 | properties.put(string, b ? Boolean.TRUE.toString() : Boolean.FALSE.toString()); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/prefs/SettingsEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.prefs; 18 | 19 | import java.util.EventObject; 20 | 21 | /** 22 | * @author Paul Smith <psmith@apache.org> 23 | */ 24 | public abstract class SettingsEvent extends EventObject { 25 | 26 | SettingsEvent(Object source) { 27 | super(source); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/prefs/SettingsListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.prefs; 18 | 19 | import java.util.EventListener; 20 | 21 | /** 22 | * Components, or objects, that are interested in being notified when 23 | * Settings are loaded or being saved, can implement this interface. 24 | *

25 | * 'Settings' are Chainsaw wide preferences, and are not specific to a particular 26 | * tab identifer etc. See the correspoing ProfileListener and related classes 27 | * for a discussion on profile specific events etc. 28 | *

29 | * The implementing class can use this event notification opportunity 30 | * to load setting information stored previously, or to 31 | * request that setting information be stored. 32 | *

33 | * NOTE: This contract does _*NOT*_ dictate that the Thread invoking these 34 | * methods will be the Swing's Event dispatching event, it could 35 | * be any arbitary thread. Having said that, it COULD be the Swing's Event 36 | * dispatching event, but this contract makes no guarantee. 37 | * 38 | * @author Paul Smith <psmith@apache.org> 39 | */ 40 | public interface SettingsListener extends EventListener { 41 | 42 | /** 43 | * When a request to load Settings has been requested, this method 44 | * will be invoked by the SettingsManager. The implementing 45 | * component can query the event for settings, and modify 46 | * it's internal state based on these settings. 47 | * 48 | * @param event 49 | */ 50 | void loadSettings(LoadSettingsEvent event); 51 | 52 | void saveSettings(SaveSettingsEvent event); 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/receiver/ChainsawReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.receiver; 18 | 19 | import java.beans.PropertyChangeListener; 20 | import org.apache.log4j.chainsaw.ChainsawEventBatchListener; 21 | import org.apache.log4j.chainsaw.logevents.Level; 22 | 23 | /** 24 | * A receiver receives log events from a source. 25 | */ 26 | public interface ChainsawReceiver { 27 | 28 | void addChainsawEventBatchListener(ChainsawEventBatchListener listen); 29 | 30 | void removeEventBatchListener(ChainsawEventBatchListener listen); 31 | 32 | void setThreshold(final Level level); 33 | 34 | Level getThreshold(); 35 | 36 | String getName(); 37 | 38 | void setName(String name); 39 | 40 | int getQueueInterval(); 41 | 42 | void setQueueInterval(int interval); 43 | 44 | void setPaused(boolean paused); 45 | 46 | boolean getPaused(); 47 | 48 | /** 49 | * Start this receiver by(for example) opening a network socket. 50 | */ 51 | void start(); 52 | 53 | /** 54 | * Stop this receiver by(for example) closing network sockets. 55 | */ 56 | void shutdown(); 57 | 58 | void addPropertyChangeListener(final PropertyChangeListener listener); 59 | 60 | void addPropertyChangeListener(final String propertyName, final PropertyChangeListener listener); 61 | 62 | void removePropertyChangeListener(final PropertyChangeListener listener); 63 | 64 | void removePropertyChangeListener(final String propertyName, final PropertyChangeListener listener); 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/receiver/ChainsawReceiverFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.receiver; 18 | 19 | import java.beans.IntrospectionException; 20 | import java.beans.PropertyDescriptor; 21 | 22 | /** 23 | * A factory that will create new instances of Receivers 24 | */ 25 | public interface ChainsawReceiverFactory { 26 | 27 | /** 28 | * Create a new ChainsawReceiver from this factory. 29 | * @return 30 | */ 31 | ChainsawReceiver create(); 32 | 33 | /** 34 | * For the type of ChainsawReceiver that this factory creates, 35 | * get the property descriptors for the class. 36 | * @return 37 | */ 38 | PropertyDescriptor[] getPropertyDescriptors() throws IntrospectionException; 39 | 40 | /** 41 | * Get the name of the receiver that this factory will create 42 | * @return 43 | */ 44 | String getReceiverName(); 45 | 46 | /** 47 | * Documentation string in HTML format that will be displayed to the user. 48 | * 49 | * @return 50 | */ 51 | String getReceiverDocumentation(); 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/receivers/VisualReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.receivers; 18 | 19 | import java.awt.*; 20 | 21 | /** 22 | * If a receiver has a visual component, implement this interface and Chainsaw will call 23 | * 'setContainer' passing in a container that the receiver can use. 24 | *

25 | * For example, VFSLogFilePatternReceiver provides an optional 'promptForUserInfo', that 26 | * when set to true, will allow a login dialog to be displayed on top of the Chainsaw window. 27 | * 28 | * @author Scott Deboy<sdeboy@apache.org> 29 | */ 30 | public interface VisualReceiver { 31 | /** 32 | * Provides access to a container. 33 | * 34 | * @param container 35 | */ 36 | void setContainer(Container container); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiverBeanInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.vfs; 18 | 19 | import java.beans.PropertyDescriptor; 20 | import java.beans.SimpleBeanInfo; 21 | 22 | /** 23 | * BeanInfo class for the meta-data of the VFSLogFilePatternReceiver. 24 | */ 25 | public class VFSLogFilePatternReceiverBeanInfo extends SimpleBeanInfo { 26 | /* (non-Javadoc) 27 | * @see java.beans.BeanInfo#getPropertyDescriptors() 28 | */ 29 | public PropertyDescriptor[] getPropertyDescriptors() { 30 | try { 31 | return new PropertyDescriptor[] { 32 | new PropertyDescriptor("fileURL", VFSLogFilePatternReceiver.class), 33 | new PropertyDescriptor("timestampFormat", VFSLogFilePatternReceiver.class), 34 | new PropertyDescriptor("logFormat", VFSLogFilePatternReceiver.class), 35 | new PropertyDescriptor("name", VFSLogFilePatternReceiver.class), 36 | new PropertyDescriptor("tailing", VFSLogFilePatternReceiver.class), 37 | new PropertyDescriptor("autoReconnect", VFSLogFilePatternReceiver.class), 38 | new PropertyDescriptor("waitMillis", VFSLogFilePatternReceiver.class), 39 | new PropertyDescriptor("appendNonMatches", VFSLogFilePatternReceiver.class), 40 | new PropertyDescriptor("customLevelDefinitions", VFSLogFilePatternReceiver.class), 41 | new PropertyDescriptor("filterExpression", VFSLogFilePatternReceiver.class), 42 | new PropertyDescriptor("promptForUserInfo", VFSLogFilePatternReceiver.class), 43 | new PropertyDescriptor("group", VFSLogFilePatternReceiver.class), 44 | }; 45 | } catch (Exception e) { 46 | } 47 | 48 | return null; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/chainsaw/zeroconf/ZeroConfPreferenceModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.chainsaw.zeroconf; 18 | 19 | import java.util.ArrayList; 20 | import java.util.HashSet; 21 | import java.util.List; 22 | import java.util.Set; 23 | 24 | public class ZeroConfPreferenceModel { 25 | 26 | private List monitoredZones = new ArrayList<>(); 27 | private Set autoConnectDevices = new HashSet<>(); 28 | 29 | // TODO expose addPropertyChangeListener 30 | 31 | public void addAutoConnectDevice(String deviceName) { 32 | // TODO fire property changes 33 | autoConnectDevices.add(deviceName); 34 | } 35 | 36 | public void addMonitoredZone(String zone) { 37 | // TODO fire property change events 38 | monitoredZones.add(zone); 39 | } 40 | 41 | public Set getAutoConnectDevices() { 42 | return autoConnectDevices; 43 | } 44 | 45 | public void setAutoConnectDevices(Set autoConnectDevices) { 46 | this.autoConnectDevices = autoConnectDevices; 47 | } 48 | 49 | public List getMonitoredZones() { 50 | return monitoredZones; 51 | } 52 | 53 | public void setMonitoredZones(List monitoredZones) { 54 | this.monitoredZones = monitoredZones; 55 | } 56 | 57 | public void removeAutoConnectDevice(String device) { 58 | autoConnectDevices.remove(device); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/net/AddressBased.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.net; 18 | 19 | /** 20 | * Net based entities that 'work with' an Address 21 | * should consider implementing this 22 | * interface so that they can be treated generically. 23 | * 24 | * @author Paul Smith (psmith@apache.org) 25 | */ 26 | public interface AddressBased extends NetworkBased { 27 | /** 28 | * Returns a String representation of the Address this instance 29 | * encompasses. 30 | * 31 | * @return String representation of the Address 32 | */ 33 | String getAddress(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/net/ECSLogEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.net; 18 | 19 | import com.owlike.genson.annotation.JsonProperty; 20 | import java.time.ZonedDateTime; 21 | import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEvent; 22 | import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEventBuilder; 23 | 24 | /** 25 | * Represents a LogEvent as from a ECS(ElasticSearch) event. 26 | */ 27 | public class ECSLogEvent { 28 | @JsonProperty("@timestamp") 29 | public String timestamp; 30 | 31 | @JsonProperty("log.level") 32 | public String level; 33 | 34 | public String message; 35 | 36 | @JsonProperty("process.thread.name") 37 | public String threadName; 38 | 39 | @JsonProperty("log.logger") 40 | public String logger; 41 | 42 | ChainsawLoggingEvent toChainsawLoggingEvent(ChainsawLoggingEventBuilder build) { 43 | build.clear(); 44 | 45 | build.setLevelFromString(level) 46 | .setMessage(message) 47 | .setLogger(logger) 48 | .setThreadName(threadName) 49 | .setTimestamp(ZonedDateTime.parse(timestamp).toInstant()); 50 | 51 | return build.create(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/net/JsonReceiverFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.net; 18 | 19 | import java.beans.IntrospectionException; 20 | import java.beans.PropertyDescriptor; 21 | import org.apache.log4j.chainsaw.receiver.ChainsawReceiver; 22 | import org.apache.log4j.chainsaw.receiver.ChainsawReceiverFactory; 23 | 24 | /** 25 | * 26 | * @author robert 27 | */ 28 | public class JsonReceiverFactory implements ChainsawReceiverFactory { 29 | 30 | @Override 31 | public ChainsawReceiver create() { 32 | return new JsonReceiver(); 33 | } 34 | 35 | @Override 36 | public PropertyDescriptor[] getPropertyDescriptors() throws IntrospectionException { 37 | return new PropertyDescriptor[] { 38 | new PropertyDescriptor("name", JsonReceiver.class), 39 | // new PropertyDescriptor("address", JsonReceiver.class), 40 | new PropertyDescriptor("port", JsonReceiver.class), 41 | // new PropertyDescriptor("threshold", MulticastReceiver.class), 42 | // new PropertyDescriptor("decoder", MulticastReceiver.class), 43 | // new PropertyDescriptor("advertiseViaMulticastDNS", MulticastReceiver.class), 44 | }; 45 | } 46 | 47 | @Override 48 | public String getReceiverName() { 49 | return "Json Receiver"; 50 | } 51 | 52 | @Override 53 | public String getReceiverDocumentation() { 54 | return "JSON Recevier\n" + "The JSON recevier receives events in an ECS Log Event format.\n" 55 | + "This receiver listens on the specified port for incoming data."; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/net/MulticastReceiverBeanInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.net; 18 | 19 | import java.beans.PropertyDescriptor; 20 | import java.beans.SimpleBeanInfo; 21 | 22 | /** 23 | * BeanInfo class for the meta-data of the MulticastReceiver. 24 | * 25 | * @author Paul Smith <psmith@apache.org> 26 | */ 27 | public class MulticastReceiverBeanInfo extends SimpleBeanInfo { 28 | 29 | /* (non-Javadoc) 30 | * @see java.beans.BeanInfo#getPropertyDescriptors() 31 | */ 32 | public PropertyDescriptor[] getPropertyDescriptors() { 33 | 34 | try { 35 | 36 | return new PropertyDescriptor[] { 37 | new PropertyDescriptor("name", MulticastReceiver.class), 38 | new PropertyDescriptor("address", MulticastReceiver.class), 39 | new PropertyDescriptor("port", MulticastReceiver.class), 40 | new PropertyDescriptor("threshold", MulticastReceiver.class), 41 | new PropertyDescriptor("decoder", MulticastReceiver.class), 42 | new PropertyDescriptor("advertiseViaMulticastDNS", MulticastReceiver.class), 43 | }; 44 | } catch (Exception e) { 45 | } 46 | 47 | return null; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/net/MulticastReceiverFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.net; 18 | 19 | import java.beans.IntrospectionException; 20 | import java.beans.PropertyDescriptor; 21 | import org.apache.log4j.chainsaw.receiver.ChainsawReceiver; 22 | import org.apache.log4j.chainsaw.receiver.ChainsawReceiverFactory; 23 | 24 | /** 25 | * 26 | */ 27 | public class MulticastReceiverFactory implements ChainsawReceiverFactory { 28 | 29 | @Override 30 | public ChainsawReceiver create() { 31 | return new MulticastReceiver(); 32 | } 33 | 34 | @Override 35 | public PropertyDescriptor[] getPropertyDescriptors() throws IntrospectionException { 36 | return new PropertyDescriptor[] { 37 | new PropertyDescriptor("name", MulticastReceiver.class), 38 | new PropertyDescriptor("port", MulticastReceiver.class), 39 | new PropertyDescriptor("address", MulticastReceiver.class), 40 | new PropertyDescriptor("encoding", MulticastReceiver.class), 41 | new PropertyDescriptor("decoder", MulticastReceiver.class), 42 | }; 43 | } 44 | 45 | @Override 46 | public String getReceiverName() { 47 | return "MulticastReceiver"; 48 | } 49 | 50 | @Override 51 | public String getReceiverDocumentation() { 52 | return "The multicast recevier has the following parameters:
" + "

    " 53 | + "
  • port - the port to listen on for incoming data
  • " 54 | + "
  • address - the IP address to listen on for incoming data
  • " 55 | + "
  • encoding - the encoding of the data(e.g. UTF-8)
  • " 56 | + "
  • decoder - the specific decoder to use to decode the data. Only XML decoding is built-in
  • " 57 | + "
" 58 | + ""; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/net/NetworkBased.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.net; 18 | 19 | /** 20 | * The parent of all the Network based interfaces. 21 | * 22 | * @author Paul Smith (psmith@apache.org) 23 | */ 24 | public interface NetworkBased { 25 | 26 | /** 27 | * Get name. 28 | * 29 | * @return name. 30 | */ 31 | String getName(); 32 | 33 | /** 34 | * Get if item is active. 35 | * 36 | * @return if true, item is active. 37 | */ 38 | boolean isActive(); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/net/PortBased.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.net; 18 | 19 | /** 20 | * Net based entities that 'work with' a Port should consider implementing this 21 | * interface so that they can be treated generically. 22 | * 23 | * @author Paul Smith (psmith@apache.org) 24 | */ 25 | public interface PortBased extends NetworkBased { 26 | /** 27 | * Returns the Port # that this net based thing is using. 28 | * 29 | * @return int port number 30 | */ 31 | int getPort(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/net/SocketNodeEventListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.net; 18 | 19 | import java.util.EventListener; 20 | 21 | /** 22 | * Interface used to listen for {@link SocketNode} related 23 | * events. Clients register an instance of the interface and the 24 | * instance is called back when the various events occur. 25 | * 26 | * @author Mark Womack 27 | * @author Paul Smith (psmith@apache.org) 28 | */ 29 | public interface SocketNodeEventListener extends EventListener { 30 | 31 | /** 32 | * Called when the SocketNode is created and begins awaiting data. 33 | * 34 | * @param remoteInfo remote info 35 | */ 36 | void socketOpened(String remoteInfo); 37 | 38 | /** 39 | * Called when the socket the node was given has been closed. 40 | * 41 | * @param e exception 42 | */ 43 | void socketClosedEvent(Exception e); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/net/UDPReceiverFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.net; 18 | 19 | import java.beans.IntrospectionException; 20 | import java.beans.PropertyDescriptor; 21 | import org.apache.log4j.chainsaw.receiver.ChainsawReceiver; 22 | import org.apache.log4j.chainsaw.receiver.ChainsawReceiverFactory; 23 | 24 | public class UDPReceiverFactory implements ChainsawReceiverFactory { 25 | 26 | @Override 27 | public ChainsawReceiver create() { 28 | return new UDPReceiver(); 29 | } 30 | 31 | @Override 32 | public PropertyDescriptor[] getPropertyDescriptors() throws IntrospectionException { 33 | return new PropertyDescriptor[] { 34 | new PropertyDescriptor("name", UDPReceiver.class), 35 | new PropertyDescriptor("port", UDPReceiver.class), 36 | new PropertyDescriptor("encoding", UDPReceiver.class), 37 | new PropertyDescriptor("decoder", UDPReceiver.class), 38 | }; 39 | } 40 | 41 | @Override 42 | public String getReceiverName() { 43 | return "UDPReceiver"; 44 | } 45 | 46 | @Override 47 | public String getReceiverDocumentation() { 48 | return "The UDP recevier has the following parameters:
" + "
    " 49 | + "
  • port - the port to listen on for incoming data on all interfaces
  • " 50 | + "
  • encoding - the encoding of the data(e.g. UTF-8)
  • " 51 | + "
  • decoder - the specific decoder to use to decode the data. Only XML decoding is built-in
  • " 52 | + "
" 53 | + ""; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/net/XMLReceiverFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.net; 18 | 19 | import java.beans.IntrospectionException; 20 | import java.beans.PropertyDescriptor; 21 | import org.apache.log4j.chainsaw.receiver.ChainsawReceiver; 22 | import org.apache.log4j.chainsaw.receiver.ChainsawReceiverFactory; 23 | 24 | /** 25 | * 26 | * @author robert 27 | */ 28 | public class XMLReceiverFactory implements ChainsawReceiverFactory { 29 | 30 | @Override 31 | public ChainsawReceiver create() { 32 | return new XMLSocketReceiver(); 33 | } 34 | 35 | @Override 36 | public PropertyDescriptor[] getPropertyDescriptors() throws IntrospectionException { 37 | return new PropertyDescriptor[] { 38 | new PropertyDescriptor("name", XMLSocketReceiver.class), 39 | new PropertyDescriptor("port", XMLSocketReceiver.class), 40 | }; 41 | } 42 | 43 | @Override 44 | public String getReceiverName() { 45 | return "XMLSocketReceiver"; 46 | } 47 | 48 | @Override 49 | public String getReceiverDocumentation() { 50 | return "The XML recevier has the following parameters:
" + "
    " 51 | + "
  • port - the port to listen on for incoming data via TCP
  • " 52 | + "
" 53 | + "Note that this receiver listens for only log4j1 style XML events" 54 | + ""; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/rule/AbstractRule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.rule; 18 | 19 | import java.beans.PropertyChangeEvent; 20 | import java.beans.PropertyChangeListener; 21 | import java.beans.PropertyChangeSupport; 22 | import java.io.Serializable; 23 | 24 | /** 25 | * An abstract Rule class that provides the PropertyChange support plumbing. 26 | * 27 | * @author Paul Smith (psmith@apache.org) 28 | * @author Scott Deboy (sdeboy@apache.org) 29 | */ 30 | public abstract class AbstractRule implements Rule, Serializable { 31 | /** 32 | * Serialization id. 33 | */ 34 | static final long serialVersionUID = -2844288145563025172L; 35 | 36 | /** 37 | * PropertySupport instance. 38 | */ 39 | private PropertyChangeSupport propertySupport = new PropertyChangeSupport(this); 40 | 41 | /** 42 | * Add property change listener. 43 | * @param l listener. 44 | */ 45 | public void addPropertyChangeListener(final PropertyChangeListener l) { 46 | propertySupport.addPropertyChangeListener(l); 47 | } 48 | 49 | /** 50 | * Remove property change listener. 51 | * @param l listener. 52 | */ 53 | public void removePropertyChangeListener(final PropertyChangeListener l) { 54 | propertySupport.removePropertyChangeListener(l); 55 | } 56 | 57 | /** 58 | * Send property change notification to attached listeners. 59 | * @param propertyName property name. 60 | * @param oldVal old value. 61 | * @param newVal new value. 62 | */ 63 | protected void firePropertyChange(final String propertyName, final Object oldVal, final Object newVal) { 64 | propertySupport.firePropertyChange(propertyName, oldVal, newVal); 65 | } 66 | 67 | /** 68 | * Send property change notification to attached listeners. 69 | * @param evt property change event. 70 | */ 71 | public void firePropertyChange(final PropertyChangeEvent evt) { 72 | propertySupport.firePropertyChange(evt); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/rule/Rule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.rule; 18 | 19 | import java.beans.PropertyChangeListener; 20 | import java.util.Map; 21 | import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEvent; 22 | 23 | /** 24 | * A Rule evaluates to true of false given a LoggingEvent object, and can notify 25 | * listeners when the underlying implementation of this Rule has it's 26 | * criteria changed by using the standard PropertyChangeListener infrastructure. 27 | * 28 | * @author Paul Smith (psmith@apache.org) 29 | * @author Scott Deboy (sdeboy@apache.org) 30 | */ 31 | public interface Rule { 32 | /** 33 | * Returns true if this implementation of the rule accepts the LoggingEvent, 34 | * or false if not. 35 | * 36 | *

What True/False means can be client-specific. 37 | * 38 | * @param e LoggingEvent this instance will evaluate 39 | * @param matches a Map of event field keys to Sets of matching strings (may be null) which will be 40 | * updated during execution of this method to include field and string matches based on the rule 41 | * evaluation results 42 | * @return true if this Rule instance accepts the event, otherwise false. 43 | */ 44 | boolean evaluate(ChainsawLoggingEvent e, Map matches); 45 | 46 | /** 47 | * Adds a PropertyChangeListener to this instance, which is notified when 48 | * underlying Rule information has changed. 49 | * (there are no specific property name events). 50 | * @param listener listener 51 | */ 52 | void addPropertyChangeListener(PropertyChangeListener listener); 53 | 54 | /** 55 | * Removes a known PropertyChangeListener from this Rule. 56 | * @param listener listener 57 | */ 58 | void removePropertyChangeListener(PropertyChangeListener listener); 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/scheduler/Job.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.scheduler; 18 | 19 | /** 20 | * Job is a very simple interface. It only has a single method {@link #execute} 21 | * which is called by the {@link Scheduler} when a task is ready for execution. 22 | *

23 | * It is assumed that the execution context 24 | * are contained within the implementing 25 | * {@link Job} itself. 26 | * 27 | * @author Ceki Gülcü 28 | */ 29 | public interface Job { 30 | /** 31 | * Execute job. 32 | */ 33 | void execute(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/spi/Decoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.spi; 18 | 19 | import java.io.IOException; 20 | import java.net.URL; 21 | import java.util.Map; 22 | import java.util.Vector; 23 | import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEvent; 24 | 25 | /** 26 | * Allow LoggingEvents to be reconstructed from a different format 27 | * (usually XML). 28 | * 29 | * @author Scott Deboy (sdeboy@apache.org) 30 | */ 31 | public interface Decoder { 32 | /** 33 | * Decode events from document. 34 | * 35 | * @param document document to decode. 36 | * @return list of LoggingEvent instances. 37 | */ 38 | Vector decodeEvents(String document); 39 | 40 | /** 41 | * Decode event from string. 42 | * 43 | * @param event string representation of event 44 | * @return event 45 | */ 46 | ChainsawLoggingEvent decode(String event); 47 | 48 | /** 49 | * Decode event from document retreived from URL. 50 | * 51 | * @param url url of document 52 | * @return list of LoggingEvent instances. 53 | * @throws IOException if IO error resolving document. 54 | */ 55 | Vector decode(URL url) throws IOException; 56 | 57 | /** 58 | * Sets additional properties. 59 | * 60 | * @param additionalProperties map of additional properties. 61 | */ 62 | void setAdditionalProperties(Map additionalProperties); 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/varia/LogFilePatternReceiverBeanInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.varia; 18 | 19 | import java.beans.PropertyDescriptor; 20 | import java.beans.SimpleBeanInfo; 21 | 22 | /** 23 | * BeanInfo class for the meta-data of the LogFilePatternReceiver. 24 | */ 25 | public class LogFilePatternReceiverBeanInfo extends SimpleBeanInfo { 26 | /* (non-Javadoc) 27 | * @see java.beans.BeanInfo#getPropertyDescriptors() 28 | */ 29 | public PropertyDescriptor[] getPropertyDescriptors() { 30 | try { 31 | return new PropertyDescriptor[] { 32 | new PropertyDescriptor("fileURL", LogFilePatternReceiver.class), 33 | new PropertyDescriptor("timestampFormat", LogFilePatternReceiver.class), 34 | new PropertyDescriptor("logFormat", LogFilePatternReceiver.class), 35 | new PropertyDescriptor("name", LogFilePatternReceiver.class), 36 | new PropertyDescriptor("tailing", LogFilePatternReceiver.class), 37 | new PropertyDescriptor("filterExpression", LogFilePatternReceiver.class), 38 | new PropertyDescriptor("waitMillis", LogFilePatternReceiver.class), 39 | new PropertyDescriptor("appendNonMatches", LogFilePatternReceiver.class), 40 | new PropertyDescriptor("customLevelDefinitions", LogFilePatternReceiver.class), 41 | new PropertyDescriptor("useCurrentThread", LogFilePatternReceiver.class), 42 | new PropertyDescriptor("group", LogFilePatternReceiver.class), 43 | }; 44 | } catch (Exception e) { 45 | } 46 | 47 | return null; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/xml/Log4jEntityResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.xml; 18 | 19 | import java.io.ByteArrayInputStream; 20 | import java.io.InputStream; 21 | import org.apache.logging.log4j.LogManager; 22 | import org.apache.logging.log4j.Logger; 23 | import org.xml.sax.EntityResolver; 24 | import org.xml.sax.InputSource; 25 | 26 | /** 27 | * An {@link EntityResolver} specifically designed to return 28 | * log4j.dtd which is embedded within the log4j jar 29 | * file. 30 | * 31 | * @author Paul Austin 32 | * */ 33 | public class Log4jEntityResolver implements EntityResolver { 34 | private static final String PUBLIC_ID = "-//APACHE//DTD LOG4J 1.2//EN"; 35 | private static final Logger logger = LogManager.getLogger(Log4jEntityResolver.class); 36 | 37 | public InputSource resolveEntity(String publicId, String systemId) { 38 | if (systemId.endsWith("log4j.dtd") || PUBLIC_ID.equals(publicId)) { 39 | Class clazz = getClass(); 40 | InputStream in = clazz.getResourceAsStream("/org/apache/log4j/xml/log4j.dtd"); 41 | if (in == null) { 42 | logger.warn( 43 | "Could not find [log4j.dtd] using [{}] class loader, parsed without DTD.", 44 | clazz.getClassLoader()); 45 | in = new ByteArrayInputStream(new byte[0]); 46 | } 47 | return new InputSource(in); 48 | } else { 49 | return null; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/apache/log4j/xml/UtilLoggingEntityResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.log4j.xml; 18 | 19 | import java.io.ByteArrayInputStream; 20 | import org.xml.sax.EntityResolver; 21 | import org.xml.sax.InputSource; 22 | 23 | /** 24 | * An {@link EntityResolver} specifically designed to return 25 | * an empty InputSource for logger.dtd. 26 | */ 27 | public final class UtilLoggingEntityResolver implements EntityResolver { 28 | 29 | /** 30 | * Create new instance. 31 | */ 32 | public UtilLoggingEntityResolver() { 33 | super(); 34 | } 35 | 36 | /** 37 | * {@inheritDoc} 38 | */ 39 | public InputSource resolveEntity(final String publicId, final String systemId) { 40 | if (systemId.endsWith("logger.dtd")) { 41 | return new InputSource(new ByteArrayInputStream(new byte[0])); 42 | } else { 43 | return null; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Chainsaw 2 | Copyright 2007 The Apache Software Foundation 3 | 4 | This product includes software developed by 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/services/org.apache.log4j.chainsaw.receiver.ChainsawReceiverFactory: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | org.apache.log4j.net.MulticastReceiverFactory 17 | org.apache.log4j.net.UDPReceiverFactory 18 | org.apache.log4j.net.XMLReceiverFactory 19 | org.apache.log4j.varia.LogFilePatternReceiverFactory 20 | org.apache.log4j.net.JsonReceiverFactory 21 | org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiverFactory 22 | -------------------------------------------------------------------------------- /src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/main/resources/logo.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/logo.icns -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/ChainsawAbout.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
Log4j Logo
26 |

Chainsaw v2

27 |

Brought to you by the Apache Logging Services Project team

28 |

Please send questions, bug reports and/or feature requests to dev@logging.apache.org

29 |

30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | ` 43 | 44 |
Principle DevelopersScott Deboy
Paul Smith
 
Contributions from (thanks!):Ceki Gülcü
Oliver Burn
Stephen Pain
Isuru Suriarachchi
 
Using the following technologies
Jakarta Commons VFS
XStream (BSD License)
JmDNS
45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/Details_UDPReceiver.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | UDP Receiver 23 |

This is where we will put text describing a UDP Receiver

24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/Details_XMLSocketReceiver.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | XML Socket Receiver 23 |

XMLSocketReceiver compliments externally provided SocketAppenders.
24 | XMLSocketReceiver supports Log4J's log4j.dtd and Java 1.4's logger.dtd.
25 | However, only Log4J's log4j.dtd is currently supported when defining the receiver 26 | through this panel. 27 |

28 | 29 |

XMLSocketReceiver listens 30 | on a specified port, accepting connections from remote sockets 31 | , converts the XML into logging events received from these sockets, 32 | and posts them into Chainsaw's local Log4j environment allowing you 33 | to view them.

34 |

Click here to see more information about XMLSocketReceiver.

35 | 36 |

Click here to see more information about SocketAppender.

37 | 38 | -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/favourites/package.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |

The Favourites package. 26 | 27 |


28 |

Prototype Rules

29 | The following rules are checked against a potential prototype instance to ensure it can 30 | be used and saved for later use: 31 | 32 |
    33 |
  • Have a public no-arg constructor available 34 |
  • TODO - more rules 35 |
36 | 37 | -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/About16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/About16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/About24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/About24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Back16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Back16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Back24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Back24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Bean16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Bean16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Bean24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Bean24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Copy16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Copy16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Copy24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Copy24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Cut16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Cut16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Cut24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Cut24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Delete16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Delete16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Delete24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Delete24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Down16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Down16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Edit16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Edit16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Edit24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Edit24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Export16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Export16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Export24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Export24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Find16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Find16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Find24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Find24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Forward16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Forward16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Forward24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Forward24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Help16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Help16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Help24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Help24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Home16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Home16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Home24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Home24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Host16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Host16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Host24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Host24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Import16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Import16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Import24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Import24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Information16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Information16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Information24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Information24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2000 by Sun Microsystems, Inc. All Rights Reserved. 2 | 3 | Sun grants you ("Licensee") a non-exclusive, royalty free, license to use, and redistribute this software graphics artwork, as individual graphics or as a collection, as part of software code or programs that you develop, provided that i) this copyright notice and license accompany the software graphics artwork; and ii) you do not utilize the software graphics artwork in a manner which is disparaging to Sun. Unless enforcement is prohibited by applicable law, you may not modify the graphics, and must use them true to color and unmodified in every way. 4 | 5 | This software graphics artwork is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE GRAPHICS ARTWORK. 6 | 7 | IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE GRAPHICS ARTWORK, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 8 | 9 | If any of the above provisions are held to be in violation of applicable law, void, or unenforceable in any jurisdiction, then such provisions are waived to the extent necessary for this Disclaimer to be otherwise enforceable in such jurisdiction. 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/New16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/New16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/New24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/New24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Open16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Open16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Open24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Open24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Pause16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Pause16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Pause24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Pause24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Play16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Play16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Play24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Play24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Preferences16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Preferences16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Preferences24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Preferences24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Redo16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Redo16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Redo24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Redo24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Refresh16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Refresh16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Refresh24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Refresh24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/RowInsertAfter16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/RowInsertAfter16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/RowInsertAfter24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/RowInsertAfter24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/SaveAs16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/SaveAs16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/SaveAs24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/SaveAs24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Server16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Server16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Server24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Server24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Stop16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Stop16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Stop24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Stop24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/TipOfTheDay16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/TipOfTheDay16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/TipOfTheDay24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/TipOfTheDay24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Up16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Up16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Zoom16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Zoom16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/Zoom24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/Zoom24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/ZoomIn16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/ZoomIn16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/ZoomIn24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/ZoomIn24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/ZoomOut16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/ZoomOut16.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/ZoomOut24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/ZoomOut24.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/icons/channelexplorer_satellite.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/icons/channelexplorer_satellite.gif -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/layout/DefaultDetailLayout.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
Level${level}
Logger${logger}
Time${time} (ms delta: ${millisdelta})
Thread${thread}
Message${message}
Marker${marker}
Throwable
${throwable}
-------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/layout/FullDetailLayout.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Level%p
Logger%c
Time%d
Thread%t
Message
%m
NDC%x
Class%C
Method%M
Line%L
File%F
Properties%properties
Throwable
%throwable
-------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/org/apache/log4j/chainsaw/logo.png -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to you under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # ==================================== 19 | # The Default Settings for Chainsaw 20 | # ==================================== 21 | 22 | # These next settings define the location and dimensions of the main 23 | # window when it is first realized on startup 24 | main.window.x=0 25 | main.window.y=0 26 | # default width and height to -1 will display the app at full screen resolution 27 | main.window.width=-1 28 | main.window.height=-1 29 | 30 | showNoReceiverWarning=true 31 | identifierExpression=PROP.hostname - PROP.application 32 | cyclicBufferSize=50000 33 | toolTipDisplayMillis=4000 34 | responsiveness=3 35 | tabPlacement=3 36 | statusBarVisible=true 37 | receiversVisible=false 38 | toolbarVisible=true 39 | confirmExit=true 40 | showSplash=true 41 | bypassSearchColors=false 42 | -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/prefs/logpanel.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to you under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # ==================================== 19 | # The Default Settings for a log panel within Chainsaw 20 | # ==================================== 21 | logpanel.paused=false 22 | logpanel.clearTableExpression= 23 | logpanel.alwaysDisplayExpression= 24 | logpanel.hiddenExpression= 25 | logpanel.dateFormatTimeZone= 26 | logpanel.hiddenLoggers= 27 | logpanel.logTreePanelVisible=true 28 | logpanel.toolTipsVisible=false 29 | logpanel.thumbnailBarToolTipsVisible=false 30 | logpanel.showMillisDeltaAsGap=false 31 | logpanel.scrollToBottom=true 32 | logpanel.detailPaneVisible=true 33 | logpanel.loggerPrecision=0 34 | logpanel.searchResultsVisible=true 35 | logpanel.wrapMsg=true 36 | logpanel.visibleOrderedColumnNames= 37 | logpanel.levelIconsDisplayed=false 38 | logpanel.highlightSearchMatchText=true 39 | logpanel.lowerPanelDividerLocation=475 40 | logpanel.logTreeDividerLocation=230 41 | dateFormatPattern=HH:mm:ss 42 | -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/receivers/known.receivers: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # NOTE: if a receiver is added to this list, also change 17 | # tests/src/java/org/apache/log4j/chainsaw/receivers/ReceiversHelperTest.java test case 18 | 19 | org.apache.log4j.net.MulticastReceiver 20 | org.apache.log4j.net.UDPReceiver 21 | org.apache.log4j.net.XMLSocketReceiver 22 | org.apache.log4j.net.JMSReceiver 23 | org.apache.log4j.db.DBReceiver 24 | org.apache.log4j.db.CustomSQLDBReceiver 25 | org.apache.log4j.varia.LogFilePatternReceiver 26 | org.apache.log4j.xml.LogFileXMLReceiver 27 | org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver 28 | org.apache.log4j.net.JsonReceiver 29 | -------------------------------------------------------------------------------- /src/main/resources/org/apache/log4j/chainsaw/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one or more 3 | contributor license agreements. See the NOTICE file distributed with 4 | this work for additional information regarding copyright ownership. 5 | The ASF licenses this file to You under the Apache License, Version 2.0 6 | (the "License"); you may not use this file except in compliance with 7 | the License. You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | */ 18 | 19 | BODY, TABLE, TD { 20 | font-size: 10px; 21 | color: #000000; 22 | font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; 23 | } 24 | 25 | H1 { 26 | 27 | font-size: 12px; 28 | font-weight: bold; 29 | } 30 | 31 | H2 { 32 | font-size: 10px; 33 | font-weight: bold; 34 | } 35 | 36 | .TableTitle { 37 | font-weight: bold; 38 | background-color: #000089; 39 | color: #FFFFFF; 40 | } 41 | 42 | .HotKey { 43 | font-weight: bold; 44 | } -------------------------------------------------------------------------------- /src/main/resources/pages/about.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Log4j Logo 26 |

Chainsaw v2

27 |

Brought to you by the Apache Logging Services Project team.

28 |

Please send questions, bug reports and/or feature requests to dev@logging.apache.org

29 |

Website: https://logging.apache.org

30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/resources/pages/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/main/resources/pages/img/logo.png -------------------------------------------------------------------------------- /src/main/resources/pages/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one or more 3 | contributor license agreements. See the NOTICE file distributed with 4 | this work for additional information regarding copyright ownership. 5 | The ASF licenses this file to You under the Apache License, Version 2.0 6 | (the "License"); you may not use this file except in compliance with 7 | the License. You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | */ 18 | 19 | body { 20 | font-size: 1.2em; 21 | color: #000000; 22 | font-family: Helvetica, Arial, sans-serif; 23 | } 24 | 25 | h1 { 26 | font-size: 1.5em; 27 | font-weight: bold; 28 | } 29 | 30 | h2 { 31 | font-size: 1.3em; 32 | font-weight: bold; 33 | } 34 | -------------------------------------------------------------------------------- /src/site/apt/colorizing-output.apt: -------------------------------------------------------------------------------- 1 | ~~ Licensed to the Apache Software Foundation (ASF) under one or more 2 | ~~ contributor license agreements. See the NOTICE file distributed with 3 | ~~ this work for additional information regarding copyright ownership. 4 | ~~ The ASF licenses this file to You under the Apache License, Version 2.0 5 | ~~ (the "License"); you may not use this file except in compliance with 6 | ~~ the License. You may obtain a copy of the License at 7 | ~~ 8 | ~~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~~ 10 | ~~ Unless required by applicable law or agreed to in writing, software 11 | ~~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~~ See the License for the specific language governing permissions and 14 | ~~ limitations under the License. 15 | 16 | Colorizing Output 17 | 18 | Within Chainsaw, it is possible to colorize different log lines depending 19 | on a rule. This lets you easily find certian log events in a visual manner. 20 | By default there are three rules: Messages that are at an ERROR or FATAL 21 | level, or that have an exception associated with them, are colored red. 22 | Warning messages are colored yellow, and messages that have a marker set are 23 | colored green. 24 | 25 | To modify the colors used, go to a tab and either right-click in the table 26 | of log messages and click 'Color Settings...' 27 | 28 | [images/color-menu-click.png] Right-click to bring up context menu 29 | 30 | Alternatively, you can click on the 'Current Tab' menu item and access the 31 | color settings that way. 32 | 33 | [images/color-menu-bar.png] Using the 'Current Tab' menu 34 | 35 | Once open, the color selection menu will look like this: 36 | 37 | [images/color-selection-menu.png] Color Selection Menu 38 | 39 | From this menu, you can perform operations such as: 40 | 41 | * Adding/removing rules 42 | 43 | * Re-ordering rules 44 | 45 | * Changing the color of a rule. Both background and foregrond colors can be set. 46 | 47 | [] 48 | 49 | Rules are defined using a text-base expression that can match many different 50 | aspects of messages. See the documentation on {{{./expression-rules.html}expression rules}} 51 | for more information. 52 | -------------------------------------------------------------------------------- /src/site/apt/configuration-library.apt: -------------------------------------------------------------------------------- 1 | ~~ Licensed to the Apache Software Foundation (ASF) under one or more 2 | ~~ contributor license agreements. See the NOTICE file distributed with 3 | ~~ this work for additional information regarding copyright ownership. 4 | ~~ The ASF licenses this file to You under the Apache License, Version 2.0 5 | ~~ (the "License"); you may not use this file except in compliance with 6 | ~~ the License. You may obtain a copy of the License at 7 | ~~ 8 | ~~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~~ 10 | ~~ Unless required by applicable law or agreed to in writing, software 11 | ~~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~~ See the License for the specific language governing permissions and 14 | ~~ limitations under the License. 15 | 16 | Configuration Library 17 | 18 | This page contains a selection of different ways that you can configure 19 | Chainsaw to load in log events, as well as configurations for your 20 | log configuration files. 21 | 22 | Log4j2 - TCP Connection 23 | 24 | The following XML config file for Log4j2 will send JSON data to localhost 25 | on port 4449. 26 | 27 | +-- 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | +-- 42 | -------------------------------------------------------------------------------- /src/site/apt/distributionnotes.apt: -------------------------------------------------------------------------------- 1 | ~~ Licensed to the Apache Software Foundation (ASF) under one or more 2 | ~~ contributor license agreements. See the NOTICE file distributed with 3 | ~~ this work for additional information regarding copyright ownership. 4 | ~~ The ASF licenses this file to You under the Apache License, Version 2.0 5 | ~~ (the "License"); you may not use this file except in compliance with 6 | ~~ the License. You may obtain a copy of the License at 7 | ~~ 8 | ~~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~~ 10 | ~~ Unless required by applicable law or agreed to in writing, software 11 | ~~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~~ See the License for the specific language governing permissions and 14 | ~~ limitations under the License. 15 | Important Distribution Notes 16 | 17 | JMSReceiver and DBReceiver require proprietary driver jars added to the Chainsaw classpath, which we obviously can't ship. 18 | 19 | There are also additional Commons VFS filestore implementaitons which may be useful but which we don't include. For 20 | more information on Commons VFS, see http://commons.apache.org/proper/commons-vfs/download.html 21 | 22 | Place any required jars in your .chainsaw/plugins directory (the .chainsaw directory is in your home directory) 23 | 24 | Start Chainsaw, which should now recognize the existence of these components and allow you to use them. 25 | 26 | This applies to all distributions. 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/site/apt/index.apt: -------------------------------------------------------------------------------- 1 | ~~ Licensed to the Apache Software Foundation (ASF) under one or more 2 | ~~ contributor license agreements. See the NOTICE file distributed with 3 | ~~ this work for additional information regarding copyright ownership. 4 | ~~ The ASF licenses this file to You under the Apache License, Version 2.0 5 | ~~ (the "License"); you may not use this file except in compliance with 6 | ~~ the License. You may obtain a copy of the License at 7 | ~~ 8 | ~~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~~ 10 | ~~ Unless required by applicable law or agreed to in writing, software 11 | ~~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~~ See the License for the specific language governing permissions and 14 | ~~ limitations under the License. 15 | 16 | Introduction 17 | 18 | Welcome to the home of Apache Chainsaw™ v2! 19 | 20 | Chainsaw v2 is a companion application to Log4j written by members of the Log4j development 21 | community. Like a number of Open Source 22 | projects, this new version was built upon inspirations, ideas and creations of others. 23 | Chainsaw v2 has it's roots from the original Chainsaw utility written by Oliver Burn, 24 | and with inspiration from the Log Factor 5 utility contributed by ThoughtWorks Inc. 25 | 26 | 27 | 28 | Available Distributions 29 | 30 | * Standalone -.sh/.bat 31 | 32 | * OS X 'native' distribution (uses Java still, but looks like a real OSX application) 33 | 34 | Web Start support will be re-added in an upcoming release 35 | 36 | Click {{{./download.html}Download}} link for more information. 37 | 38 | So what is it really? 39 | 40 | It's a GUI-based Log viewer. A picture tells a thousand words... 41 | 42 | [images/chainsaw-1.jpg] Screenshot 43 | 44 | These screen shots were taken on Mac OS High Sierra. 45 | 46 | Rather than rely on a combination of tail/grep/vi or equivalent to view/query/trace-through 47 | a huge trail of logging events, you can use Chainsaw. 48 | 49 | Chainsaw can read local and ssh-reachable regular text log files, as well as log files formatted in Log4j's XMLLayout. Chainsaw can also 50 | receive events over TCP and UDP, read events from a DB, and can process events generated by java.util.logging. 51 | 52 | 53 | Tutorial and User Manual 54 | 55 | Chainsaw already includes help with a Quick Reference and a Tutorial to get you started, all 56 | viewable from within the GUI! 57 | 58 | 59 | Alternatives 60 | 61 | * {{{https://github.com/otros-systems/otroslogviewer}OtrosLogViewer}} is supporting different log formats (log4j, log4j2, logback, JUL) with pluginable architecture and Intellij/Eclispe integration. 62 | 63 | * {{{http://lilith.huxhorn.de}Lilith}} is a Logging and AccessEvent viewer for Log4j, Logback, and java.util.logging 64 | 65 | * {{{https://github.com/anb0s/logviewer}eclipse logviewer}} is Eclipse Plug-in for tailing log files and eclipse consoles. 66 | -------------------------------------------------------------------------------- /src/site/apt/roadmap.apt: -------------------------------------------------------------------------------- 1 | ~~ Licensed to the Apache Software Foundation (ASF) under one or more 2 | ~~ contributor license agreements. See the NOTICE file distributed with 3 | ~~ this work for additional information regarding copyright ownership. 4 | ~~ The ASF licenses this file to You under the Apache License, Version 2.0 5 | ~~ (the "License"); you may not use this file except in compliance with 6 | ~~ the License. You may obtain a copy of the License at 7 | ~~ 8 | ~~ http://www.apache.org/licenses/LICENSE-2.0 9 | ~~ 10 | ~~ Unless required by applicable law or agreed to in writing, software 11 | ~~ distributed under the License is distributed on an "AS IS" BASIS, 12 | ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ~~ See the License for the specific language governing permissions and 14 | ~~ limitations under the License. 15 | ------ 16 | Apache Chainsaw Roadmap 17 | ------ 18 | ------ 19 | ------ 20 | 21 | Apache Chainsaw™ Roadmap 22 | 23 | TODO 24 | -------------------------------------------------------------------------------- /src/site/resources/css/site.css: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one or more 3 | contributor license agreements. See the NOTICE file distributed with 4 | this work for additional information regarding copyright ownership. 5 | The ASF licenses this file to You under the Apache License, Version 2.0 6 | (the "License"); you may not use this file except in compliance with 7 | the License. You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | */ 18 | 19 | -------------------------------------------------------------------------------- /src/site/resources/images/chainsaw-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/chainsaw-1.jpg -------------------------------------------------------------------------------- /src/site/resources/images/chainsaw-configure-json.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/chainsaw-configure-json.png -------------------------------------------------------------------------------- /src/site/resources/images/chainsaw-log-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/chainsaw-log-panel.png -------------------------------------------------------------------------------- /src/site/resources/images/chainsaw-new-receiver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/chainsaw-new-receiver.png -------------------------------------------------------------------------------- /src/site/resources/images/chainsaw-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/chainsaw-overview.png -------------------------------------------------------------------------------- /src/site/resources/images/chainsaw-with-events.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/chainsaw-with-events.png -------------------------------------------------------------------------------- /src/site/resources/images/chainsaw-with-receiver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/chainsaw-with-receiver.png -------------------------------------------------------------------------------- /src/site/resources/images/chainsaw-with-receivers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/chainsaw-with-receivers.png -------------------------------------------------------------------------------- /src/site/resources/images/color-menu-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/color-menu-bar.png -------------------------------------------------------------------------------- /src/site/resources/images/color-menu-click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/color-menu-click.png -------------------------------------------------------------------------------- /src/site/resources/images/color-selection-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/color-selection-menu.png -------------------------------------------------------------------------------- /src/site/resources/images/details-pane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/details-pane.png -------------------------------------------------------------------------------- /src/site/resources/images/log-pane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/log-pane.png -------------------------------------------------------------------------------- /src/site/resources/images/logger-pane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/logger-pane.png -------------------------------------------------------------------------------- /src/site/resources/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/logo.png -------------------------------------------------------------------------------- /src/site/resources/images/ls-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/logging-chainsaw/4e0d5a6aa0241ecf85bdca2f960ca8ca09ae4ccb/src/site/resources/images/ls-logo.jpg -------------------------------------------------------------------------------- /src/test/resources/org/apache/log4j/db/append-with-drivermanager1.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/test/resources/org/apache/log4j/db/read-with-drivermanager1.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/test/resources/org/apache/log4j/rewrite/map.log: -------------------------------------------------------------------------------- 1 | INFO org.apache.log4j.rewrite.RewriteAppenderTest - p1: p2: Message 0 2 | INFO org.apache.log4j.rewrite.RewriteAppenderTest - p1:Hello p2:World {p1=Hello, p2=World, x1=Mundo} 3 | INFO org.apache.log4j.rewrite.RewriteAppenderTest - p1:Hello p2:World Message 1 4 | -------------------------------------------------------------------------------- /src/test/resources/org/apache/log4j/rewrite/map.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/test/resources/org/apache/log4j/rewrite/property.log: -------------------------------------------------------------------------------- 1 | INFO org.apache.log4j.rewrite.RewriteAppenderTest - p1:Hello p2:World Message 0 2 | INFO org.apache.log4j.rewrite.RewriteAppenderTest - p1:Hola p2:World Message 1 3 | -------------------------------------------------------------------------------- /src/test/resources/org/apache/log4j/rewrite/property.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/test/resources/org/apache/log4j/rewrite/reflection.log: -------------------------------------------------------------------------------- 1 | INFO org.apache.log4j.rewrite.RewriteAppenderTest - p1: p2: Message 0 2 | INFO org.apache.log4j.rewrite.RewriteAppenderTest - p1: p2:Hello I am bean. 3 | INFO org.apache.log4j.rewrite.RewriteAppenderTest - p1:Hola p2:Hello Welcome to The Hub 4 | -------------------------------------------------------------------------------- /src/test/resources/org/apache/log4j/rewrite/reflection.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | --------------------------------------------------------------------------------