You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2021/12/23 16:25:16 UTC
[logging-log4j1] 01/01: This commit was manufactured by cvs2svn to create tag 'CORE_VERSION'.
This is an automated email from the ASF dual-hosted git repository.
rgoers pushed a commit to annotated tag CORE_VERSION
in repository https://gitbox.apache.org/repos/asf/logging-log4j1.git
commit 61a6749932e85286950e033750ad7cce8c0bb105
Author: No Author <de...@apache.org>
AuthorDate: Thu Jan 27 17:33:56 2005 +0000
This commit was manufactured by cvs2svn to create tag 'CORE_VERSION'.
git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/tags/CORE_VERSION@311249 13f79535-47bb-0310-9956-ffa450edef68
---
.cvsignore | 26 -
BRANCHES | 61 -
HOWTOBUILD.txt | 31 -
INSTALL.txt | 175 --
LICENSE.txt | 202 --
NOTICE.txt | 7 -
build-chainsaw.xml | 213 --
build.properties.sample | 71 -
build.xml | 752 ------
contribs/CONTENTS | 101 -
contribs/CekiGulcu/AppenderTable.java | 240 --
contribs/CekiGulcu/Transform.java | 206 --
contribs/EirikLygre/DailyFileAppender1.java | 232 --
contribs/EirikLygre/mail-2001-01-18 | 27 -
contribs/JamesHouse/LogTextPanel.java | 182 --
contribs/JamesHouse/LogTextPanelExample.java | 116 -
contribs/JamesHouse/TextPanelAppender.java | 201 --
contribs/JamesHouse/mail-2001-01-23 | 70 -
contribs/Jamie Tsao/JMSQueueAppender.java | 225 --
contribs/Jamie Tsao/mail-2001-06-20 | 11 -
contribs/JayFunnell/NetSendAppender.cpp | 67 -
contribs/JayFunnell/NetSendAppender.dll | Bin 45056 -> 0 bytes
contribs/JayFunnell/NetSendAppender.java | 180 --
contribs/JayFunnell/NetSendAppender.txt | 66 -
contribs/JimMoore/LoggingOutputStream.java | 201 --
contribs/JimMoore/mail-2001-03-12T1326 | 39 -
contribs/JimMoore/mail-2001-03-12T1454 | 112 -
contribs/JimMoore/mail-2001-03-13T0646 | 214 --
contribs/KevinSteppe/CompositeRollingAppender.java | 698 -----
contribs/KevinSteppe/JDBCTest.java | 81 -
contribs/KevinSteppe/mail-2001-02-01 | 542 ----
contribs/KevinSteppe/mail-2002-03-27.txt | 101 -
contribs/KitchingSimon/DatagramStringAppender.java | 274 --
contribs/KitchingSimon/DatagramStringWriter.java | 164 --
.../KitchingSimon/SingleLineTracerPrintWriter.java | 57 -
contribs/KitchingSimon/logconfig.xml | 42 -
contribs/KitchingSimon/mail-2001-02-07 | 88 -
contribs/KitchingSimon/udpserver.pl | 67 -
contribs/LeosLiterak/TempFileAppender.java | 178 --
contribs/LeosLiterak/mail | 41 -
contribs/MarkDouglas/Log.txt | 17 -
contribs/MarkDouglas/SocketNode2.java | 102 -
contribs/MarkDouglas/SocketServer2.java | 83 -
contribs/MarkDouglas/mail-2001-01-17 | 50 -
contribs/SvenReimers/gui/JListView.java | 355 ---
contribs/SvenReimers/gui/JTableAppender.java | 227 --
contribs/SvenReimers/gui/TextPaneAppender.java | 345 ---
.../gui/examples/TextPaneAppenderExample.java | 101 -
contribs/ThomasFenner/JDBCAppender.java | 589 -----
contribs/ThomasFenner/JDBCConnectionHandler.java | 26 -
contribs/ThomasFenner/JDBCIDHandler.java | 23 -
contribs/ThomasFenner/JDBCLogger.java | 456 ----
contribs/ThomasFenner/Log4JTest.java | 255 --
contribs/ThomasFenner/code_example1.java | 37 -
contribs/ThomasFenner/code_example2.java | 113 -
contribs/ThomasFenner/configfile_example.txt | 35 -
contribs/VolkerMentzner/HTTPRequestHandler.java | 59 -
contribs/VolkerMentzner/Log4jRequestHandler.java | 161 --
contribs/VolkerMentzner/PluggableHTTPServer.java | 246 --
contribs/VolkerMentzner/RootRequestHandler.java | 143 -
.../VolkerMentzner/UserDialogRequestHandler.java | 119 -
contribs/VolkerMentzner/mail-03-05-2001 | 24 -
docs/.cvsignore | 15 -
docs/HISTORY.txt | 1846 -------------
docs/TROUBLESHOOT.html | 301 ---
docs/chainsaw-1.jpg | Bin 157864 -> 0 bytes
docs/chainsaw.html | 190 --
docs/codes.html | 278 --
docs/contactUs.html | 186 --
docs/contributors.html | 270 --
docs/css/.cvsignore | 1 -
docs/css/README.txt | 10 -
docs/css/eventTable-1.0.css | 76 -
docs/css/site.css | 139 -
docs/documentation.html | 279 --
docs/download.html | 450 ----
docs/earlier.html | 131 -
docs/faq.html | 1146 --------
docs/history.html | 148 --
docs/images/ceki-72x101.gif | Bin 7712 -> 0 bytes
docs/images/chainsaw-fullscreen-small.jpg | Bin 55917 -> 0 bytes
docs/images/chainsaw-fullscreen.jpg | Bin 208947 -> 0 bytes
docs/images/coverSmall.png | Bin 57875 -> 0 bytes
docs/images/cyberlab15.gif | Bin 238 -> 0 bytes
docs/images/ecaward_finalist_logo.gif | Bin 3015 -> 0 bytes
docs/images/logo.jpg | Bin 8184 -> 0 bytes
docs/images/mark-72x99.gif | Bin 2206 -> 0 bytes
docs/images/psmith.jpg | Bin 8052 -> 0 bytes
docs/images/yshapira.bmp | Bin 31514 -> 0 bytes
docs/index.html | 169 --
docs/install-chainsaw.html | 121 -
docs/manual.html | 1216 ---------
docs/od.gif | Bin 5741 -> 0 bytes
docs/overview.html | 11 -
docs/plan.html | 354 ---
docs/praise.html | 266 --
docs/ugli.html | 267 --
examples/.cvsignore | 2 -
examples/src/customLevel/XLevel.java | 73 -
examples/src/factor/NumberCruncher.java | 21 -
examples/src/factor/NumberCruncherClient.java | 97 -
examples/src/factor/NumberCruncherServer.java | 172 --
examples/src/factor/factor.html | 66 -
examples/src/factor/factor.lcf | 27 -
examples/src/joran/calculator/AddAction.java | 77 -
examples/src/joran/calculator/Calculator1.java | 85 -
examples/src/joran/calculator/Calculator2.java | 75 -
.../src/joran/calculator/ComputationAction1.java | 62 -
.../src/joran/calculator/ComputationAction2.java | 89 -
examples/src/joran/calculator/LiteralAction.java | 67 -
examples/src/joran/calculator/MultiplyAction.java | 77 -
examples/src/joran/calculator/calculator1.xml | 6 -
examples/src/joran/calculator/calculator2.xml | 10 -
examples/src/joran/calculator/calculator3.xml | 18 -
examples/src/joran/helloWorld/HelloWorld.java | 63 -
.../src/joran/helloWorld/HelloWorldAction.java | 40 -
examples/src/joran/helloWorld/hello.xml | 5 -
examples/src/joran/implicit/NOPAction.java | 39 -
examples/src/joran/implicit/PrintMe.java | 82 -
.../src/joran/implicit/PrintMeImplicitAction.java | 50 -
examples/src/joran/implicit/implicit1.xml | 24 -
examples/src/joran/newRule/NewRuleCalculator.java | 85 -
examples/src/objectBased/Base.java | 44 -
examples/src/objectBased/ChildOne.java | 32 -
examples/src/objectBased/ChildTwo.java | 32 -
examples/src/objectBased/Test.java | 39 -
examples/src/package.html | 37 -
examples/src/pattern/CountingPatternConverter.java | 51 -
examples/src/pattern/LearnNewWord.java | 53 -
examples/src/pattern/log4j-config.xml | 19 -
examples/src/sort/Sort.java | 97 -
examples/src/sort/SortAlgo.java | 86 -
examples/src/sort/sort1.properties | 26 -
examples/src/sort/sort2.properties | 55 -
examples/src/sort/sort3.properties | 32 -
examples/src/sort/sort4.properties | 32 -
examples/src/subclass/MyLogger.java | 62 -
examples/src/subclass/MyLoggerFactory.java | 33 -
examples/src/subclass/MyLoggerTest.java | 77 -
examples/src/subclass/mycat.bad | 18 -
examples/src/subclass/mycat.good | 24 -
examples/src/trivial/Trivial.java | 75 -
examples/tiny-webapp/Hello/.cvsignore | 2 -
examples/tiny-webapp/Hello/README.txt | 12 -
.../Hello/WebRoot/WEB-INF/classes/.cvsignore | 1 -
.../Hello/WebRoot/WEB-INF/classes/hello-log4j.xml | 19 -
examples/tiny-webapp/Hello/WebRoot/WEB-INF/web.xml | 42 -
examples/tiny-webapp/Hello/WebRoot/index.html | 11 -
examples/tiny-webapp/Hello/build.properties.sample | 10 -
examples/tiny-webapp/Hello/build.xml | 54 -
.../Hello/src/java/wombat/HelloServlet.java | 33 -
.../Hello/src/java/wombat/InitServlet.java | 19 -
examples/tiny-webapp/INSTALL.txt | 163 --
examples/tiny-webapp/Tata/.cvsignore | 3 -
examples/tiny-webapp/Tata/README.txt | 12 -
.../Tata/WebRoot/WEB-INF/classes/.cvsignore | 1 -
.../Tata/WebRoot/WEB-INF/classes/tata-log4j.xml | 18 -
examples/tiny-webapp/Tata/WebRoot/WEB-INF/web.xml | 41 -
examples/tiny-webapp/Tata/WebRoot/index.html | 11 -
examples/tiny-webapp/Tata/build.properties.sample | 14 -
examples/tiny-webapp/Tata/build.xml | 54 -
.../Tata/src/java/wombat/InitServlet.java | 19 -
.../Tata/src/java/wombat/TataServlet.java | 33 -
log4jMini/build.xml | 221 --
log4jMini/docs/.cvsignore | 1 -
log4jMini/docs/index.html | 25 -
log4jMini/docs/overview.html | 61 -
log4jMini/src/java/org/apache/log4j/Appender.java | 65 -
.../java/org/apache/log4j/AppenderSkeleton.java | 223 --
log4jMini/src/java/org/apache/log4j/Category.java | 646 -----
.../src/java/org/apache/log4j/CategoryKey.java | 41 -
.../src/java/org/apache/log4j/FileAppender.java | 404 ---
log4jMini/src/java/org/apache/log4j/Hierarchy.java | 260 --
log4jMini/src/java/org/apache/log4j/Layout.java | 46 -
log4jMini/src/java/org/apache/log4j/NDC.java | 416 ---
.../src/java/org/apache/log4j/PatternLayout.java | 496 ----
log4jMini/src/java/org/apache/log4j/Priority.java | 176 --
.../org/apache/log4j/PropertyConfigurator.java | 476 ----
.../src/java/org/apache/log4j/ProvisionNode.java | 18 -
.../src/java/org/apache/log4j/StressCategory.java | 241 --
.../src/java/org/apache/log4j/WriterAppender.java | 211 --
.../src/java/org/apache/log4j/examples/.cvsignore | 1 -
.../src/java/org/apache/log4j/examples/Makefile | 14 -
.../src/java/org/apache/log4j/examples/Sort.java | 85 -
.../java/org/apache/log4j/examples/SortAlgo.java | 72 -
.../java/org/apache/log4j/examples/Trivial.java | 64 -
.../src/java/org/apache/log4j/examples/sort1.lcf | 32 -
.../src/java/org/apache/log4j/examples/sort2.lcf | 39 -
.../src/java/org/apache/log4j/examples/sort3.lcf | 38 -
.../org/apache/log4j/helpers/FormattingInfo.java | 32 -
.../src/java/org/apache/log4j/helpers/LogLog.java | 164 --
.../org/apache/log4j/helpers/OptionConverter.java | 71 -
.../org/apache/log4j/helpers/PatternConverter.java | 101 -
.../org/apache/log4j/helpers/PatternParser.java | 360 ---
log4jMini/src/java/org/apache/log4j/package.html | 11 -
.../java/org/apache/log4j/spi/LoggingEvent.java | 175 --
.../java/org/apache/log4j/spi/OptionHandler.java | 30 -
.../java/org/apache/log4j/spi/RootCategory.java | 59 -
.../src/java/org/apache/log4j/test/.cvsignore | 5 -
.../src/java/org/apache/log4j/test/.functions | 63 -
.../log4j/test/ConfigurationFileParsing.java | 46 -
.../src/java/org/apache/log4j/test/Hello.java | 36 -
log4jMini/src/java/org/apache/log4j/test/Min.java | 135 -
.../src/java/org/apache/log4j/test/Shallow.java | 62 -
.../src/java/org/apache/log4j/test/confParsing | 95 -
log4jMini/src/java/org/apache/log4j/test/hello | 20 -
log4jMini/src/java/org/apache/log4j/test/min | 59 -
log4jMini/src/java/org/apache/log4j/test/shallow | 54 -
.../org/apache/log4j/test/witness/confParsing.1 | 4 -
.../src/java/org/apache/log4j/test/witness/hello | 2 -
.../src/java/org/apache/log4j/test/witness/min.1 | 27 -
.../src/java/org/apache/log4j/test/witness/min.2 | 27 -
.../java/org/apache/log4j/test/witness/shallow.1 | 21 -
packaging/.functions | 40 -
packaging/install | 189 --
packaging/package-list | 59 -
packaging/tarmake | 72 -
src/chainsaw.bat | 2 -
src/chainsawWebStart.jnlp | 28 -
src/java/org/apache/log4j/Appender.java | 120 -
src/java/org/apache/log4j/AppenderSkeleton.java | 294 ---
src/java/org/apache/log4j/AsyncAppender.java | 331 ---
src/java/org/apache/log4j/BasicConfigurator.java | 66 -
src/java/org/apache/log4j/Category.java | 1445 -----------
src/java/org/apache/log4j/CategoryKey.java | 48 -
src/java/org/apache/log4j/ConsoleAppender.java | 96 -
.../org/apache/log4j/DefaultCategoryFactory.java | 29 -
src/java/org/apache/log4j/FileAppender.java | 273 --
src/java/org/apache/log4j/Hierarchy.java | 809 ------
src/java/org/apache/log4j/Layout.java | 141 -
src/java/org/apache/log4j/Level.java | 336 ---
src/java/org/apache/log4j/LogManager.java | 232 --
src/java/org/apache/log4j/Logger.java | 229 --
src/java/org/apache/log4j/MDC.java | 143 -
src/java/org/apache/log4j/NDC.java | 329 ---
src/java/org/apache/log4j/PatternLayout.java | 494 ----
src/java/org/apache/log4j/Priority.java | 102 -
.../org/apache/log4j/PropertyConfigurator.java | 718 -----
src/java/org/apache/log4j/ProvisionNode.java | 27 -
src/java/org/apache/log4j/SimpleLayout.java | 64 -
src/java/org/apache/log4j/TTCCLayout.java | 211 --
src/java/org/apache/log4j/WriterAppender.java | 376 ---
.../log4j/chainsaw/AbstractPreferencePanel.java | 206 --
.../log4j/chainsaw/ApplicationPreferenceModel.java | 410 ---
.../chainsaw/ApplicationPreferenceModelPanel.java | 639 -----
.../org/apache/log4j/chainsaw/BasicPrefPanel.java | 39 -
.../org/apache/log4j/chainsaw/ChainsawAbout.java | 108 -
.../apache/log4j/chainsaw/ChainsawAppender.java | 175 --
.../log4j/chainsaw/ChainsawAppenderHandler.java | 344 ---
.../org/apache/log4j/chainsaw/ChainsawColumns.java | 88 -
.../apache/log4j/chainsaw/ChainsawConstants.java | 88 -
.../chainsaw/ChainsawCyclicBufferTableModel.java | 707 -----
.../apache/log4j/chainsaw/ChainsawEventBatch.java | 76 -
.../org/apache/log4j/chainsaw/ChainsawSplash.java | 92 -
.../apache/log4j/chainsaw/ChainsawStatusBar.java | 280 --
.../apache/log4j/chainsaw/ChainsawTabbedPane.java | 107 -
.../log4j/chainsaw/ChainsawToolBarAndMenus.java | 898 -------
.../org/apache/log4j/chainsaw/ChainsawViewer.java | 32 -
.../log4j/chainsaw/CheckListCellRenderer.java | 64 -
.../apache/log4j/chainsaw/ColumnComparator.java | 176 --
.../org/apache/log4j/chainsaw/CommonActions.java | 54 -
.../apache/log4j/chainsaw/CyclicBufferList.java | 219 --
.../log4j/chainsaw/Details_SocketHubReceiver.html | 13 -
.../log4j/chainsaw/Details_SocketReceiver.html | 17 -
.../apache/log4j/chainsaw/Details_UDPReceiver.html | 8 -
.../log4j/chainsaw/Details_XMLSocketReceiver.html | 21 -
.../org/apache/log4j/chainsaw/DockablePanel.java | 40 -
.../apache/log4j/chainsaw/EventBatchListener.java | 47 -
.../org/apache/log4j/chainsaw/EventContainer.java | 161 --
.../apache/log4j/chainsaw/EventCountListener.java | 29 -
.../log4j/chainsaw/ExpressionRuleContext.java | 302 ---
.../org/apache/log4j/chainsaw/FileLoadAction.java | 163 --
src/java/org/apache/log4j/chainsaw/FileMenu.java | 133 -
.../org/apache/log4j/chainsaw/FileSaveAction.java | 122 -
src/java/org/apache/log4j/chainsaw/Generator.java | 130 -
.../apache/log4j/chainsaw/GeneratorBeanInfo.java | 43 -
src/java/org/apache/log4j/chainsaw/JSortTable.java | 167 --
src/java/org/apache/log4j/chainsaw/LogPanel.java | 2743 --------------------
.../log4j/chainsaw/LogPanelLoggerTreeModel.java | 200 --
.../log4j/chainsaw/LogPanelPreferenceModel.java | 318 ---
.../log4j/chainsaw/LogPanelPreferencePanel.java | 641 -----
src/java/org/apache/log4j/chainsaw/LogUI.java | 2000 --------------
.../apache/log4j/chainsaw/LoggerNameListener.java | 35 -
.../org/apache/log4j/chainsaw/LoggerNameModel.java | 54 -
.../log4j/chainsaw/LoggerNameModelSupport.java | 90 -
.../org/apache/log4j/chainsaw/LoggerNameTree.java | 52 -
.../apache/log4j/chainsaw/LoggerNameTreePanel.java | 1374 ----------
.../apache/log4j/chainsaw/ModifiableListModel.java | 20 -
.../org/apache/log4j/chainsaw/NewKeyEvent.java | 65 -
.../org/apache/log4j/chainsaw/NewKeyListener.java | 34 -
.../log4j/chainsaw/NoReceiversWarningPanel.java | 592 -----
.../org/apache/log4j/chainsaw/PopupListener.java | 59 -
.../org/apache/log4j/chainsaw/ProgressPanel.java | 78 -
.../org/apache/log4j/chainsaw/RuleMediator.java | 175 --
.../apache/log4j/chainsaw/ShutdownListener.java | 37 -
.../org/apache/log4j/chainsaw/SmallButton.java | 130 -
.../apache/log4j/chainsaw/SmallToggleButton.java | 139 -
.../org/apache/log4j/chainsaw/SortArrowIcon.java | 74 -
.../apache/log4j/chainsaw/SortHeaderRenderer.java | 77 -
.../org/apache/log4j/chainsaw/SortTableModel.java | 35 -
.../log4j/chainsaw/TableColorizingRenderer.java | 242 --
.../org/apache/log4j/chainsaw/ThresholdSlider.java | 113 -
.../log4j/chainsaw/ThrowableRenderPanel.java | 107 -
.../org/apache/log4j/chainsaw/WelcomePanel.html | 109 -
.../org/apache/log4j/chainsaw/WelcomePanel.java | 161 --
.../apache/log4j/chainsaw/color/ColorPanel.java | 808 ------
.../org/apache/log4j/chainsaw/color/Colorizer.java | 43 -
.../apache/log4j/chainsaw/color/RuleColorizer.java | 204 --
.../apache/log4j/chainsaw/dnd/FileDnDTarget.java | 194 --
.../apache/log4j/chainsaw/doc-files/Chainsawv2.gif | Bin 80767 -> 0 bytes
.../log4j/chainsaw/favourites/Favourite.java | 45 -
.../chainsaw/favourites/FavouritesRegistry.java | 81 -
.../apache/log4j/chainsaw/favourites/package.html | 19 -
.../chainsaw/filter/EventTypeEntryContainer.java | 169 --
.../apache/log4j/chainsaw/filter/FilterModel.java | 53 -
.../apache/log4j/chainsaw/help/HelpLocator.java | 133 -
.../apache/log4j/chainsaw/help/HelpManager.java | 205 --
.../org/apache/log4j/chainsaw/help/Tutorial.java | 49 -
.../apache/log4j/chainsaw/help/release-notes.html | 249 --
.../org/apache/log4j/chainsaw/help/tutorial.html | 245 --
.../log4j/chainsaw/helper/OkCancelPanel.java | 52 -
.../apache/log4j/chainsaw/helper/SwingHelper.java | 75 -
.../chainsaw/helper/TableCellEditorFactory.java | 46 -
.../org/apache/log4j/chainsaw/icons/About16.gif | Bin 644 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/About24.gif | Bin 797 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Back16.gif | Bin 183 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Back24.gif | Bin 422 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Bean16.gif | Bin 319 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Bean24.gif | Bin 737 -> 0 bytes
.../apache/log4j/chainsaw/icons/ChainsawIcons.java | 163 --
.../org/apache/log4j/chainsaw/icons/Copy16.gif | Bin 288 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Copy24.gif | Bin 682 -> 0 bytes
src/java/org/apache/log4j/chainsaw/icons/Cut16.gif | Bin 652 -> 0 bytes
src/java/org/apache/log4j/chainsaw/icons/Cut24.gif | Bin 1193 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Delete16.gif | Bin 208 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Delete24.gif | Bin 249 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Down16.gif | Bin 102 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Edit16.gif | Bin 441 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Edit24.gif | Bin 1244 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Export16.gif | Bin 309 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Export24.gif | Bin 473 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Find16.gif | Bin 434 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Find24.gif | Bin 1250 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Forward16.gif | Bin 183 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Forward24.gif | Bin 434 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Help16.gif | Bin 661 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Help24.gif | Bin 1328 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Home16.gif | Bin 420 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Home24.gif | Bin 1190 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Host16.gif | Bin 636 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Host24.gif | Bin 775 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Import16.gif | Bin 311 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Import24.gif | Bin 473 -> 0 bytes
.../apache/log4j/chainsaw/icons/Information16.gif | Bin 661 -> 0 bytes
.../apache/log4j/chainsaw/icons/Information24.gif | Bin 1328 -> 0 bytes
src/java/org/apache/log4j/chainsaw/icons/LICENSE | 10 -
.../log4j/chainsaw/icons/LevelIconFactory.java | 74 -
.../log4j/chainsaw/icons/LineIconFactory.java | 181 --
src/java/org/apache/log4j/chainsaw/icons/New16.gif | Bin 426 -> 0 bytes
src/java/org/apache/log4j/chainsaw/icons/New24.gif | Bin 778 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Open16.gif | Bin 228 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Open24.gif | Bin 462 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Pause16.gif | Bin 192 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Pause24.gif | Bin 272 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Play16.gif | Bin 186 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Play24.gif | Bin 247 -> 0 bytes
.../apache/log4j/chainsaw/icons/Preferences16.gif | Bin 207 -> 0 bytes
.../apache/log4j/chainsaw/icons/Preferences24.gif | Bin 240 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Redo16.gif | Bin 201 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Redo24.gif | Bin 243 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Refresh16.gif | Bin 244 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Refresh24.gif | Bin 316 -> 0 bytes
.../log4j/chainsaw/icons/RowInsertAfter16.gif | Bin 238 -> 0 bytes
.../log4j/chainsaw/icons/RowInsertAfter24.gif | Bin 239 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/SaveAs16.gif | Bin 255 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/SaveAs24.gif | Bin 348 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Server16.gif | Bin 636 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Server24.gif | Bin 775 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Stop16.gif | Bin 410 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Stop24.gif | Bin 777 -> 0 bytes
.../apache/log4j/chainsaw/icons/TipOfTheDay16.gif | Bin 423 -> 0 bytes
.../apache/log4j/chainsaw/icons/TipOfTheDay24.gif | Bin 742 -> 0 bytes
src/java/org/apache/log4j/chainsaw/icons/Up16.gif | Bin 101 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Zoom16.gif | Bin 303 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/Zoom24.gif | Bin 485 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/ZoomIn16.gif | Bin 304 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/ZoomIn24.gif | Bin 484 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/ZoomOut16.gif | Bin 304 -> 0 bytes
.../org/apache/log4j/chainsaw/icons/ZoomOut24.gif | Bin 477 -> 0 bytes
.../chainsaw/icons/channelexplorer_satellite.gif | Bin 256 -> 0 bytes
.../log4j/chainsaw/layout/DefaultDetailLayout.html | 14 -
.../chainsaw/layout/DefaultLayoutFactory.java | 77 -
.../log4j/chainsaw/layout/EventDetailLayout.java | 275 --
.../log4j/chainsaw/layout/LayoutEditorPane.java | 267 --
.../log4j/chainsaw/log4j-receiver-sample.xml | 51 -
src/java/org/apache/log4j/chainsaw/logo.jpg | Bin 8184 -> 0 bytes
.../log4j/chainsaw/messages/MessageCenter.java | 256 --
src/java/org/apache/log4j/chainsaw/package.html | 76 -
.../log4j/chainsaw/plugins/GUIPluginSkeleton.java | 99 -
.../chainsaw/plugins/PluginClassLoaderFactory.java | 99 -
.../chainsaw/prefs/AbstractSettingsEvent.java | 29 -
.../log4j/chainsaw/prefs/LoadSettingsEvent.java | 79 -
.../log4j/chainsaw/prefs/ProfileManager.java | 33 -
.../apache/log4j/chainsaw/prefs/Profileable.java | 28 -
.../log4j/chainsaw/prefs/SaveSettingsEvent.java | 62 -
.../apache/log4j/chainsaw/prefs/SettingsEvent.java | 29 -
.../log4j/chainsaw/prefs/SettingsListener.java | 54 -
.../log4j/chainsaw/prefs/SettingsManager.java | 357 ---
.../apache/log4j/chainsaw/prefs/default.properties | 43 -
.../chainsaw/receivers/NewReceiverDialogPanel.java | 202 --
.../receivers/PluginPropertyEditorPanel.java | 399 ---
.../receivers/ReceiverTreeCellRenderer.java | 112 -
.../log4j/chainsaw/receivers/ReceiversHelper.java | 109 -
.../log4j/chainsaw/receivers/ReceiversPanel.java | 838 ------
.../chainsaw/receivers/ReceiversTreeModel.java | 188 --
.../log4j/chainsaw/receivers/known.receivers | 12 -
src/java/org/apache/log4j/chainsaw/stylesheet.css | 26 -
.../log4j/chainsaw/version/VersionManager.java | 30 -
.../chainsaw/vfs/DirectoryListTableModel.java | 238 --
.../apache/log4j/chainsaw/vfs/FileObjectTable.java | 100 -
.../log4j/chainsaw/vfs/FileSystemTreePanel.java | 136 -
.../apache/log4j/chainsaw/vfs/PreviewPanel.java | 103 -
.../chainsaw/vfs/VFSLogFilePatternReceiver.java | 161 --
.../org/apache/log4j/chainsaw/vfs/VFSNode.java | 41 -
.../org/apache/log4j/chainsaw/vfs/VFSPlugin.java | 513 ----
.../chainsaw/vfs/VFSPluginPreferenceModel.java | 42 -
.../org/apache/log4j/chainsaw/vfs/VFSUtils.java | 25 -
src/java/org/apache/log4j/concurrency.txt | 30 -
.../org/apache/log4j/config/ConfigWatchdog.java | 98 -
.../org/apache/log4j/config/ConfiguratorBase.java | 141 -
.../org/apache/log4j/config/PropertyGetter.java | 92 -
.../org/apache/log4j/config/PropertyPrinter.java | 142 -
.../org/apache/log4j/config/PropertySetter.java | 388 ---
.../log4j/config/PropertySetterException.java | 43 -
src/java/org/apache/log4j/config/package.html | 6 -
src/java/org/apache/log4j/db/ConnectionSource.java | 68 -
.../apache/log4j/db/ConnectionSourceSkeleton.java | 109 -
.../org/apache/log4j/db/CustomSQLDBReceiver.java | 438 ----
src/java/org/apache/log4j/db/DBAppender.java | 322 ---
src/java/org/apache/log4j/db/DBAppender2.java | 328 ---
src/java/org/apache/log4j/db/DBHelper.java | 67 -
src/java/org/apache/log4j/db/DBReceiver.java | 115 -
src/java/org/apache/log4j/db/DBReceiverJob.java | 229 --
.../log4j/db/DataSourceConnectionSource.java | 85 -
.../log4j/db/DriverManagerConnectionSource.java | 132 -
.../org/apache/log4j/db/JNDIConnectionSource.java | 156 --
.../org/apache/log4j/db/dialect/HSQLDBDialect.java | 30 -
.../org/apache/log4j/db/dialect/MsSQLDialect.java | 33 -
.../org/apache/log4j/db/dialect/MySQLDialect.java | 31 -
.../org/apache/log4j/db/dialect/OracleDialect.java | 32 -
.../apache/log4j/db/dialect/PostgreSQLDialect.java | 34 -
.../org/apache/log4j/db/dialect/SQLDialect.java | 26 -
src/java/org/apache/log4j/db/dialect/Util.java | 122 -
src/java/org/apache/log4j/db/dialect/db2.sql | 49 -
src/java/org/apache/log4j/db/dialect/db2l.sql | 47 -
src/java/org/apache/log4j/db/dialect/hsqldb.sql | 43 -
src/java/org/apache/log4j/db/dialect/mssql.sql | 45 -
src/java/org/apache/log4j/db/dialect/mysql.sql | 54 -
src/java/org/apache/log4j/db/dialect/oracle.sql | 67 -
.../org/apache/log4j/db/dialect/postgresql.sql | 48 -
src/java/org/apache/log4j/db/package.html | 20 -
src/java/org/apache/log4j/filter/AndFilter.java | 111 -
.../org/apache/log4j/filter/DenyAllFilter.java | 63 -
.../org/apache/log4j/filter/ExpressionFilter.java | 111 -
.../org/apache/log4j/filter/LevelMatchFilter.java | 99 -
.../org/apache/log4j/filter/LevelRangeFilter.java | 134 -
.../apache/log4j/filter/LocationInfoFilter.java | 85 -
src/java/org/apache/log4j/filter/MapFilter.java | 61 -
.../org/apache/log4j/filter/PropertyFilter.java | 75 -
.../org/apache/log4j/filter/ReflectionFilter.java | 81 -
.../org/apache/log4j/filter/StringMatchFilter.java | 75 -
.../log4j/helpers/AppenderAttachableImpl.java | 185 --
src/java/org/apache/log4j/helpers/BoundedFIFO.java | 172 --
src/java/org/apache/log4j/helpers/Constants.java | 67 -
.../org/apache/log4j/helpers/CyclicBuffer.java | 150 --
.../org/apache/log4j/helpers/FileWatchdog.java | 107 -
.../apache/log4j/helpers/IntializationUtil.java | 133 -
src/java/org/apache/log4j/helpers/JNDIUtil.java | 44 -
src/java/org/apache/log4j/helpers/Loader.java | 166 --
src/java/org/apache/log4j/helpers/LogLog.java | 170 --
.../org/apache/log4j/helpers/LoggerTraverse.java | 329 ---
.../org/apache/log4j/helpers/NullEnumeration.java | 41 -
src/java/org/apache/log4j/helpers/Option.java | 30 -
.../org/apache/log4j/helpers/OptionConverter.java | 539 ----
.../org/apache/log4j/helpers/PlatformInfo.java | 86 -
.../org/apache/log4j/helpers/ReaderWriterLock.java | 129 -
.../log4j/helpers/RelativeTimeDateFormat.java | 72 -
.../org/apache/log4j/helpers/SyslogWriter.java | 91 -
.../org/apache/log4j/helpers/ThreadLocalMap.java | 31 -
src/java/org/apache/log4j/helpers/Transform.java | 114 -
.../org/apache/log4j/helpers/UtilLoggingLevel.java | 145 --
src/java/org/apache/log4j/helpers/package.html | 16 -
src/java/org/apache/log4j/html/HTMLLayout.java | 375 ---
.../org/apache/log4j/joran/JoranConfigurator.java | 246 --
src/java/org/apache/log4j/joran/action/Action.java | 82 -
.../org/apache/log4j/joran/action/ActionConst.java | 27 -
.../apache/log4j/joran/action/AppenderAction.java | 119 -
.../log4j/joran/action/AppenderRefAction.java | 104 -
.../log4j/joran/action/ConfigurationAction.java | 55 -
.../log4j/joran/action/ConversionRuleAction.java | 101 -
.../apache/log4j/joran/action/ImplicitAction.java | 50 -
.../action/JndiSubstitutionPropertyAction.java | 121 -
.../apache/log4j/joran/action/LayoutAction.java | 103 -
.../org/apache/log4j/joran/action/LevelAction.java | 84 -
.../apache/log4j/joran/action/LoggerAction.java | 109 -
.../apache/log4j/joran/action/NestComponentIA.java | 184 --
.../apache/log4j/joran/action/NewRuleAction.java | 77 -
.../org/apache/log4j/joran/action/ParamAction.java | 72 -
.../apache/log4j/joran/action/PluginAction.java | 106 -
.../apache/log4j/joran/action/PriorityAction.java | 19 -
.../apache/log4j/joran/action/PropertyAction.java | 92 -
.../joran/action/RepositoryPropertyAction.java | 53 -
.../log4j/joran/action/RootLoggerAction.java | 68 -
.../joran/action/SubstitutionPropertyAction.java | 40 -
.../apache/log4j/joran/spi/ActionException.java | 59 -
.../apache/log4j/joran/spi/ExecutionContext.java | 155 --
.../org/apache/log4j/joran/spi/Interpreter.java | 408 ---
.../org/apache/log4j/joran/spi/JoranDocument.java | 229 --
src/java/org/apache/log4j/joran/spi/Pattern.java | 185 --
src/java/org/apache/log4j/joran/spi/RuleStore.java | 28 -
.../apache/log4j/joran/spi/SimpleRuleStore.java | 99 -
.../apache/log4j/multiplex/AppenderFactory.java | 15 -
.../log4j/multiplex/AppenderFactoryUtils.java | 84 -
.../org/apache/log4j/multiplex/MDCKeySelector.java | 54 -
.../apache/log4j/multiplex/MultiplexAppender.java | 87 -
.../apache/log4j/multiplex/MultiplexSelector.java | 21 -
.../log4j/multiplex/MultiplexSelectorSkeleton.java | 57 -
src/java/org/apache/log4j/net/AddressBased.java | 34 -
src/java/org/apache/log4j/net/JMSAppender.java | 397 ---
src/java/org/apache/log4j/net/JMSReceiver.java | 290 ---
.../org/apache/log4j/net/JMSReceiverBeanInfo.java | 51 -
src/java/org/apache/log4j/net/JMSSink.java | 147 --
.../org/apache/log4j/net/MulticastAppender.java | 296 ---
.../org/apache/log4j/net/MulticastReceiver.java | 255 --
.../log4j/net/MulticastReceiverBeanInfo.java | 49 -
src/java/org/apache/log4j/net/NetworkBased.java | 15 -
src/java/org/apache/log4j/net/PortBased.java | 33 -
src/java/org/apache/log4j/net/SMTPAppender.java | 492 ----
.../org/apache/log4j/net/SimpleSocketServer.java | 95 -
src/java/org/apache/log4j/net/SocketAppender.java | 430 ---
.../org/apache/log4j/net/SocketHubAppender.java | 417 ---
.../org/apache/log4j/net/SocketHubReceiver.java | 286 --
.../log4j/net/SocketHubReceiverBeanInfo.java | 50 -
src/java/org/apache/log4j/net/SocketNode.java | 231 --
.../apache/log4j/net/SocketNodeEventListener.java | 41 -
src/java/org/apache/log4j/net/SocketReceiver.java | 400 ---
src/java/org/apache/log4j/net/SocketServer.java | 217 --
src/java/org/apache/log4j/net/SyslogAppender.java | 305 ---
src/java/org/apache/log4j/net/SyslogConstants.java | 77 -
src/java/org/apache/log4j/net/TelnetAppender.java | 215 --
src/java/org/apache/log4j/net/UDPAppender.java | 317 ---
src/java/org/apache/log4j/net/UDPReceiver.java | 252 --
src/java/org/apache/log4j/net/XMLSocketNode.java | 209 --
.../org/apache/log4j/net/XMLSocketReceiver.java | 274 --
src/java/org/apache/log4j/net/package.html | 13 -
src/java/org/apache/log4j/net/test/Loop.java | 60 -
src/java/org/apache/log4j/net/test/SMTPMin.java | 55 -
src/java/org/apache/log4j/net/test/SocketMin.java | 102 -
src/java/org/apache/log4j/net/test/SyslogMin.java | 60 -
.../log4j/net/test/intermediarySocketServer.lcf | 23 -
src/java/org/apache/log4j/net/test/jms.lcf | 6 -
src/java/org/apache/log4j/net/test/logging.lcf | 9 -
src/java/org/apache/log4j/net/test/loop.lcf | 9 -
.../org/apache/log4j/net/test/socketClient.lcf | 20 -
.../org/apache/log4j/net/test/socketServer.lcf | 12 -
src/java/org/apache/log4j/net/test/syslog.lcf | 20 -
src/java/org/apache/log4j/net/test/syslogMin | 21 -
src/java/org/apache/log4j/or/DefaultRenderer.java | 36 -
src/java/org/apache/log4j/or/ObjectRenderer.java | 30 -
src/java/org/apache/log4j/or/RendererMap.java | 191 --
.../org/apache/log4j/or/ThreadGroupRenderer.java | 67 -
.../org/apache/log4j/or/jms/MessageRenderer.java | 88 -
src/java/org/apache/log4j/or/jms/package.html | 7 -
src/java/org/apache/log4j/or/package.html | 13 -
.../apache/log4j/or/sax/AttributesRenderer.java | 52 -
src/java/org/apache/log4j/or/sax/package.html | 7 -
src/java/org/apache/log4j/package.html | 11 -
.../org/apache/log4j/pattern/CachedDateFormat.java | 365 ---
.../log4j/pattern/ClassNamePatternConverter.java | 54 -
.../apache/log4j/pattern/DatePatternConverter.java | 111 -
.../pattern/FileLocationPatternConverter.java | 58 -
.../org/apache/log4j/pattern/FormattingInfo.java | 39 -
.../pattern/FullLocationPatternConverter.java | 57 -
.../log4j/pattern/LevelPatternConverter.java | 66 -
.../pattern/LineLocationPatternConverter.java | 57 -
.../pattern/LineSeparatorPatternConverter.java | 49 -
.../log4j/pattern/LiteralPatternConverter.java | 46 -
.../log4j/pattern/LoggerPatternConverter.java | 47 -
.../log4j/pattern/MessagePatternConverter.java | 61 -
.../pattern/MethodLocationPatternConverter.java | 58 -
.../apache/log4j/pattern/NDCPatternConverter.java | 52 -
.../log4j/pattern/NamedPatternConverter.java | 102 -
.../org/apache/log4j/pattern/PatternConverter.java | 187 --
.../org/apache/log4j/pattern/PatternParser.java | 410 ---
.../log4j/pattern/PropertiesPatternConverter.java | 94 -
.../pattern/RelativeTimePatternConverter.java | 62 -
.../pattern/SequenceNumberPatternConverter.java | 51 -
.../log4j/pattern/ThreadPatternConverter.java | 54 -
.../ThrowableInformationPatternConverter.java | 92 -
src/java/org/apache/log4j/plugins/Pauseable.java | 30 -
src/java/org/apache/log4j/plugins/Plugin.java | 140 -
src/java/org/apache/log4j/plugins/PluginEvent.java | 45 -
.../org/apache/log4j/plugins/PluginListener.java | 34 -
.../org/apache/log4j/plugins/PluginRegistry.java | 279 --
.../org/apache/log4j/plugins/PluginSkeleton.java | 184 --
src/java/org/apache/log4j/plugins/Receiver.java | 123 -
.../log4j/rolling/FixedWindowRollingPolicy.java | 190 --
.../apache/log4j/rolling/RollingFileAppender.java | 198 --
.../org/apache/log4j/rolling/RollingPolicy.java | 48 -
.../apache/log4j/rolling/RollingPolicyBase.java | 78 -
.../org/apache/log4j/rolling/RolloverFailure.java | 30 -
.../log4j/rolling/SizeBasedTriggeringPolicy.java | 48 -
.../log4j/rolling/TimeBasedRollingPolicy.java | 286 --
.../org/apache/log4j/rolling/TriggeringPolicy.java | 39 -
.../org/apache/log4j/rolling/helper/Compress.java | 169 --
.../log4j/rolling/helper/DateTokenConverter.java | 63 -
.../log4j/rolling/helper/FileNamePattern.java | 248 --
.../rolling/helper/IdentityTokenConverter.java | 43 -
.../rolling/helper/IntegerTokenConverter.java | 35 -
.../log4j/rolling/helper/RollingCalendar.java | 229 --
.../log4j/rolling/helper/TokenConverter.java | 60 -
src/java/org/apache/log4j/rolling/helper/Util.java | 89 -
.../org/apache/log4j/rolling/helper/package.html | 11 -
src/java/org/apache/log4j/rolling/package.html | 20 -
src/java/org/apache/log4j/rule/AbstractRule.java | 56 -
src/java/org/apache/log4j/rule/AndRule.java | 60 -
src/java/org/apache/log4j/rule/ColorRule.java | 68 -
src/java/org/apache/log4j/rule/EqualsRule.java | 75 -
src/java/org/apache/log4j/rule/ExistsRule.java | 64 -
src/java/org/apache/log4j/rule/ExpressionRule.java | 140 -
src/java/org/apache/log4j/rule/InFixToPostFix.java | 190 --
src/java/org/apache/log4j/rule/InequalityRule.java | 103 -
.../org/apache/log4j/rule/LevelEqualsRule.java | 102 -
.../org/apache/log4j/rule/LevelInequalityRule.java | 145 --
src/java/org/apache/log4j/rule/LikeRule.java | 112 -
src/java/org/apache/log4j/rule/NotEqualsRule.java | 69 -
src/java/org/apache/log4j/rule/NotRule.java | 55 -
src/java/org/apache/log4j/rule/OrRule.java | 59 -
.../apache/log4j/rule/PartialTextMatchRule.java | 70 -
src/java/org/apache/log4j/rule/Rule.java | 59 -
src/java/org/apache/log4j/rule/RuleFactory.java | 142 -
.../org/apache/log4j/rule/TimestampEqualsRule.java | 81 -
.../apache/log4j/rule/TimestampInequalityRule.java | 100 -
src/java/org/apache/log4j/scheduler/Job.java | 32 -
src/java/org/apache/log4j/scheduler/Scheduler.java | 234 --
.../apache/log4j/selector/ContextJNDISelector.java | 214 --
src/java/org/apache/log4j/selector/package.html | 19 -
.../selector/servlet/ContextDetachingSCL.java | 89 -
.../org/apache/log4j/spi/AppenderAttachable.java | 66 -
src/java/org/apache/log4j/spi/Component.java | 29 -
src/java/org/apache/log4j/spi/ComponentBase.java | 62 -
src/java/org/apache/log4j/spi/Configurator.java | 69 -
src/java/org/apache/log4j/spi/Decoder.java | 42 -
.../log4j/spi/DefaultRepositorySelector.java | 49 -
src/java/org/apache/log4j/spi/ErrorItem.java | 113 -
src/java/org/apache/log4j/spi/Filter.java | 116 -
.../apache/log4j/spi/HierarchyEventListener.java | 36 -
.../org/apache/log4j/spi/LoggerEventListener.java | 59 -
src/java/org/apache/log4j/spi/LoggerFactory.java | 35 -
.../org/apache/log4j/spi/LoggerRepository.java | 237 --
.../log4j/spi/LoggerRepositoryEventListener.java | 47 -
src/java/org/apache/log4j/spi/LoggingEvent.java | 916 -------
.../log4j/spi/LoggingEventFieldResolver.java | 177 --
src/java/org/apache/log4j/spi/OptionHandler.java | 41 -
src/java/org/apache/log4j/spi/RendererSupport.java | 27 -
.../org/apache/log4j/spi/RepositorySelector.java | 67 -
src/java/org/apache/log4j/spi/RootCategory.java | 64 -
src/java/org/apache/log4j/spi/RootLogger.java | 70 -
src/java/org/apache/log4j/spi/Thresholdable.java | 55 -
.../org/apache/log4j/spi/ThrowableInformation.java | 231 --
.../apache/log4j/spi/TriggeringEventEvaluator.java | 39 -
.../apache/log4j/spi/location/LegacyExtractor.java | 210 --
.../apache/log4j/spi/location/LocationInfo.java | 199 --
.../spi/location/StackTraceElementExtractor.java | 139 -
src/java/org/apache/log4j/spi/package.html | 12 -
.../org/apache/log4j/test/witness/confParsing.1 | 2 -
.../org/apache/log4j/test/witness/confParsing.10 | 2 -
.../org/apache/log4j/test/witness/confParsing.11 | 2 -
.../org/apache/log4j/test/witness/confParsing.2 | 2 -
.../org/apache/log4j/test/witness/confParsing.3 | 1 -
.../org/apache/log4j/test/witness/confParsing.4 | 3 -
.../org/apache/log4j/test/witness/confParsing.5 | 3 -
.../org/apache/log4j/test/witness/confParsing.6 | 2 -
.../org/apache/log4j/test/witness/confParsing.7 | 3 -
.../org/apache/log4j/test/witness/confParsing.8 | 2 -
.../org/apache/log4j/test/witness/confParsing.9 | 2 -
src/java/org/apache/log4j/test/witness/customCat.1 | 6 -
src/java/org/apache/log4j/test/witness/definit.1 | 1 -
src/java/org/apache/log4j/test/witness/definit.2 | 0
src/java/org/apache/log4j/test/witness/definit.3 | 0
src/java/org/apache/log4j/test/witness/definit.4 | 0
src/java/org/apache/log4j/test/witness/definit.5 | 1 -
src/java/org/apache/log4j/test/witness/definit.6 | 1 -
src/java/org/apache/log4j/test/witness/domTest.10 | 2 -
src/java/org/apache/log4j/test/witness/domTest.11 | 2 -
src/java/org/apache/log4j/test/witness/domTest.12 | 24 -
src/java/org/apache/log4j/test/witness/domTest.4 | 12 -
src/java/org/apache/log4j/test/witness/domTest.5 | 26 -
src/java/org/apache/log4j/test/witness/domTest.6 | 4 -
src/java/org/apache/log4j/test/witness/domTest.7 | 24 -
src/java/org/apache/log4j/test/witness/domTest.8 | 6 -
src/java/org/apache/log4j/test/witness/domTest.9 | 0
.../org/apache/log4j/test/witness/domTest.A1.1 | 39 -
.../org/apache/log4j/test/witness/domTest.A1.2 | 0
.../org/apache/log4j/test/witness/domTest.A1.3 | 0
.../org/apache/log4j/test/witness/domTest.A2.1 | 26 -
.../org/apache/log4j/test/witness/domTest.A2.2 | 0
.../org/apache/log4j/test/witness/domTest.A2.3 | 4 -
.../org/apache/log4j/test/witness/enableFlagTest.1 | 0
.../org/apache/log4j/test/witness/enableFlagTest.2 | 1 -
.../org/apache/log4j/test/witness/enableFlagTest.3 | 2 -
.../org/apache/log4j/test/witness/enableFlagTest.4 | 3 -
.../org/apache/log4j/test/witness/enableFlagTest.5 | 4 -
.../org/apache/log4j/test/witness/enableFlagTest.6 | 5 -
.../org/apache/log4j/test/witness/enableFlagTest.7 | 5 -
src/java/org/apache/log4j/test/witness/fqcn.1 | 3 -
.../org/apache/log4j/test/witness/getOptions.1 | 11 -
src/java/org/apache/log4j/test/witness/l7d.1 | 21 -
src/java/org/apache/log4j/test/witness/mycat.1 | 1 -
src/java/org/apache/log4j/test/witness/mycat.2 | 0
src/java/org/apache/log4j/test/witness/mycat.3 | 1 -
src/java/org/apache/log4j/test/witness/propCfg.1 | 1 -
src/java/org/apache/log4j/test/witness/propCfg.2 | 1 -
.../org/apache/log4j/test/witness/shallow.1000 | 50 -
.../org/apache/log4j/test/witness/shallow.1001 | 50 -
.../org/apache/log4j/test/witness/shallow.A1.1 | 50 -
.../org/apache/log4j/test/witness/shallow.A1.2 | 45 -
.../org/apache/log4j/test/witness/shallow.A1.3 | 50 -
.../org/apache/log4j/test/witness/shallow.A1.4 | 40 -
.../org/apache/log4j/test/witness/shallow.A1.5 | 40 -
.../org/apache/log4j/test/witness/shallow.A1.6 | 40 -
.../org/apache/log4j/test/witness/shallow.A1.7 | 25 -
.../org/apache/log4j/test/witness/shallow.A1.8 | 15 -
.../org/apache/log4j/test/witness/shallow.A2.1 | 25 -
.../org/apache/log4j/test/witness/shallow.A2.2 | 25 -
.../org/apache/log4j/test/witness/shallow.A2.3 | 25 -
.../org/apache/log4j/test/witness/shallow.A2.4 | 20 -
.../org/apache/log4j/test/witness/shallow.A2.5 | 15 -
.../org/apache/log4j/test/witness/shallow.A2.6 | 15 -
.../org/apache/log4j/test/witness/shallow.A2.7 | 15 -
.../org/apache/log4j/test/witness/shallow.A2.8 | 25 -
src/java/org/apache/log4j/test/xml/domTest1.xml | 34 -
src/java/org/apache/log4j/test/xml/domTest10.xml | 31 -
src/java/org/apache/log4j/test/xml/domTest11.xml | 28 -
src/java/org/apache/log4j/test/xml/domTest12.xml | 24 -
src/java/org/apache/log4j/test/xml/domTest2.xml | 26 -
src/java/org/apache/log4j/test/xml/domTest3.xml | 41 -
src/java/org/apache/log4j/test/xml/domTest4.xml | 21 -
src/java/org/apache/log4j/test/xml/domTest5.xml | 18 -
src/java/org/apache/log4j/test/xml/domTest6.xml | 30 -
src/java/org/apache/log4j/test/xml/domTest7.xml | 24 -
src/java/org/apache/log4j/test/xml/domTest8.xml | 42 -
src/java/org/apache/log4j/test/xml/domTest9.xml | 32 -
src/java/org/apache/log4j/test/xml/ext1.xml | 26 -
src/java/org/apache/log4j/test/xml/fallback1.xml | 35 -
.../apache/log4j/test/xml/stressAsyncAppender.xml | 43 -
src/java/org/apache/log4j/varia/ListAppender.java | 89 -
.../org/apache/log4j/varia/ListModelAppender.java | 73 -
.../apache/log4j/varia/LogFilePatternReceiver.java | 798 ------
.../varia/LogFilePatternReceiverBeanInfo.java | 48 -
src/java/org/apache/log4j/varia/NullAppender.java | 61 -
src/java/org/apache/log4j/varia/package.html | 13 -
src/java/org/apache/log4j/varia/test/Loop.java | 58 -
.../org/apache/log4j/varia/test/checkForHoles.pl | 53 -
src/java/org/apache/log4j/varia/test/doRoll | 21 -
src/java/org/apache/log4j/varia/test/elf.pl | 34 -
src/java/org/apache/log4j/varia/test/externalRoll | 42 -
src/java/org/apache/log4j/varia/test/resiliency | 41 -
src/java/org/apache/log4j/xml/.cvsignore | 1 -
src/java/org/apache/log4j/xml/DOMConfigurator.java | 63 -
.../org/apache/log4j/xml/Log4jEntityResolver.java | 61 -
src/java/org/apache/log4j/xml/SAXErrorHandler.java | 46 -
.../log4j/xml/UtilLoggingEntityResolver.java | 55 -
.../apache/log4j/xml/UtilLoggingXMLDecoder.java | 422 ---
src/java/org/apache/log4j/xml/XMLDecoder.java | 429 ---
src/java/org/apache/log4j/xml/XMLLayout.java | 218 --
src/java/org/apache/log4j/xml/examples/.cvsignore | 1 -
.../log4j/xml/examples/ReportParserError.java | 33 -
.../org/apache/log4j/xml/examples/XMLSample.java | 62 -
.../org/apache/log4j/xml/examples/extension1.xml | 28 -
.../org/apache/log4j/xml/examples/extension2.xml | 35 -
.../org/apache/log4j/xml/examples/package.html | 26 -
src/java/org/apache/log4j/xml/examples/sample1.xml | 22 -
src/java/org/apache/log4j/xml/examples/sample2.xml | 31 -
src/java/org/apache/log4j/xml/examples/sample3.xml | 28 -
src/java/org/apache/log4j/xml/examples/sample4.xml | 22 -
src/java/org/apache/log4j/xml/examples/sample5.xml | 34 -
src/java/org/apache/log4j/xml/log4j.dtd | 181 --
src/java/org/apache/log4j/xml/logger.dtd | 68 -
src/java/org/apache/log4j/xml/package.html | 16 -
src/java/org/apache/log4j/xml/test/.cvsignore | 3 -
src/java/org/apache/log4j/xml/test/DOMTest.java | 86 -
src/java/org/apache/log4j/xml/test/testlog.xml | 23 -
src/java/org/apache/ugli/LoggerFactory.java | 92 -
src/java/org/apache/ugli/LoggerFactoryAdapter.java | 35 -
src/java/org/apache/ugli/ULogger.java | 90 -
src/java/org/apache/ugli/impl/JDK14Logger.java | 234 --
src/java/org/apache/ugli/impl/JDK14LoggerFA.java | 59 -
src/java/org/apache/ugli/impl/Log4jLoggerFA.java | 57 -
.../org/apache/ugli/impl/MessageFormatter.java | 126 -
src/java/org/apache/ugli/impl/NOPLogger.java | 182 --
src/java/org/apache/ugli/impl/NOPLoggerFA.java | 31 -
src/java/org/apache/ugli/impl/SimpleLogger.java | 272 --
src/java/org/apache/ugli/impl/SimpleLoggerFA.java | 56 -
src/log4j-coding-convention.xml | 225 --
src/schema/logging.xsd | 154 --
src/sun_checks.xml | 128 -
src/xdocs/chainsaw.xml | 99 -
src/xdocs/codes.xml | 151 --
src/xdocs/contributors.xml | 165 --
src/xdocs/documentation.xml | 195 --
src/xdocs/download.xml | 367 ---
src/xdocs/earlier.xml | 27 -
src/xdocs/faq.xml | 952 -------
src/xdocs/history.xml | 46 -
src/xdocs/index.xml | 72 -
src/xdocs/install-chainsaw.xml | 104 -
src/xdocs/plan.xml | 257 --
src/xdocs/stylesheets/lf5.xml | 27 -
src/xdocs/stylesheets/project.xml | 31 -
src/xdocs/ugli.xml | 179 --
tests/.cvsignore | 8 -
tests/README | 107 -
tests/build.properties.sample | 6 -
tests/build.xml | 722 ------
tests/db.xml | 234 --
tests/input/compress1.copy | 15 -
tests/input/compress2.copy | 129 -
tests/input/compress3.copy | 143 -
tests/input/db/.cvsignore | 4 -
tests/input/db/append-with-c3p0.xml | 43 -
tests/input/db/append-with-datasource1.xml | 37 -
tests/input/db/append-with-drivermanager1.xml | 33 -
tests/input/db/append-with-jndi1.xml | 45 -
tests/input/db/append-with-pooled-datasource1.xml | 42 -
tests/input/db/deleteTables.sql | 4 -
tests/input/db/hsqldb.properties.sample | 11 -
tests/input/db/mysql.properties.sample | 17 -
tests/input/db/oracle.properties.sample | 25 -
tests/input/db/postgresql.properties.sample | 28 -
tests/input/db/read-with-datasource1.xml | 52 -
tests/input/db/read-with-drivermanager1.xml | 40 -
tests/input/db/read-with-jndi1.xml | 45 -
tests/input/db/read-with-pooled-datasource1.xml | 45 -
tests/input/defaultInit3.properties | 7 -
tests/input/filter/simpleFilter1.xml | 37 -
tests/input/filter/simpleFilter2.xml | 24 -
tests/input/filter/simpleFilter3.xml | 41 -
tests/input/filter/simpleFilter4.xml | 31 -
tests/input/filter/simpleFilter5.xml | 29 -
tests/input/filter/simpleFilter6.xml | 26 -
tests/input/filter/simpleFilter7.xml | 24 -
.../input/hierarchy/hierarchyThreshold1.properties | 12 -
.../input/hierarchy/hierarchyThreshold2.properties | 7 -
.../input/hierarchy/hierarchyThreshold3.properties | 7 -
.../input/hierarchy/hierarchyThreshold4.properties | 7 -
.../input/hierarchy/hierarchyThreshold5.properties | 7 -
.../input/hierarchy/hierarchyThreshold6.properties | 12 -
.../input/hierarchy/hierarchyThreshold7.properties | 12 -
.../input/hierarchy/hierarchyThreshold8.properties | 12 -
tests/input/joran/asyncTest.xml | 29 -
tests/input/joran/badEnd1.xml | 15 -
tests/input/joran/badEnd2.xml | 16 -
tests/input/joran/basicLoop.xml | 8 -
tests/input/joran/conversionRule.xml | 22 -
tests/input/joran/exception1.xml | 14 -
tests/input/joran/illFormed.xml | 8 -
tests/input/joran/newRule1.xml | 10 -
tests/input/joran/parser1.xml | 21 -
tests/input/joran/parser2.xml | 32 -
tests/input/joran/parser3.xml | 30 -
tests/input/joran/simple1.xml | 17 -
tests/input/joran/simple2.xml | 17 -
tests/input/multiplex/configTest-1.xml | 23 -
tests/input/ndc/NDC1.properties | 11 -
tests/input/net/socketServer1.properties | 14 -
tests/input/net/socketServer2.properties | 14 -
tests/input/net/socketServer3.properties | 11 -
tests/input/net/socketServer4.properties | 11 -
tests/input/net/socketServer5.properties | 11 -
tests/input/net/socketServer6.properties | 11 -
tests/input/net/socketServer7.properties | 11 -
tests/input/net/socketServer8.properties | 11 -
tests/input/pattern/patternLayout.mdc.1.properties | 11 -
tests/input/pattern/patternLayout1.properties | 11 -
tests/input/pattern/patternLayout10.properties | 11 -
tests/input/pattern/patternLayout11.properties | 11 -
tests/input/pattern/patternLayout12.properties | 11 -
tests/input/pattern/patternLayout13.properties | 11 -
tests/input/pattern/patternLayout2.properties | 11 -
tests/input/pattern/patternLayout3.properties | 11 -
tests/input/pattern/patternLayout4.properties | 11 -
tests/input/pattern/patternLayout5.properties | 11 -
tests/input/pattern/patternLayout6.properties | 12 -
tests/input/pattern/patternLayout7.properties | 11 -
tests/input/pattern/patternLayout8.properties | 11 -
tests/input/pattern/patternLayout9.properties | 11 -
tests/input/performance/file-bufferedio.xml | 20 -
tests/input/performance/file-noflush.xml | 20 -
tests/input/performance/file.xml | 19 -
tests/input/performance/null-appender-info.xml | 28 -
tests/input/performance/null-appender.xml | 16 -
tests/input/performance/telnet.xml | 17 -
tests/input/rolling/time1.xml | 26 -
tests/input/schema/invalid/empty.xml | 5 -
tests/input/schema/invalid/oldns.xml | 1 -
tests/input/schema/valid/DOMTestCase1.xml | 41 -
tests/input/schema/valid/customLevel1.xml | 23 -
tests/input/schema/valid/customLevel2.xml | 32 -
tests/input/schema/valid/customLevel3.xml | 34 -
tests/input/schema/valid/customLevel4.xml | 26 -
tests/input/schema/valid/customLogger1.xml | 26 -
tests/input/schema/valid/customLogger2.xml | 34 -
tests/input/schema/valid/customLogger3.xml | 26 -
tests/input/schema/valid/defaultInit.xml | 17 -
.../valid/filters.LevelMatchFilter.test4.0.xml | 23 -
.../valid/filters.LevelMatchFilter.test4.1.xml | 23 -
.../valid/filters.LevelMatchFilter.test4.2.xml | 23 -
.../valid/filters.LevelMatchFilter.test4.3.xml | 23 -
.../valid/filters.LevelMatchFilter.test4.4.xml | 23 -
tests/input/ugli/basic.xml | 17 -
tests/input/xml/DOMTestCase1.xml | 40 -
tests/input/xml/customLevel1.xml | 23 -
tests/input/xml/customLevel2.xml | 32 -
tests/input/xml/customLevel3.xml | 34 -
tests/input/xml/customLevel4.xml | 26 -
tests/input/xml/customLogger1.xml | 26 -
tests/input/xml/customLogger2.xml | 34 -
tests/input/xml/customLogger3.xml | 26 -
tests/input/xml/defaultInit.xml | 17 -
.../input/xml/filters.LevelMatchFilter.test4.0.xml | 23 -
.../input/xml/filters.LevelMatchFilter.test4.1.xml | 23 -
.../input/xml/filters.LevelMatchFilter.test4.2.xml | 23 -
.../input/xml/filters.LevelMatchFilter.test4.3.xml | 23 -
.../input/xml/filters.LevelMatchFilter.test4.4.xml | 23 -
tests/integration/.cvsignore | 2 -
tests/integration/README.txt | 39 -
tests/integration/build.properties.sample | 5 -
tests/integration/build.xml | 193 --
tests/integration/client-log4j.xml | 28 -
tests/integration/client.properties | 10 -
tests/integration/lib/.cvsignore | 8 -
tests/integration/otherlib/.cvsignore | 1 -
tests/integration/server.properties | 1 -
tests/integration/src/java/SampleServlet.java | 50 -
tests/integration/src/java/TestAppender.java | 18 -
.../src/webapp/WEB-INF/classes/.cvsignore | 1 -
.../webapp/WEB-INF/classes/test-log4j.xml.sample | 46 -
tests/integration/src/webapp/WEB-INF/web.xml | 26 -
tests/integration/target/.cvsignore | 5 -
tests/integration/test/java/TestSampleServlet.java | 42 -
tests/lib/.cvsignore | 11 -
tests/performance.xml | 156 --
tests/resources/L7D_en_US.properties | 3 -
tests/resources/L7D_fr.properties | 3 -
tests/resources/L7D_fr_CH.properties | 2 -
tests/resources/history/GIL.logging | 41 -
tests/resources/history/kal0.txt | 67 -
tests/resources/history/kal1.txt | 67 -
tests/resources/history/kal2.txt | 57 -
tests/resources/history/torino0.txt | 41 -
tests/resources/history/torino1.txt | 60 -
tests/resources/jetty.jndi.properties | 2 -
tests/resources/reffs.jndi.properties | 3 -
tests/servlet.xml | 98 -
.../org/apache/log4j/AsyncAppenderTestCase.java | 105 -
tests/src/java/org/apache/log4j/DRFATestCase.java | 263 --
tests/src/java/org/apache/log4j/DeadlockTest.java | 101 -
.../apache/log4j/HierarchyThresholdTestCase.java | 124 -
tests/src/java/org/apache/log4j/Last.java | 24 -
.../src/java/org/apache/log4j/LoggerTestCase.java | 384 ---
tests/src/java/org/apache/log4j/MinimumTest.java | 216 --
tests/src/java/org/apache/log4j/NDCTestCase.java | 79 -
.../java/org/apache/log4j/PatternLayoutTest.java | 430 ---
tests/src/java/org/apache/log4j/SimpleLog.java | 67 -
.../src/java/org/apache/log4j/StressCategory.java | 235 --
.../src/java/org/apache/log4j/VectorAppender.java | 84 -
.../chainsaw/receivers/ReceiversHelperTest.java | 57 -
.../org/apache/log4j/customLogger/XLogger.java | 141 -
.../apache/log4j/customLogger/XLoggerTestCase.java | 84 -
.../log4j/db/BindDataSourceToJNDIAction.java | 106 -
tests/src/java/org/apache/log4j/db/DBPerfTest.java | 60 -
.../java/org/apache/log4j/db/FullCycleDBTest.java | 269 --
.../org/apache/log4j/defaultInit/TestCase1.java | 50 -
.../org/apache/log4j/defaultInit/TestCase2.java | 56 -
.../org/apache/log4j/defaultInit/TestCase3.java | 45 -
.../org/apache/log4j/defaultInit/TestCase4.java | 57 -
.../org/apache/log4j/filter/SimpleFilterTest.java | 102 -
.../apache/log4j/helpers/BoundedFIFOTestCase.java | 231 --
.../apache/log4j/helpers/CyclicBufferTestCase.java | 161 --
.../log4j/helpers/LevelOptionConverterTest.java | 88 -
.../log4j/helpers/OptionSubstitutionTest.java | 144 -
.../log4j/helpers/ReaderWriterLockTestCase.java | 205 --
.../org/apache/log4j/helpers/VerifierThread.java | 227 --
tests/src/java/org/apache/log4j/html/Loop.java | 64 -
.../org/apache/log4j/joran/InterpreterTest.java | 399 ---
.../apache/log4j/joran/JoranConfiguratorTest.java | 131 -
.../src/java/org/apache/log4j/joran/NOPAction.java | 39 -
.../java/org/apache/log4j/joran/PatternTest.java | 104 -
.../org/apache/log4j/joran/SimpleStoreTest.java | 188 --
.../log4j/joran/SkippingInInterpreterTest.java | 159 --
.../apache/log4j/joran/action/BadBeginAction.java | 37 -
.../apache/log4j/joran/action/BadEndAction.java | 34 -
.../org/apache/log4j/joran/action/HelloAction.java | 45 -
.../log4j/joran/action/StackCounterAction.java | 54 -
.../org/apache/log4j/joran/action/TouchAction.java | 51 -
.../log4j/multiplex/MultiplexAppenderTest.java | 105 -
.../org/apache/log4j/net/ShortSocketServer.java | 89 -
.../org/apache/log4j/net/SocketServerTestCase.java | 370 ---
.../java/org/apache/log4j/net/XMLDecoderTest.java | 40 -
tests/src/java/org/apache/log4j/or/ORTestCase.java | 219 --
.../apache/log4j/pattern/CachedDateFormatTest.java | 398 ---
.../log4j/pattern/Num343PatternConverter.java | 47 -
.../apache/log4j/pattern/PatternParserTest.java | 175 --
.../org/apache/log4j/performance/LoggingLoop.java | 181 --
.../java/org/apache/log4j/performance/Loop.java | 101 -
.../org/apache/log4j/performance/NOPWriter.java | 45 -
.../org/apache/log4j/performance/NewVsSetLen.java | 217 --
.../org/apache/log4j/performance/NullAppender.java | 58 -
.../org/apache/log4j/performance/SystemTime.java | 55 -
.../src/java/org/apache/log4j/performance/logging | 375 ---
.../java/org/apache/log4j/performance/package.html | 19 -
.../org/apache/log4j/plugins/PluginTestCase.java | 633 -----
.../java/org/apache/log4j/rolling/FileOpener.java | 36 -
.../org/apache/log4j/rolling/RenamingTest.java | 91 -
.../apache/log4j/rolling/SizeBasedRollingTest.java | 181 --
.../apache/log4j/rolling/TimeBasedRollingTest.java | 493 ----
.../log4j/rolling/helper/CompressTestCase.java | 76 -
.../rolling/helper/FileNamePatternTestCase.java | 131 -
.../org/apache/log4j/scheduler/CountingJob.java | 38 -
.../org/apache/log4j/scheduler/PeriodicJob.java | 90 -
.../org/apache/log4j/scheduler/SchedulerTest.java | 284 --
.../java/org/apache/log4j/selector/PassByJNDI.java | 86 -
.../apache/log4j/spi/ThrowableInformationTest.java | 68 -
.../log4j/spi/location/LocationInfoTest.java | 105 -
tests/src/java/org/apache/log4j/stressCategory | 899 -------
tests/src/java/org/apache/log4j/stressCategory.pl | 57 -
.../log4j/util/AbsoluteDateAndTimeFilter.java | 35 -
.../org/apache/log4j/util/AbsoluteTimeFilter.java | 33 -
tests/src/java/org/apache/log4j/util/Compare.java | 141 -
.../java/org/apache/log4j/util/ControlFilter.java | 43 -
tests/src/java/org/apache/log4j/util/Filter.java | 39 -
.../java/org/apache/log4j/util/ISO8601Filter.java | 34 -
.../apache/log4j/util/JunitTestRunnerFilter.java | 46 -
.../org/apache/log4j/util/LineNumberFilter.java | 34 -
.../org/apache/log4j/util/RelativeTimeFilter.java | 35 -
.../org/apache/log4j/util/SunReflectFilter.java | 39 -
.../java/org/apache/log4j/util/Transformer.java | 59 -
.../log4j/util/UnexpectedFormatException.java | 15 -
.../apache/log4j/util/XMLLineAttributeFilter.java | 37 -
.../apache/log4j/util/XMLSequenceNumberFilter.java | 40 -
.../org/apache/log4j/util/XMLTimestampFilter.java | 36 -
.../log4j/varia/LevelMatchFilterTestCase.java | 140 -
.../log4j/varia/LevelRangeFilterTestCase.java | 203 --
.../org/apache/log4j/xml/CustomLevelTestCase.java | 109 -
.../src/java/org/apache/log4j/xml/DOMTestCase.java | 128 -
.../java/org/apache/log4j/xml/SchemaTestCase.java | 155 --
tests/src/java/org/apache/log4j/xml/XLevel.java | 74 -
.../java/org/apache/log4j/xml/XMLDecoderTest.java | 40 -
.../org/apache/log4j/xml/XMLLayoutTestCase.java | 215 --
tests/src/java/org/apache/ugli/InvokingUGLI.java | 67 -
.../org/apache/ugli/impl/MessageFormatterTest.java | 78 -
tests/ugli-test.xml | 169 --
tests/webapps/Tata/.cvsignore | 3 -
tests/webapps/Tata/build.properties.sample | 6 -
tests/webapps/Tata/build.xml | 42 -
tests/webapps/Tata/src/WEB-INF/web.xml | 29 -
tests/webapps/Tata/src/html/index.html | 11 -
.../webapps/Tata/src/java/wombat/InitServlet.java | 16 -
tests/webapps/Tata/src/java/wombat/XServlet.java | 29 -
tests/webapps/Titi/.cvsignore | 3 -
tests/webapps/Titi/build.properties.sample | 6 -
tests/webapps/Titi/build.xml | 42 -
tests/webapps/Titi/src/WEB-INF/web.xml | 29 -
tests/webapps/Titi/src/html/index.html | 11 -
.../webapps/Titi/src/java/wombat/InitServlet.java | 16 -
tests/webapps/Titi/src/java/wombat/XServlet.java | 29 -
tests/webapps/Titi/titi.war | Bin 2384 -> 0 bytes
tests/webapps/Util/.cvsignore | 3 -
tests/webapps/Util/build.properties.sample | 11 -
tests/webapps/Util/build.xml | 36 -
tests/webapps/Util/src/java/wombat/Util.java | 39 -
tests/webapps/Util/util.jar | Bin 1074 -> 0 bytes
tests/witness/LevelMatchFilter_accept | 5 -
tests/witness/LevelMatchFilter_deny | 20 -
tests/witness/LevelRangeFilter_accept | 46 -
tests/witness/LevelRangeFilter_neutral | 46 -
tests/witness/NDCMatchFilter_accept | 11 -
tests/witness/NDCMatchFilter_deny | 21 -
tests/witness/compress1.txt.gz | Bin 413 -> 0 bytes
tests/witness/compress2.txt.gz | Bin 1768 -> 0 bytes
tests/witness/fallback | 62 -
tests/witness/filter/simpleFilter.1 | 4 -
tests/witness/hierarchy/hierarchyThreshold.1 | 0
tests/witness/hierarchy/hierarchyThreshold.2 | 1 -
tests/witness/hierarchy/hierarchyThreshold.3 | 2 -
tests/witness/hierarchy/hierarchyThreshold.4 | 3 -
tests/witness/hierarchy/hierarchyThreshold.5 | 4 -
tests/witness/hierarchy/hierarchyThreshold.6 | 5 -
tests/witness/hierarchy/hierarchyThreshold.7 | 6 -
tests/witness/hierarchy/hierarchyThreshold.8 | 6 -
tests/witness/joran/async | 62 -
tests/witness/multiplex/multiplex-test1_bob.txt | 2 -
tests/witness/multiplex/multiplex-test1_jane.txt | 2 -
tests/witness/ndc/NDC.1 | 25 -
tests/witness/net/socketServer.1 | 31 -
tests/witness/net/socketServer.2 | 31 -
tests/witness/net/socketServer.3 | 31 -
tests/witness/net/socketServer.4 | 31 -
tests/witness/net/socketServer.5 | 31 -
tests/witness/net/socketServer.6 | 31 -
tests/witness/net/socketServer.7 | 31 -
tests/witness/net/socketServer.8 | 31 -
tests/witness/pattern/patternLayout.1 | 75 -
tests/witness/pattern/patternLayout.10 | 75 -
tests/witness/pattern/patternLayout.11 | 75 -
tests/witness/pattern/patternLayout.12 | 75 -
tests/witness/pattern/patternLayout.13 | 75 -
tests/witness/pattern/patternLayout.14 | 75 -
tests/witness/pattern/patternLayout.2 | 75 -
tests/witness/pattern/patternLayout.3 | 75 -
tests/witness/pattern/patternLayout.4 | 75 -
tests/witness/pattern/patternLayout.5 | 75 -
tests/witness/pattern/patternLayout.6 | 75 -
tests/witness/pattern/patternLayout.7 | 75 -
tests/witness/pattern/patternLayout.8 | 75 -
tests/witness/pattern/patternLayout.9 | 75 -
tests/witness/pattern/patternLayout.mdc.1 | 1 -
tests/witness/pattern/patternLayout.mdc.2 | 12 -
tests/witness/plugins.PluginTestCase.test1.txt | 89 -
tests/witness/plugins.PluginTestCase.test2.txt | 63 -
tests/witness/rolling/renaming.0 | 1 -
tests/witness/rolling/renaming.1 | 1 -
tests/witness/rolling/sbr-test2.0 | 10 -
tests/witness/rolling/sbr-test2.1 | 10 -
tests/witness/rolling/sbr-test2.log | 5 -
tests/witness/rolling/sbr-test3.0.gz | Bin 68 -> 0 bytes
tests/witness/rolling/sbr-test3.1.gz | Bin 68 -> 0 bytes
tests/witness/rolling/sbr-test3.log | 5 -
tests/witness/rolling/tbr-test1.0 | 0
tests/witness/rolling/tbr-test1.1 | 2 -
tests/witness/rolling/tbr-test1.2 | 2 -
tests/witness/rolling/tbr-test1.3 | 1 -
tests/witness/rolling/tbr-test2.0 | 0
tests/witness/rolling/tbr-test2.1 | 2 -
tests/witness/rolling/tbr-test2.2 | 2 -
tests/witness/rolling/tbr-test2.3 | 1 -
tests/witness/rolling/tbr-test3.0.gz | Bin 32 -> 0 bytes
tests/witness/rolling/tbr-test3.1.gz | Bin 72 -> 0 bytes
tests/witness/rolling/tbr-test3.2.gz | Bin 72 -> 0 bytes
tests/witness/rolling/tbr-test3.3 | 1 -
tests/witness/rolling/tbr-test4.0 | 0
tests/witness/rolling/tbr-test4.1 | 2 -
tests/witness/rolling/tbr-test4.2 | 2 -
tests/witness/rolling/tbr-test4.3 | 1 -
tests/witness/rolling/tbr-test5.0 | 0
tests/witness/rolling/tbr-test5.1 | 2 -
tests/witness/rolling/tbr-test5.2 | 2 -
tests/witness/rolling/tbr-test5.3 | 1 -
tests/witness/rolling/tbr-test6.0.gz | Bin 20 -> 0 bytes
tests/witness/rolling/tbr-test6.1.gz | Bin 72 -> 0 bytes
tests/witness/rolling/tbr-test6.2.gz | Bin 72 -> 0 bytes
tests/witness/rolling/tbr-test6.3 | 1 -
tests/witness/simple | 37 -
tests/witness/ttcc | 37 -
tests/witness/xml/customLevel.1 | 5 -
tests/witness/xml/customLevel.2 | 5 -
tests/witness/xml/customLevel.3 | 1 -
tests/witness/xml/customLevel.4 | 5 -
tests/witness/xml/customLogger.1 | 18 -
tests/witness/xml/customLogger.2 | 1 -
tests/witness/xml/dom.A1.1 | 93 -
tests/witness/xml/dom.A2.1 | 62 -
tests/witness/xml/xmlLayout.1 | 112 -
tests/witness/xml/xmlLayout.2 | 127 -
tests/witness/xml/xmlLayout.3 | 5 -
tests/witness/xml/xmlLayout.mdc.1 | 8 -
tests/witness/xml/xmlLayout.mdc.2 | 8 -
tests/witness/xml/xmlLayout.null | 24 -
ugli.xml | 139 -
1180 files changed, 116547 deletions(-)
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index d11896b..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1,26 +0,0 @@
-goEnv*
-dist
-.classpath
-build.properties
-log4j-1.3alpha.jar
-log4j-chainsaw-1.3alpha.jar
-log4j-lf5-1.3alpha.jar
-.project
-IDEAS
-velocity.log.1
-velocity.log
-log4j-1.3alpha0.jar
-log4j-chainsaw-1.3alpha0.jar
-log4j-lf5-1.3alpha0.jar
-chainsaw-bundle
-chainsaw-bundle.zip
-webstart-dependant-receivers.jar-1.3alpha.jar
-.settings
-log4j-1.3alpha-1.jar
-log4j-chainsaw-1.3alpha-1.jar
-log4j-1.3alpha-?.jar
-log4j-chainsaw-1.3alpha-?.jar
-ugli-*.jar
-classes
-bin
-log4j-*.jar
diff --git a/BRANCHES b/BRANCHES
deleted file mode 100644
index da0e39d..0000000
--- a/BRANCHES
+++ /dev/null
@@ -1,61 +0,0 @@
-
-Given that log4j 1.3 is not likely to be released before a few months,
-I have created a branch called v1_2-branch in our CVS repository. The
-branch was created by issuing the following command:
-
-cvs -d :ext:ceki@cvs.apache.org:/home/cvs rtag -b -r v1_2final v1_2-branch jakarta-log4j
-
-Using the 1.2 branch, we can incorporate patches to log4j version 1.2
-while version 1.3 continues to be developed on the main trunk. For
-example, we can officially release LogFactor5 (including
-documentation) already in log4j 1.2.1.
-
-The command to access the v1_2-branch is:
-
-cvs -d XYZ checkout -r v1_2-branch jakarta-log4j
-
-where XYZ is the remote repository name, that is
-":ext:ceki@cvs.apache.org:/home/cvs" for me.
-
-Alternatively, you can issue following update command from within any
-existing work copy.
-
- cvs update -r v1_2-branch
-
-Working with branches is not completely trivial and requires a little
-coordination between committers, in particular in relation with branch
-merge operations. In order to avoid multiple merge conflicts, each
-time we merge from the 1.2 branch to the main trunk, we should tag the
-merged version on the 1.2 branch. Subsequent merges should use the tag
-referring to the latest merged version of the branch. Also do not
-forget to publicly announce a merge operation.
-
-I am suggesting that (1.2 -> trunk) merge operations be done in a
-concerted manner. Before doing a merge you tell everyone that you are
-going to do a merge, you execute the merge operation, and then tag the
-merged version on the 1.2 branch, for example v_1_2_-merged-bug666
-
-The *next* merge operation would be performed as
-
- cvs update -j v_1_2_-merged-bug666 -j v1_2-branch
-
-from within a working copy of the *trunk*. This merge operation would
-obviously also need to be tagged. According to the CVS manual, this
-procedure eliminates the side effects of merging already merged
-changes.
-
-Bug fixes should and documentation improvements, should be made to the
-1.2 branch, not the trunk. I'll take care of merging the changes to
-the main trunk.
-
-If this sounds like mambo jumbo, I urge you to consult the CVS
-documentation and experiment with branches before hitting the log4j
-repository. Branches are not that complicated really although they
-require slightly more discipline on the part of committers. Do not
-hesitate to shout if you need help.
-
-If you have a better alternative for working with branches please let
-us know.
-
---
-Ceki
\ No newline at end of file
diff --git a/HOWTOBUILD.txt b/HOWTOBUILD.txt
deleted file mode 100644
index 0bc816e..0000000
--- a/HOWTOBUILD.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-HOWTOBUILD.txt
-==============
-
-This document outlines the steps required to build and run the log4j sandbox classes.
-
-Comments/Changes/Bugs for this document and build process:
- * Log4j Developers list (log4j-dev@logging.apache.org)
-
-
-Assumptions
-===========
-* Familiar with Ant, and have it installed (http://ant.apache.org/)
- (requires the 1.5.x series of Ant, including Conditions support)
-
-Step-by-Step to build Log4j-Sandbox
-======================================
-
-1. Download logging-log4j (you've probably already done this if you're reading
- this...)
-
-2. Copy the build.properties.sample file -> build.properties
-
-3. Edit the build.properties file and modify to suit your needs. In particular
- * Ensure the "Library Path Stuff" section contains correct relative/full paths to the
- relevant libraries (You might need to source these from the 'Net)
-
-4. From the logging-log4j root directory, type:
-
- ant jar
-
- That's it ;)
\ No newline at end of file
diff --git a/INSTALL.txt b/INSTALL.txt
deleted file mode 100644
index a046853..0000000
--- a/INSTALL.txt
+++ /dev/null
@@ -1,175 +0,0 @@
-
-===========
-Using log4j
-===========
-
-1) First untar or unzip the distribution file.
-
-2) Assuming you chose to extract the distribution in to the
- PATH_OF_YOUR_CHOICE, untarring the distribution file should create
- a logging-log4j-VERSION directory, where VERSION is the log4j
- version number, under PATH_OF_YOUR_CHOICE. We will refer to the
- directory PATH_OF_YOUR_CHOICE/logging-log4j-VERSION/ as $LOG4J_HOME/.
-
-3) Assuming you are using log4j version 1.3, add
- $LOG4J_HOME/log4j-1.3.jar to your CLASSPATH,
-
-4) You can now test your installation by first compiling the following
- simple program.
-
- import org.apache.log4j.Logger;
- import org.apache.log4j.BasicConfigurator;
-
- public class Hello {
-
- static Logger logger = Logger.getLogger(Hello.class);
-
- public static void main(String argv[]) {
- BasicConfigurator.configure();
- logger.debug("Hello world.");
- logger.info("What a beatiful day.");
- }
- }
-
-
- After compilation, try it out by issuing the command
-
- java Hello
-
- You should see log statements appearing on the console.
-
-5) Refer to the javadoc documentation and the user manual on how to
- include log statements in your own code.
-
-=========
-JAR files
-=========
-
-The log4j distribution comes with several jar files under the
-LOG4J_HOME/ directory.
-
-* log4j-VERSION.jar
-
- Contains the core log4j classes. It also includes UGLI API hardwired
- to use log4j.
-
-* log4j-smtp.jar
-
- Contains SMTPAppender and associated classes.
-
-* log4j-oro.jar
-
- Contains LogFilePatternReceiver and LikeRule classes which are
- dependent on jakarta-oro.
-
- SMTPAppender and associated classes.
-
-* log4j-xml.jar
-
- Contains several optional classes from the org.apache.log4j.xml package.
-
-* log4j-optional.jar
-
- Contains several optional appenders/receivers from the
- org.apache.log4j.net package.
-
-* log4j-db.jar
-
- Contains DBAppender/DBReceiver and associated classes.
-
-* log4j-jms.jar
-
- Contains JMSAppender/JMSReceiver and associated classes.
-
-* ugli-nop.jar
-
- UGLI hardwired to use the NOP implementation.
-
-* ugli-simple.jar
-
- UGLI hardwired to use the SimpleLogger implementation.
-
-* ugli-jdk14.jar
-
- UGLI hardwired to use the java.util.logger package.
-
-
-==================
-log4j dependencies
-==================
-
-Log4j is based on JDK 1.2 with the following additional requirements:
-
- ----------------------------
- Package org.apache.log4j.xml
- ----------------------------
-
- The DOMConfigurator is based on the DOM Level 1 API. The
- DOMConfigurator.configure(Element) method will work with any
- XML parser that will pass it a DOM tree.
-
- The DOMConfigurator.configure(String filename) method and its variants
- require a JAXP compatible XMLparser, for example the Apache Xerces
- parser. Compiling the DOMConfigurator requires the presence of a
- JAXP parser in the classpath.
-
- Given that Ant already ships with a compatible XML parser, you do
- *not* need to worry about setting the parser when building,
- i.e. compiling, log4j.
-
- ------------
- SMTPAppender
- ------------
-
- The SMTPAppender relies on the JavaMail API. It has been tested with
- JavaMail API version 1.2. The JavaMail API requires the
- JavaBeans Activation Framework package. You can download the
- JavaMail API at:
-
- http://java.sun.com/products/javamail/
-
- and the JavaBeans Activation Framework at:
-
- http://java.sun.com/beans/glasgow/jaf.html
-
- ----------------------
- DBAppender/DB Receiver
- ----------------------
-
- DBAppender/DB Receiver have a dependency on the JDBC API.
-
- -----------
- JMSAppender
- -----------
-
- The JMSAppender requires the JMS API as well as JNDI. The JMS API
- is usually bundled with the products of the vendors listed under
-
- http://java.sun.com/products/jms/vendors.html
-
- -----------------------
- JUnit testing framework
- -----------------------
-
- Log4j uses the JUnit framework version 3.7 for internal unit
- testing. If you want to compile the source code in the tests/
- directory, then you will need JUnit. JUnit is available from:
-
- http://www.junit.org
-
-==============
-Building log4j
-==============
-
-Like most java appilicatios today, log4j relies on ANT as its build
-tool. ANT is availale from "http://logging.apache.org/ant/". ANT
-requires a build file called build.xml which is part of this
-distribution. Required components from other projects are specified in
-the build.properties and example of which is supplied in the
-build.properties.sample file.
-
-In case of problems send an e-mail note to
-log4j-user@logging.apache.org. Please do not directly e-mail log4j
-developers. The answer to your question might be useful to other
-users. Moreover, there are many knowledgeable users on the log4j-user
-mailing lists who can quickly answer your questions.
diff --git a/LICENSE.txt b/LICENSE.txt
deleted file mode 100644
index d645695..0000000
--- a/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/NOTICE.txt b/NOTICE.txt
deleted file mode 100644
index 8bb0be4..0000000
--- a/NOTICE.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product includes source code based on Sun
-Microsystems' book titled "Java Nativer Interface:
-Programmer's Guide and Specification" and freely available
-to the public at http://java.sun.com/docs/books/jni.
diff --git a/build-chainsaw.xml b/build-chainsaw.xml
deleted file mode 100644
index 10c81ee..0000000
--- a/build-chainsaw.xml
+++ /dev/null
@@ -1,213 +0,0 @@
-<project name="chainsaw" default="usage" basedir="." >
-
- <!-- When building a Java Web Start distribution of Chainsaw, some Receivers with external dependencies need to be packaged into a seperate Jar -->
- <property name="webstart-dependant-receivers.jar" value="webstart-dependant-receivers.jar-${version}.jar"/>
-
- <!-- Construct compile classpath -->
- <path id="compile.classpath">
- <pathelement location="${javac.dest}"/>
- <pathelement location="${vfs.jar}"/>
- </path>
-
- <path id="runtime.classpath">
- <fileset dir=".">
- <include name="log4j-*.jar"/>
- </fileset>
- <pathelement location="${vfs.jar}"/>
- <pathelement location="${jaxp.parser.jar}"/>
- <pathelement location="${jakarta-.oro.jar}"/>
- <pathelement location="${jms.jar}"/>
- </path>
-
-
- <target name="usage">
- <echo>
- This build file cannot be invoked directly but only through
- its parent build file, build.xml.
- </echo>
- </target>
-
- <!-- This target is invoked through the build.chainsaw target in the parent build file
- which depends on build.core ensuring that log4j core gets built before. -->
- <target name="build.chainsaw" depends="vfs">
- <mkdir dir="${javac.dest}" />
- <javac deprecation="${deprecation}"
- srcdir="${java.source.dir}"
- debug="${debug}"
- destdir="${javac.dest}">
- <patternset>
- <include name="${stem}/chainsaw/**/*.java"/>
- <include name="${stem}/varia/ListModelAppender.java"/>
- <exclude name="${stem}/chainsaw/vfs/**/*.java" unless="vfs-present"/>
- </patternset>
- <classpath refid="compile.classpath"/>
- </javac>
- </target>
-
- <target name="log4jCheck">
- <condition property="log4jJarsPresent">
- <and>
- <available filepath="${base}" file="${log4j.jar}"/>
- <available filepath="${base}" file="log4j-xml.jar"/>
- <available filepath="${base}" file="log4j-optional.jar"/>
- </and>
- </condition>
-
-
- <fail unless="log4jJarsPresent">
- One or more of the following files are missing:
- ${log4j.jar}, log4j-xml.jar log4j-optional.jar
- </fail>
- </target>
-
-
- <target name="vfsCheck">
- <available classname="org.apache.commons.vfs.FileObject" property="vfs-present">
- <classpath refid="compile.classpath"/>
- </available>
- </target>
-
- <target name="vfs" depends="vfsCheck" unless="vfs-present">
- <echo>
- Could not find vfs classes (http://jakarta.apache.org/commons/sandbox/vfs/).
- Did you forget to set "vfs.jar" property in
- build.properties to point to a valid vfs jar file?
-
- Chainsaw will be built but will not include support
- for VFSLogFilePatternReceiver
- </echo>
- </target>
-
- <!-- ================================================================= -->
- <!-- Runs Chainsaw -->
- <!-- ================================================================= -->
-
- <target name="chainsaw" depends="chainsaw.jar, log4jCheck"
- description="Build and run Chainsaw v2 from jar file (generates Chainsaw jar if necessary)" >
-
- <!-- Need to fork to avoid problems -->
- <java classname="org.apache.log4j.chainsaw.LogUI" fork="yes">
- <sysproperty key="log4j.debug" value="${log4j.debug}"/>
- <classpath refid="runtime.classpath"/>
- </java>
- </target>
-
- <!-- ================================================================= -->
- <!-- Create log4j-chainsaw.jar, excluding everything else -->
- <!-- ================================================================= -->
- <target name="chainsaw.jar" depends="build.chainsaw">
- <delete>
- <fileset dir="${jar.dest}">
- <include name="${log4j-chainsaw.jar}"/>
- </fileset>
- </delete>
-
- <copy todir="${javac.dest}">
- <fileset dir="src/java" includes="**/chainsaw/**/*"/>
- </copy>
-
- <!-- JavaDoc up some Receiver and other stuff we want to be able to ship with Chainsaw-->
- <javadoc sourcepath="${java.source.dir}"
- destdir="${javac.dest}"
- version="true"
- author="true"
- use="true"
- overview="${jar.dest}/overview.html"
- doctitle="log4j version ${version}<br>API Specification"
- windowtitle="Log4j Version ${version}"
- header="<b>Log4j ${version}</b>"
- bottom="Copyright 2000-2003 Apache Software Foundation."
- >
- <fileset dir="src/java" defaultexcludes="yes">
- <include name="**/*Receiver.java" />
- </fileset>
- <classpath refid="compile.classpath"/>
-
- </javadoc>
-
-
- <jar jarfile="${jar.dest}/${log4j-chainsaw.jar}" basedir="${javac.dest}"
- includes="${stem}/chainsaw/*.class,
- ${stem}/**/*.html,
- **/*.css,
- **/resources/*,
- ${stem}/**/*BeanInfo.class,
- ${stem}/chainsaw/**/*.class,
- ${stem}/varia/ListModelAppender.class,
- ${stem}/chainsaw/layout/*,
- ${stem}/chainsaw/icons/*.gif,
- ${stem}/chainsaw/*.jpg,
- ${stem}/chainsaw/**/*.xml,
- ${stem}/chainsaw/**/*.html,
- ${stem}/chainsaw/**/*.properties,
- ${stem}/chainsaw/receivers/known.receivers,
- ${stem}/chainsaw/icons/*.jpg,
- ${stem}/chainsaw/icons/LICENCE"
- excludes="**/UnitTest**">
- <!-- we need to exclude the JMS + DB Receiver BeanInfo for webstart purposes -->
- <exclude name="**/JMS*BeanInfo.class" if="webstart" />
- <exclude name="**/DB*BeanInfo.class" if="webstart" />
- <manifest>
- <attribute name="Manifest-version" value="1.0"/>
- <section name="org/apache/log4j/">
- <attribute name="Implementation-Title" value="log4j"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
- </section>
- <attribute name="Main-Class" value="org.apache.log4j.chainsaw.LogUI"/>
- <attribute name="Class-Path" value="${log4j.jar}"/>
- </manifest>
- </jar>
- </target>
-
- <!-- ================================================================= -->
- <!-- These targets are for when we need to create a Java Web start -->
- <!-- distribution of Chainsaw -->
- <!-- ================================================================= -->
-
- <target name="webstart-dependant-receivers.jar" depends="build.chainsaw">
- <delete>
- <fileset dir="${jar.dest}">
- <include name="${webstart-dependant-receivers.jar}"/>
- </fileset>
- </delete>
-
- <jar jarfile="${jar.dest}/${webstart-dependant-receivers.jar}" basedir="${javac.dest}"
- includes="${stem}/**/JMSReceiver*.class, ${stem}/**/DBReceiver*.class">
- <manifest>
- <attribute name="Manifest-version" value="1.0"/>
- <section name="org/apache/log4j/">
- <attribute name="Implementation-Title" value="log4j"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
- </section>
- </manifest>
- </jar>
- </target>
-
- <target name="webstart" >
- <property name="webstart" value="true"/>
- <antcall target="chainsaw.jar"/>
- <antcall target="webstart-dependant-receivers.jar"/>
-
- <input
- message="Please enter key password:"
- addproperty="keypass"
- />
- <signjar verbose="false" keystore="${keystore}" alias="${alias}" storepass="${storepass}" keypass="${keypass}" >
- <fileset dir=".">
- <include name="*.jar"/>
- </fileset>
- </signjar>
-
- <zip destfile="chainsaw-bundle.zip" >
- <zipfileset dir=".">
- <include name="*.jar"/>
- </zipfileset>
- <fileset file="${jakarta-oro.jar}"/>
- <fileset file="src/chainsaw.bat"/>
- </zip>
- </target>
-
-</project>
-
diff --git a/build.properties.sample b/build.properties.sample
deleted file mode 100644
index 94a6452..0000000
--- a/build.properties.sample
+++ /dev/null
@@ -1,71 +0,0 @@
-# The jaxp interface and a jaxp parser are required to build the
-# JoranConfigurator. However, these are already available since Ant
-# needs them too. Note also that these are required to run Chainsaw.
-# They are commented out by default but may be commented in for
-# customizations, e.g. when running Chainsaw from Ant version 1.4
-# or earlier.
-
-# jaxp.home=/java/jaxp-1.1
-# jaxp-api.jar=${jaxp.home}/jaxp.jar
-# jaxp.parser.jar=${jaxp.home}/crimson.jar
-
-# JavaMail API OPTIONAL; required to build the SMTPAppender
-javamail.jar=/java/javamail-1.2/mail.jar
-activation.jar=/java/jaf-1.0.1/activation.jar
-
-# JMS OPTIONAL; required to build the JMSAppender.
-# in order to build the JMSAppender.
-jms.jar=/java/JMQ1.1/lib/jms.jar
-
-# Servlet api
-servlet-api.jar=/java/servlet-api.jar
-
-# The templates for the creation of the web-pages are inherited
-# from the parent project.
-logging-site=../logging-site
-
-# Describes the relative or full path to the Jakarta ORO Reg Exp jar file
-# Required if you wish to use LogFilePatternReceiver or LikeRule (regexp)
-#jakarta-oro.jar=../oro/jakarta-oro-2.0.8.jar
-
-# Describes the path to the VFS jar (see http://jakarta.apache.org/commons/sandbox/vfs/)
-# Required if you wish to compile the Chainsaw jar and include the
-# org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver virtual file system receiver
-# to access log files in Chainsaw
-#
-# See http://jakarta.apache.org/commons/sandbox/vfs/filesystems.html
-# for a full description of supported file systems (ssh, zip, etc).
-#
-# See http://jakarta.apache.org/commons/sandbox/vfs/download.html for
-# file system-specific jars required when running Chainsaw with a VFSLogFilePatternReceiver
-#vfs.jar=../vfs/commons-vfs-1.0-dev.jar
-
-# DBAppeder/DBReceiver OPTIONAL:
-#
-# The org.apache.log4j.db package makes use of the
-# javax.sql.DataSource interface which is included part of the JDBC
-# standard extensions. These extensions ship with JDK 1.4 and later
-# but not JDK 1.3 or 1.2.
-#
-# Download it from
-#
-# http://java.sun.com/products/jdbc/download.html#spec
-#
-#jdbc-stdext.jar=/java/lib/jdbc2_0-stdext.jar
-
-# ---------------------------------------------------
-# JNDI API REQUIRED when building log4j with JDK 1.2)
-# ---------------------------------------------------
-#
-# The JNDI API is required to build ContextJNDISelector, which has
-# become a core log4j class. The JNDI API ships with JDK 1.3 and later,
-# you do not need to load it separately. For JDK 1.2, you can get the
-# JNDI API from
-#
-# http://java.sun.com/products/jndi/downloads/index.html
-
-#jndi.jar=/java/lib/jndi.jar
-
-
-
-
diff --git a/build.xml b/build.xml
deleted file mode 100644
index 44f8add..0000000
--- a/build.xml
+++ /dev/null
@@ -1,752 +0,0 @@
-<project name="log4j" default="usage" basedir="." >
-
-
- <!-- The build.properties file defines the parth to local jar files -->
- <property file="build.properties"/>
-
- <property name="version" value="1.3alpha-6"/>
-
- <!-- The base directory relative to which most targets are built -->
- <property name="base" value="."/>
-
- <!-- The directory where source files are stored. -->
- <property name="java.source.dir" value="src/java/"/>
-
- <!-- The directory where the package-list file is found, ./ or -->
- <!-- build/ -->
- <property name="packaging.dir" value="build"/>
-
- <!-- Deprecation warning? -->
- <property name="deprecation" value="on"/>
-
- <!-- Destination for compiled files -->
- <property name="javac.dest" value="classes"/>
-
- <!-- Source directory for the examples/ -->
- <property name="examples.src" value="examples/src"/>
-
- <!-- Destination for compiled files for examples/ -->
- <property name="examples.javac.dest" value="examples/classes"/>
-
- <!-- Destination for generated jar files -->
- <property name="jar.dest" value="${basedir}"/>
-
- <!-- The jar file that the jar task will generate -->
- <property name="log4j.jar" value="log4j-${version}.jar"/>
-
- <!-- the jar file for Chainsaw that will be generated -->
- <property name="log4j-chainsaw.jar" value="log4j-chainsaw-${version}.jar"/>
-
- <!-- Destination for documentation files -->
- <property name="docs.dest" value="./docs"/>
- <!-- Source directory for xml docs -->
- <property name="xdocs.src" value="./src/xdocs"/>
-
- <!-- Javac with debug on/off. Log4j without debug on is hard to debug, so leave this settint on. -->
- <property name="debug" value="on"/>
-
- <!-- Destination for javadoc generated files -->
- <property name="javadoc.dest" value="docs/api"/>
-
- <!-- Icons source directory. -->
- <property name="icons.source" value="icons"/>
-
- <!-- The stem where most log4j source code is located. -->
- <property name="stem" value="org/apache/log4j"/>
-
- <!-- Some targets needs a more precise stem. -->
- <property name="BSTEM" value="${java.source.dir}/${stem}"/>
-
- <!-- Directory where release images go. -->
- <property name="dist.images" value="dist/images"/>
-
- <!-- Directory for temporary files. -->
- <property name="dist.tmp" value="dist/tmp"/>
-
- <!-- Note that this property is duplicated in ugli.xml -->
- <property name="path2ugli.properties" value="./classes/ugli.properties"/>
-
- <!-- Construct compile classpath -->
- <path id="compile.classpath">
- <pathelement location="${javac.dest}"/>
- <pathelement location="${javamail.jar}"/>
- <pathelement location="${activation.jar}"/>
- <pathelement location="${jaxp.jaxp.jar}"/>
- <pathelement location="${jaxp.parser.jar}"/>
- <pathelement location="${jms.jar}"/>
- <pathelement location="${jmx.jar}"/>
- <pathelement location="${jmx-extra.jar}"/>
- <pathelement location="${servlet-api.jar}"/>
- <pathelement location="${jdbc-stdext.jar}"/>
- <pathelement location="${jndi.jar}"/>
- <pathelement location="${jakarta-oro.jar}"/>
- </path>
-
- <!-- Construct classpath for building the html pages-->
- <path id="site.classpath">
- <fileset dir="${logging-site}/lib">
- <include name="*.jar"/>
- </fileset>
- </path>
-
-
- <!-- ================================================================= -->
- <!-- Default target -->
- <!-- ================================================================= -->
-
- <target name="usage">
- <echo>
- These are the targets supported by this ANT build scpript:
-
- build.core - compile core log4j classes. This target is dependent on JAXP, JNDI.
-
- build.jms - build classes dependent on the JMS API.
- build.db - build classes dependent on JDBC API
- build.smtp - build classes dependent on Java Mail API
- build.xml - build classes in the org.apache.log4j.xml package
- build - compile all project files
-
- log4j.jar - build the core log4j jar
- log4j-'dep'.jar - where 'dep' is one of "optional", "jms", "db", "smtp" and "xml".
- jar - build all jar files
-
- build.chainsaw - build chainsaw classes
- chainsaw.har - build chainsaw.jar
- chainsaw - run chainsaw
-
- javadoc - build project javadoc files
-
- dist - will create a complete distribution in dist/
- </echo>
- </target>
-
- <target name="jaxpCheck">
- <available classname="javax.xml.parsers.DocumentBuilderFactory"
- property="jaxp-present"/>
- <fail unless="jaxp-present">
-
- Could not find the JAXP API.
-
- Please set the jaxp-api.jar property in the build.properties file.
- </fail>
-
- </target>
-
- <target name="jndiCheck">
- <available classname="javax.naming.Context" property="jndi-present">
- <classpath refid="compile.classpath"/>
- </available>
- <fail unless="jndi-present">
-
- The JNDI API is required to build ContextJNDISelector, which has
- become a core log4j class. The JNDI API ships with JDK 1.3 and
- later. For JDK 1.2, you can get the JNDI API from
-
- http://java.sun.com/products/jndi/downloads/index.html
-
- </fail>
- </target>
- <target name="jndi" depends="jndiCheck" if="jndi-present">
- <echo message="JNDI is present."/>
- </target>
-
- <target name="oroCheck" >
- <available classname="org.apache.oro.text.perl.Perl5Util" property="oro-present">
- <classpath refid="compile.classpath"/>
- </available>
-
- <fail unless="oro-present">
-
- Missing org.apache.oro.* classes.
-
- Please make sure to that the "jakarta-oro.jar" poperty in build.properties
- file is set correctly.
-
- </fail>
-
- </target>
-
- <target name="jmsCheck" depends="jndiCheck">
- <available classname="javax.jms.Message" property="jms-present">
- <classpath refid="compile.classpath"/>
- </available>
- <fail unless="jms-present">
-
- Missing java.jms.* classes.
-
- Please make sure to that the "jms.jar" poperty in build.properties
- file is set correctly.
-
- </fail>
- </target>
-
- <target name="javamailCheck">
- <available classname="javax.mail.Message" property="javamail-present">
- <classpath refid="compile.classpath"/>
- </available>
- <fail unless="javamail-present">
-
- Missing java.mail.* classes.
-
- Please make sure to that the "jms.jar" poperty in build.properties
- file is set correctly.
-
- </fail>
-
- </target>
-
- <target name="servletAPICheck">
- <available classname="javax.servlet.ServletContext" property="servletAPI-present">
- <classpath refid="compile.classpath"/>
- </available>
- <fail unless="servletAPI-present">
- Missing javax.servlet.* classes.
-
- Please make sure to that the "servlet-api.jar" poperty in build.properties
- file is set correctly.
-
- </fail>
- </target>
-
-
- <target name="jdbcExtensionCheck">
- <available classname="javax.sql.DataSource" property="jdbcExtension-present">
- <classpath refid="compile.classpath"/>
- </available>
- <fail unless="jdbcExtension-present">
- Missing javax.sql.* classes.
-
- Please make sure to that the "jdbc-stdext.jar" poperty in build.properties
- file is set correctly.
-
- </fail>
- </target>
-
-
- <target name="init">
- <tstamp />
- <mkdir dir="${javac.dest}/"/>
- <mkdir dir="${examples.javac.dest}/" />
- </target>
-
-
- <target name="build" description="Compile all log4j components."
- depends="build.core, build.oro, build.jms, build.smtp, build.db,
- build.examples, build.chainsaw"/>
-
- <target name="requiredepsCheck"
- depends="jndiCheck,jmsCheck,oroCheck,javamailCheck,servletAPICheck,jdbcExtensionCheck,jaxpCheck"
- description="Compile all log4j components - fail if dependencies do not exist"
- >
- <condition property="alldeps.exist">
- <and>
- <isset property="jndi-present"/>
- <isset property="oro-present"/>
- <isset property="jms-present"/>
- <isset property="javamail-present"/>
- <isset property="servletAPI-present"/>
- <isset property="jdbcExtension-present"/>
- <isset property="jaxp-present"/>
- </and>
- </condition>
- <fail unless="alldeps.exist">
- Some jar files required to perform a full compile of log4j are not
- available on the classpath. Update build.properties as needed.
- </fail>
- </target>
-
- <target name="build.core" depends="init, jndiCheck, jaxpCheck">
- <javac srcdir="${java.source.dir}"
- destdir="${javac.dest}"
- includes="org/apache/ugli/**/*.java,
- ${stem}/**/*.java"
- excludes="org/apache/ugli/impl/JDK14*.java,
- **/UnitTest*.java,
- **/StressCategory.java,
- **/doc-files/*,
- ${stem}/chainsaw/**,
- ${stem}/db/**,
- ${stem}/test/serialization/**,
- ${stem}/net/SMTPAppender.java,
- ${stem}/net/JMS*.java,
- ${stem}/varia/LogFilePatternReceiver*.java,
- ${stem}/rule/LikeRule.java,
- ${stem}/or/jms/*.java,
- ${stem}/selector/servlet/*.java"
- deprecation="on"
- debug="${debug}"
- >
- <classpath refid="compile.classpath"/>
- </javac>
- </target>
-
-
- <target name="build.chainsaw" depends="build.core, build.oro, build.xml">
- <ant antfile="build-chainsaw.xml" target="build.chainsaw"/>
- </target>
-
- <target name="chainsaw.jar" depends="build.chainsaw, log4j.jar,
- log4j-xml.jar,
- log4j-optional.jar">
- <ant antfile="build-chainsaw.xml" target="chainsaw.jar"/>
- </target>
-
- <target name="chainsaw" depends="log4j.jar, log4j-xml.jar, log4j-optional.jar"
- description="Builds and runs Chainsaw v2" >
- <ant antfile="build-chainsaw.xml" target="chainsaw"/>
- </target>
-
- <target name="webstart" depends="build.chainsaw">
- <ant antfile="build-chainsaw.xml" target="webstart"/>
- </target>
-
-
- <!-- ================================================= -->
- <!-- Compile examples -->
- <!-- ================================================= -->
-
- <target name="build.examples" depends="build.core">
- <mkdir dir="${examples.javac.dest}" />
- <javac srcdir="${examples.src}"
- destdir="${examples.javac.dest}"
- includes="**/*.java"
- excludes="**/jmx/*.java"
- deprecation="${deprecation}"
- debug="${debug}"
- >
- <classpath refid="compile.classpath"/>
- </javac>
-
- <rmic base="${examples.javac.dest}" classname="factor.NumberCruncherServer" />
- </target>
-
- <target name="ugli.jar">
- <ant antfile="ugli.xml" target="jar"/>
- </target>
-
- <target name="build.xml" depends="init, jaxpCheck">
- <javac srcdir="${java.source.dir}"
- destdir="${javac.dest}"
- includes="${stem}/xml/**/*.java"
- excludes="${stem}/xml/DOMConfigurator.java,
- ${stem}/xml/examples/doc-files/**.java"
- deprecation="${deprecation}"
- debug="${debug}"
- >
- <classpath refid="compile.classpath"/>
- </javac>
- <copy file="${BSTEM}/xml/log4j.dtd"
- tofile="${javac.dest}/${stem}/xml/log4j.dtd" />
- <copy file="${BSTEM}/xml/logger.dtd"
- tofile="${javac.dest}/${stem}/xml/logger.dtd" />
- </target>
-
- <target name="log4j-xml.jar" depends="init, jaxpCheck, build.xml">
- <jar jarfile="log4j-xml.jar" basedir="${javac.dest}"
- includes="${stem}/xml/*.class,
- ${stem}/xml/*.dtd"
- excludes="${stem}/xml/DOMConfigurator.class,
- ${stem}/xml/XMLLayout.class"
- >
- <manifest>
- <section name="org/apache/log4j/">
- <attribute name="Implementation-Title" value="log4j-xml"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
- </section>
- </manifest>
- </jar>
- </target>
-
-
- <target name="build.smtp" depends="init, javamailCheck">
- <javac srcdir="${java.source.dir}"
- destdir="${javac.dest}"
- debug="${debug}"
- deprecation="${deprecation}"
- includes="${stem}/net/SMTPAppender.java"
- >
- <classpath refid="compile.classpath"/>
- </javac>
- </target>
-
- <target name="log4j-smtp.jar" depends="init, build.smtp"
- if="javamail-present">
- <jar jarfile="log4j-smtp.jar" basedir="${javac.dest}"
- includes="${stem}/spi/TriggeringEventEvaluator.class,
- ${stem}/net/SMTPAppender.class,
- ${stem}/net/DefaultEvaluator.class"
- >
- <manifest>
- <section name="org/apache/log4j/">
- <attribute name="Implementation-Title" value="log4j-jms"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
- </section>
- </manifest>
- </jar>
- </target>
-
- <!-- Jakarta-ORO dependencies -->
-
- <target name="build.oro" depends="init, oroCheck">
- <javac srcdir="${java.source.dir}"
- destdir="${javac.dest}"
- deprecation="${deprecation}"
- includes="${stem}/varia/LogFilePatternReceiver*.java,
- ${stem}/rule/LikeRule.java"
- debug="${debug}"
- >
- <classpath refid="compile.classpath"/>
- </javac>
- </target>
-
- <target name="log4j-oro.jar" depends="init, oroCheck, build.oro">
- <jar jarfile="log4j-oro.jar" basedir="${javac.dest}"
- includes="${stem}/varia/LogFilePatternReceiver*.class,
- ${stem}/rule/LikeRule.class"
- >
- <manifest>
- <section name="org/apache/log4j/">
- <attribute name="Implementation-Title" value="log4j-oro"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
- </section>
- </manifest>
-
- </jar>
- </target>
-
- <!-- JMS API dependencies -->
-
- <target name="build.jms" depends="init, jmsCheck, jndi">
- <javac srcdir="${java.source.dir}"
- debug="${debug}"
- deprecation="${deprecation}"
- destdir="${javac.dest}"
- includes="${stem}/net/JMS*.java"
- >
- <classpath refid="compile.classpath"/>
- </javac>
- </target>
-
- <target name="log4j-jms.jar" depends="init, build.jms"
- if="jms-present">
- <jar jarfile="log4j-jms.jar" basedir="${javac.dest}"
- includes="${stem}/net/JMSAppender.class,
- ${stem}/net/JMSSink.class,
- ${stem}/net/JMSReceiver.class,
- ${stem}/or/jms/*.class"
- >
- <manifest>
- <section name="org/apache/log4j/">
- <attribute name="Implementation-Title" value="log4j-jms"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
- </section>
- </manifest>
- </jar>
- </target>
-
- <target name="build.servletAPI" depends="init, servletAPICheck">
- <javac srcdir="${java.source.dir}"
- destdir="${javac.dest}"
- debug="${debug}"
- deprecation="${deprecation}"
- includes="${stem}/selector/servlet/*.java">
- <classpath refid="compile.classpath"/>
- </javac>
- </target>
-
- <target name="build.db" depends="init, jdbcExtensionCheck">
- <javac srcdir="${java.source.dir}"
- destdir="${javac.dest}"
- deprecation="${deprecation}"
- debug="${debug}"
- includes="${stem}/db/**.java">
- <classpath refid="compile.classpath"/>
- </javac>
- </target>
-
- <target name="log4j-db.jar" depends="init, jdbcExtensionCheck">
- <jar jarfile="log4j-db.jar" basedir="${javac.dest}"
- includes="${stem}/db/**.class"
- >
- <manifest>
- <section name="org/apache/log4j/">
- <attribute name="Implementation-Title" value="log4j-db"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
- </section>
- </manifest>
- </jar>
- </target>
-
- <target name="log4j-optional.jar" depends="init, build.core">
- <jar jarfile="log4j-optional.jar" basedir="${javac.dest}"
- includes="${stem}/net/Multicast*.class,
- ${stem}/net/UDP*.class,
- ${stem}/net/SocketHub*.class,
- ${stem}/net/Telnet*.class"
- >
- <manifest>
- <section name="org/apache/log4j/">
- <attribute name="Implementation-Title" value="log4j-db"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
- </section>
- </manifest>
- </jar>
- </target>
-
- <!-- ================================================================= -->
- <!-- Remove all generated (compiled) class files. -->
- <!-- ================================================================= -->
- <target name="clean" depends="init" description="Delete all compiled files.">
- <delete>
- <fileset dir="${javac.dest}/" includes="**/*"/>
- <fileset dir="${examples.javac.dest}/" includes="**/*"/>
- <fileset dir="." includes="log4j*.jar"/>
- <fileset dir="." includes="ugli-*.jar"/>
- </delete>
- </target>
-
- <!-- ================================================================= -->
- <!-- Actual work is done in the dependencies. -->
- <!-- ================================================================= -->
- <target name="jar" depends="ugli.jar, log4j.jar, log4j-optional.jar,
- chainsaw.jar, log4j-jms.jar, log4j-smtp.jar,
- log4j-db.jar, log4j-oro.jar, log4j-xml.jar">
- </target>
-
- <!-- ================================================================= -->
- <!-- Create log4j.jar, excluding tests and other odds and ends. -->
- <!-- ================================================================= -->
- <target name="log4j.jar" depends="build.core, build.servletAPI">
-
- <delete file="${log4j.jar}" verbose="true"/>
- <delete file="${path2ugli.properties}"/>
-
- <!-- Much depends on setting up ugli.properties file correctly -->
- <propertyfile file="${path2ugli.properties}" comment="log4j implementation">
- <entry key="ugli.factoryAdapterClass" value="org.apache.ugli.impl.Log4jLoggerFA"/>
- </propertyfile>
-
- <jar jarfile="${jar.dest}/${log4j.jar}" basedir="${javac.dest}"
- includes="ugli.properties,
- org/apache/ugli/**/*.class
- ${stem}/*.class,
- ${stem}/joran/**/*.class,
- ${stem}/config/*.class,
- ${stem}/helpers/*.class,
- ${stem}/spi/**/*.class,
- ${stem}/net/*.class,
- ${stem}/html/**/*.class,
- ${stem}/filter/*.class,
- ${stem}/rule/*.class,
- ${stem}/rolling/**/*.class,
- ${stem}/xml/*.class,
- ${stem}/scheduler/*.class,
- ${stem}/selector/*.class,
- ${stem}/selector/servlet/*.class,
- ${stem}/pattern/*.class,
- ${stem}/or/*.class,
- ${stem}/or/sax/*.class,
- ${stem}/varia/ListAppender.class
- ${stem}/plugins/*.class,
- ${stem}/config/*.class"
- excludes="org/apache/ugli/**/JDK14*.class,
- **/UnitTest**,
- ${stem}/xml/Log4jEntityResolver.class,
- ${stem}/xml/UtilLoggingEntityResolver.class,
- ${stem}/xml/SAXErrorHandler.class,
- ${stem}/xml/UtilLoggingXMLDecoder.class,
- ${stem}/xml/XMLDecoder.class,
- ${stem}/net/SMTPAppender.class,
- ${stem}/net/DefaultEvaluator.class,
- ${stem}/spi/TriggeringEventEvaluator.class,
- ${stem}/net/JMSAppender.class,
- ${stem}/net/JMSSink.class,
- ${stem}/net/JMSReceiver.class,
- ${stem}/**/*BeanInfo.class
- ${stem}/varia/LogFilePatternReceiver*.class,
- ${stem}/rule/LikeRule.class,
- ${stem}/net/Multicast*.class,
- ${stem}/net/UDP*.class,
- ${stem}/net/SocketHub*.class,
- ${stem}/net/Telnet*.class,
- ${stem}/pattern/StackPatternConverter.class,
- ${stem}/DUMMY.java"
- >
- <manifest>
- <attribute name="Manifest-version" value="1.0"/>
- <section name="org/apache/log4j/">
- <attribute name="Implementation-Title" value="log4j"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
- </section>
- </manifest>
- </jar>
-
- <!-- remove ugli.properties when done -->
- <delete file="${path2ugli.properties}"/>
-
- </target>
-
-
- <!-- ================================================================= -->
- <!-- This target builds the javadoc files. -->
- <!-- ================================================================= -->
- <target name="javadoc" depends="init">
-
- <mkdir dir="${javadoc.dest}" />
-
- <javadoc sourcepath="${java.source.dir}"
- destdir="${javadoc.dest}"
- packagenames="org.apache.log4j,
- org.apache.log4j.db,
- org.apache.log4j.db.dialect,
- org.apache.log4j.plugins,
- org.apache.log4j.config,
- org.apache.log4j.helpers,
- org.apache.log4j.net,
- org.apache.log4j.nt,
- org.apache.log4j.or,
- org.apache.log4j.or.sax,
- org.apache.log4j.or.jms,
- org.apache.log4j.pattern,
- org.apache.log4j.rolling,
- org.apache.log4j.rolling.helper,
- org.apache.log4j.selector,
- org.apache.log4j.spi,
- org.apache.log4j.filter,
- org.apache.log4j.varia,
- org.apache.log4j.rule,
- org.apache.log4j.xml,
- org.apache.log4j.xml.examples,
- org.apache.joran,
- org.apache.joran.action,
- org.apache.log4j.joran,
- org.apache.log4j.joran.action,
- org.apache.ugli,
- org.apache.ugli.impl"
- additionalparam="-breakiterator"
- version="true"
- protected="true"
- author="true"
- use="true"
- overview="${docs.dest}/overview.html"
- doctitle="log4j version ${version}<br>API Specification"
- windowtitle="Log4j Version ${version}"
- header="<b>Log4j ${version}</b>"
- bottom="Copyright 2000-2005 Apache Software Foundation.">
-
- <link href="http://java.sun.com/products/j2se/1.3/docs/api/"/>
- <link href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/"/>
- <classpath refid="compile.classpath"/>
- <classpath path="${regexp.oro.jar}"/>
- </javadoc>
- </target>
-
- <!-- ============================================== -->
- <!-- Build the site files using Anakia -->
- <!-- ============================================== -->
- <target name="prepareSite">
- <available classname="org.apache.velocity.anakia.AnakiaTask"
- property="AnakiaTask.present">
- <classpath refid="site.classpath"/>
- </available>
- </target>
-
- <target name="checkSite" depends="prepareSite" unless="AnakiaTask.present">
- <echo>
- AnakiaTask is not present! Please check to make sure that
- velocity.jar is in your classpath.
- </echo>
- </target>
-
- <target name="site" depends="checkSite" if="AnakiaTask.present">
- <taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask">
- <classpath refid="site.classpath"/>
- </taskdef>
-
- <mkdir dir="${docs.dest}/css"/>
- <copy file="${logging-site}/docs/css/site.css" tofile="${docs.dest}/css/site.css"/>
-
- <anakia basedir="${xdocs.src}" destdir="${docs.dest}/"
- extension=".html"
- style="site.vsl"
- projectFile="stylesheets/project.xml"
- excludes="**/stylesheets/**, empty.xml"
- includes="**/*.xml"
- lastModifiedCheck="true"
- templatePath="${logging-site}/src/xdocs/stylesheets">
- </anakia>
-
- </target>
-
-
- <!-- ================================================================= -->
- <!-- Build a complete distribution. Results go to ${dist.images} -->
- <!-- ================================================================= -->
- <target name="dist" depends="init, clean, requiredepsCheck, javadoc, jar, site">
-
- <delete verbose="true">
- <fileset dir=".">
- <patternset>
- <include name="**/*.bak"/>
- <include name="${BSTEM}/**/temp*"/>
- <include name="${BSTEM}/performance/test"/>
- <include name="${BSTEM}/test/current.*"/>
- <include name="${BSTEM}/test/current.*"/>
- <include name="${BSTEM}/examples/test"/>
- <include name="${BSTEM}/test/logging.*"/>
- <include name="${BSTEM}/test/log4j.properties"/>
- <include name="${$BSTEM}/test/socket.lcf"/>
- <include name="${BSTEM}/test/file"/>
- <include name="${BSTEM}/net/test/loop.log"/>
- <include name="${BSTEM}/net/test/loop.log.1"/>
- </patternset>
- </fileset>
- </delete>
-
- <mkdir dir="${dist.images}" />
-
- <mkdir dir="${dist.tmp}/logging-log4j-${version}" />
-
- <copy todir="${dist.tmp}/logging-log4j-${version}">
- <fileset dir="${base}"
- includes="src/java/**,
- docs/**,
- examples/**,
- build.xml,
- build.properties.sample,
- INSTALL.txt,
- LICENSE.txt,
- ugli-*.jar,
- log4j-*.jar"
- excludes="**/*.bak,
- **/goEnv.bat,
- docs/pub-support/*,
- src/java/org/apache/log4j/test/**/*,
- **/.#*"
- />
- </copy>
-
- <tar tarfile="${dist.images}/logging-log4j-${version}.tar"
- basedir="${dist.tmp}"
- includes="logging-log4j-${version}/**" />
-
- <gzip src="${dist.images}/logging-log4j-${version}.tar"
- zipfile="${dist.images}/logging-log4j-${version}.tar.gz" />
-
- <zip zipfile="${dist.images}/logging-log4j-${version}.zip"
- basedir="${dist.tmp}"
- includes="logging-log4j-${version}/**" />
-
-
- <delete dir="${dist.tmp}" />
- </target>
-
-</project>
-
diff --git a/contribs/CONTENTS b/contribs/CONTENTS
deleted file mode 100644
index fdbd580..0000000
--- a/contribs/CONTENTS
+++ /dev/null
@@ -1,101 +0,0 @@
-
-----------------------------------------------------------------------
-WARNING: The contents of the contribs/ directory is not guaranteed to
-work properly. Some files might not even compile.
-----------------------------------------------------------------------
-
-Each directory corresponds to the name of an author containing his/her
-contributions.
-
-
-EirikLygre/
-==========
-
- DailyFileAppender1.java
-
- DailyFileAppender extends FileAppender to use filenames formatted with
- date/time information. The filename is recomputed every day at midnight.
- Note that the filename doesn't have to change every day, making it possible
- to have logfiles which are per-week or per-month.
-
-JamesHouse/
-==========
-
- LogTextPanel.java
- LogTextPanelExample.java
- TextPanelAppender.java
-
-JimMoore/
-========
-
- LoggingOutputStream.java
-
- Allows the user to divert System.out and System.err to log4j.
-
- WARNING: Be sure to read the included e-mails to understand the dangers of
- WARNING: redirecting the console to LoggingOutputStream.
-
-
-LeosLiterak/
-===========
-
- TempFileAppender.java
-
- TempFileAppender creates new unique file for each logging statement.
-
-MarkDouglas/
-===========
-
- SocketNode2.java
- SocketServer2.java
-
- Small changes to SocketServer and SockerNode to allow the client machine name
- to be displayed in the logging output. This is important for us as we are
- using a single logging server with several clients.
-
-KevinSteppe/
-===========
-
- JDBCAppender.java
- JDBCTest.java
-
-
-KitchingSimon/
-=============
-
- DatagramStringAppender.java
- DatagramStringWriter.java
- logconfig.xml
- SingleLineTracerPrintWriter.java
- udpserver.pl
-
- A set of files that implement an Appender which sends messages to a
- remote host/port via UDP (datagram). Message formatting is
- performed at the at the client end, mainly so that:
- (a) the UDP server application does not have to be in java
- (b) non-java clients can send messages to the same UDP server.
-
-ThomasFenner/
-============
-
- Yet one more JDBCAppender.
-
- JDBCAppender.java
- JDBCConnectionHandler.java
- JDBCIDHandler.java
- JDBCLogger.java
- Log4JTest.java
- code_example1.java
- code_example2.java
- configfile_example.txt
-
-Volker Mentzner/
-===============
-
- HTTPRequestHandler.java
- Log4jRequestHandler.java
- PluggableHTTPServer.java
- RootRequestHandler.java
- UserDialogRequestHandler.java
-
- Allows users to configure log4j at runtime using a web-browser.
\ No newline at end of file
diff --git a/contribs/CekiGulcu/AppenderTable.java b/contribs/CekiGulcu/AppenderTable.java
deleted file mode 100644
index e501960..0000000
--- a/contribs/CekiGulcu/AppenderTable.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright 1999,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.log4j.PatternLayout;
-import org.apache.log4j.helpers.CyclicBuffer;
-import org.apache.log4j.spi.LoggingEvent;
-
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.JTextArea;
-import javax.swing.table.AbstractTableModel;
-import javax.swing.table.TableCellRenderer;
-
-
-/**
- * The AppenderTable illustrates one possible implementation of an Table
- * possibly containing a great many number of rows.
- *
- * <p>
- * In this particular example we use a fixed size buffer (CyclicBuffer)
- * although this data structure could be easily replaced by dynamically
- * growing one, such as a Vector. The required properties of the data
- * structure is 1) support for indexed element access 2) support for the
- * insertion of new elements at the end.
- * </p>
- *
- * <p>
- * Experimentation on my 1400Mhz AMD machine show that it takes about 45
- * micro-seconds to insert an element in the table. This number does not
- * depend on the size of the buffer. It takes as much (or as little) time to
- * insert one million elements to a buffer of size 10 as to a buffer of size
- * 10'000. It takes about 4 seconds to insert a total of 100'000 elements
- * into the table.
- * </p>
- *
- * <p>
- * On windows NT the test will run about twice as fast if you give the focus
- * to the window that runs "java AppenderTable" and not the window that
- * contains the Swing JFrame.
- * </p>
- */
-public class AppenderTable extends JTable {
- static Logger logger = Logger.getLogger(AppenderTable.class);
-
- public AppenderTable() {
- this.setDefaultRenderer(Object.class, new Renderer());
- }
-
- public static void main(String[] args) {
- if (args.length != 2) {
- System.err.println(
- "Usage: java AppenderTable bufferSize runLength\n"
- + " where bufferSize is the size of the cyclic buffer in the TableModel\n"
- + " and runLength is the total number of elements to add to the table in\n"
- + " this test run.");
-
- return;
- }
-
- JFrame frame = new JFrame("JTableAppennder test");
- Container container = frame.getContentPane();
-
- AppenderTable tableAppender = new AppenderTable();
-
- int bufferSize = Integer.parseInt(args[0]);
- AppenderTableModel model = new AppenderTableModel(bufferSize);
- tableAppender.setModel(model);
-
- int runLength = Integer.parseInt(args[1]);
-
- JScrollPane sp = new JScrollPane(tableAppender);
- sp.setPreferredSize(new Dimension(250, 80));
-
- container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS));
- container.add(sp);
-
- // The "ADD" button is intended for manual testing. It will
- // add one new logging event to the table.
- JButton button = new JButton("ADD");
- container.add(button);
- button.addActionListener(new JTableAddAction(tableAppender));
-
- frame.setSize(new Dimension(500, 300));
- frame.setVisible(true);
-
- long before = System.currentTimeMillis();
-
- int i = 0;
-
- while (i++ < runLength) {
- LoggingEvent event =
- new LoggingEvent("x", logger, Level.ERROR, "Message " + i, null);
- tableAppender.doAppend(event);
- }
-
- long after = System.currentTimeMillis();
-
- long totalTime = (after - before);
-
- System.out.println(
- "Total time :" + totalTime + " milliseconds for "
- + "runLength insertions.");
- System.out.println(
- "Average time per insertion :" + ((totalTime * 1000) / runLength)
- + " micro-seconds.");
- }
-
- /**
- * When asked to append we just insert directly into the model. In a real
- * appender we would use two buffers one for accumulating events and
- * another to accumalte events but after filtering. Only the second buffer
- * would be displayed in the table and made visible to the user.
- */
- public void doAppend(LoggingEvent event) {
- ((AppenderTableModel) getModel()).insert(event);
- }
-
- /**
- * The Renderer is required to display object in a friendlier from. This
- * particular renderer is just a JTextArea.
- *
- * <p>
- * The important point to note is that we only need one renderer.
- * </p>
- */
- class Renderer extends JTextArea implements TableCellRenderer {
- PatternLayout layout;
-
- public Renderer() {
- layout = new PatternLayout("%r %p %c [%t] - %m");
- }
-
- public Component getTableCellRendererComponent(
- JTable table, Object value, boolean isSelected, boolean hasFocus, int row,
- int column) {
- // If its a LoggingEvent than format it using our layout.
- if (value instanceof LoggingEvent) {
- LoggingEvent event = (LoggingEvent) value;
- String str = layout.format(event);
- setText(str);
- } else {
- setText(value.toString());
- }
-
- return this;
- }
- }
-}
-
-
-class AppenderTableModel extends AbstractTableModel {
- CyclicBuffer cb;
-
- AppenderTableModel(int size) {
- cb = new CyclicBuffer(size);
- }
-
- /**
- * Insertion to the model always results in a fireTableDataChanged method
- * call. Suprisingly enough this has no crippling impact on performance.
- */
- public void insert(LoggingEvent event) {
- cb.add(event);
- fireTableDataChanged();
- }
-
- /**
- * We assume only one column.
- */
- public int getColumnCount() {
- return 1;
- }
-
- /**
- * The row count is given by the number of elements in the buffer. This
- * number is guaranteed to be between 0 and the buffer size (inclusive).
- */
- public int getRowCount() {
- return cb.length();
- }
-
- /**
- * Get the value in a given row and column. We suppose that there is only
- * one colemn so we are only concerned with the row.
- *
- * <p>
- * Interesting enough this method returns an object. This leaves the door
- * open for a TableCellRenderer to render the object in a variety of ways.
- * </p>
- */
- public Object getValueAt(int row, int col) {
- return cb.get(row);
- }
-}
-
-
-/**
- * The JTableAddAction is called when the user clicks on the "ADD" button.
- */
-class JTableAddAction implements ActionListener {
- AppenderTable appenderTable;
- Logger dummy = Logger.getLogger("x");
- int counter = 0;
-
- public JTableAddAction(AppenderTable appenderTable) {
- this.appenderTable = appenderTable;
- }
-
- public void actionPerformed(ActionEvent e) {
- counter++;
-
- LoggingEvent event =
- new LoggingEvent("x", dummy, Level.DEBUG, "Message " + counter, null);
- appenderTable.doAppend(event);
- }
-}
diff --git a/contribs/CekiGulcu/Transform.java b/contribs/CekiGulcu/Transform.java
deleted file mode 100644
index b9432a2..0000000
--- a/contribs/CekiGulcu/Transform.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright 1999,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.log4j.xml;
-
-import org.apache.log4j.Category;
-import org.apache.log4j.Layout;
-import org.apache.log4j.PropertyConfigurator;
-import org.apache.log4j.helpers.DateLayout;
-import org.apache.log4j.helpers.OptionConverter;
-import org.apache.log4j.spi.LoggingEvent;
-
-import org.apache.serialize.OutputFormat;
-import org.apache.serialize.Serializer;
-import org.apache.serialize.SerializerFactory;
-
-import org.apache.trax.Processor;
-import org.apache.trax.ProcessorException;
-import org.apache.trax.ProcessorFactoryException;
-import org.apache.trax.Result;
-import org.apache.trax.Templates;
-import org.apache.trax.TemplatesBuilder;
-import org.apache.trax.TransformException;
-import org.apache.trax.Transformer;
-
-import org.apache.xerces.parsers.SAXParser;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.AttributesImpl;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-
-public class Transform {
- public static void main(String[] args) throws Exception {
- PropertyConfigurator.disableAll();
- PropertyConfigurator.configure("x.lcf");
-
- // I. Instantiate a stylesheet processor.
- Processor processor = Processor.newInstance("xslt");
-
- // II. Process the stylesheet. producing a Templates object.
- // Get the XMLReader.
- XMLReader reader = XMLReaderFactory.createXMLReader();
-
- // Set the ContentHandler.
- TemplatesBuilder templatesBuilder = processor.getTemplatesBuilder();
- reader.setContentHandler(templatesBuilder);
-
- // Set the ContentHandler to also function as a LexicalHandler, which
- // includes "lexical" (e.g., comments and CDATA) events. The Xalan
- // TemplatesBuilder -- org.apache.xalan.processor.StylesheetHandler -- is
- // also a LexicalHandler).
- if (templatesBuilder instanceof LexicalHandler) {
- reader.setProperty(
- "http://xml.org/sax/properties/lexical-handler", templatesBuilder);
- }
-
- // Parse the stylesheet.
- reader.parse(args[0]);
-
- //Get the Templates object from the ContentHandler.
- Templates templates = templatesBuilder.getTemplates();
-
- // III. Use the Templates object to instantiate a Transformer.
- Transformer transformer = templates.newTransformer();
-
- // IV. Perform the transformation.
- // Set up the ContentHandler for the output.
- FileOutputStream fos = new FileOutputStream(args[2]);
- Result result = new Result(fos);
- Serializer serializer = SerializerFactory.getSerializer("xml");
- serializer.setOutputStream(fos);
-
- transformer.setContentHandler(serializer.asContentHandler());
-
- // Set up the ContentHandler for the input.
- org.xml.sax.ContentHandler chandler = transformer.getInputContentHandler();
- DC dc = new DC(chandler);
- reader.setContentHandler(dc);
-
- if (chandler instanceof LexicalHandler) {
- reader.setProperty(
- "http://xml.org/sax/properties/lexical-handler", chandler);
- } else {
- reader.setProperty(
- "http://xml.org/sax/properties/lexical-handler", null);
- }
-
- // Parse the XML input document. The input ContentHandler and
- // output ContentHandler work in separate threads to optimize
- // performance.
- reader.parse(args[1]);
- }
-}
-
-
-class DC implements ContentHandler {
- static Category cat = Category.getInstance("DC");
- ContentHandler chandler;
-
- DC(ContentHandler chandler) {
- this.chandler = chandler;
- }
-
- public void characters(char[] ch, int start, int length)
- throws org.xml.sax.SAXException {
- cat.debug("characters: [" + new String(ch, start, length) + "] called");
- chandler.characters(ch, start, length);
- }
-
- public void endDocument() throws org.xml.sax.SAXException {
- cat.debug("endDocument called.");
- chandler.endDocument();
- }
-
- public void endElement(String namespaceURI, String localName, String qName)
- throws org.xml.sax.SAXException {
- cat.debug(
- "endElement(" + namespaceURI + ", " + localName + ", " + qName
- + ") called");
- chandler.endElement(namespaceURI, localName, qName);
- }
-
- public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException {
- cat.debug("endPrefixMapping(" + prefix + ") called");
- chandler.endPrefixMapping(prefix);
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws org.xml.sax.SAXException {
- cat.debug("ignorableWhitespace called");
- chandler.ignorableWhitespace(ch, start, length);
- }
-
- public void processingInstruction(
- java.lang.String target, java.lang.String data)
- throws org.xml.sax.SAXException {
- cat.debug("processingInstruction called");
- chandler.processingInstruction(target, data);
- }
-
- public void setDocumentLocator(Locator locator) {
- cat.debug("setDocumentLocator called");
- chandler.setDocumentLocator(locator);
- }
-
- public void skippedEntity(String name) throws org.xml.sax.SAXException {
- cat.debug("skippedEntity(" + name + ") called");
- chandler.skippedEntity(name);
- }
-
- public void startDocument() throws org.xml.sax.SAXException {
- cat.debug("startDocument called");
- chandler.startDocument();
- }
-
- public void startElement(
- String namespaceURI, String localName, String qName, Attributes atts)
- throws org.xml.sax.SAXException {
- cat.debug(
- "startElement(" + namespaceURI + ", " + localName + ", " + qName
- + ")called");
-
- if ("log4j:event".equals(qName)) {
- cat.debug("-------------");
-
- if (atts instanceof org.xml.sax.helpers.AttributesImpl) {
- AttributesImpl ai = (AttributesImpl) atts;
- int i = atts.getIndex("timestamp");
- ai.setValue(i, "hello");
- }
-
- String ts = atts.getValue("timestamp");
- cat.debug("New timestamp is " + ts);
- }
-
- chandler.startElement(namespaceURI, localName, qName, atts);
- }
-
- public void startPrefixMapping(String prefix, String uri)
- throws org.xml.sax.SAXException {
- cat.debug("startPrefixMapping(" + prefix + ", " + uri + ") called");
- chandler.startPrefixMapping(prefix, uri);
- }
-}
diff --git a/contribs/EirikLygre/DailyFileAppender1.java b/contribs/EirikLygre/DailyFileAppender1.java
deleted file mode 100644
index e724377..0000000
--- a/contribs/EirikLygre/DailyFileAppender1.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
- *
- * This software is published under the terms of the Apache Software
- * License version 1.1, a copy of which has been included with this
- * distribution in the LICENSE.APL file. */
-
-
-
-package org.apache.log4j;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.io.FileWriter;
-import java.io.File;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import org.apache.log4j.helpers.OptionConverter;
-import org.apache.log4j.helpers.QuietWriter;
-import org.apache.log4j.helpers.CountingQuietWriter;
-import org.apache.log4j.spi.LoggingEvent;
-import org.apache.log4j.spi.ErrorCode;
-
-/**
- DailyFileAppender extends FileAppender to use filenames formatted with
- date/time information. The filename is recomputed every day at midnight.
- Note that the filename doesn't have to change every day, making it possible
- to have logfiles which are per-week or per-month.
-
- The appender computes the proper filename using the formats specified in
- <a href="http://java.sun.com/j2se/1.3/docs/api/java/text/SimpleDateFormat.html">
- java.text.SimpleDateFormat</a>. The format requires that most static text is
- enclosed in single quotes, which are removed. The examples below show how
- quotes are used to embed static information in the format.
-
- Sample filenames:
-
-<code>
- Filename pattern Filename
- "'/logs/trace-'yyyy-MM-dd'.log'" /logs/trace-2000-12-31.log
- "'/logs/trace-'yyyy-ww'.log'" /logs/trace-2000-52.log
-</code>
-
- @author <a HREF="mailto:eirik.lygre@evita.no">Eirik Lygre</a>
-*/
-public class DailyFileAppender extends FileAppender {
-
- /**
- A string constant used in naming the option for setting the
- filename pattern. Current value of this string constant is
- <strong>FileNamePattern</strong>.
- */
- static final public String FILE_NAME_PATTERN_OPTION = "FilePattern";
-
- /**
- The filename pattern
- */
- private String fileNamePattern = null;
-
- /**
- The actual formatted filename that is currently being written to
- */
- private String currentFileName = null;
-
- /**
- The timestamp when we shall next recompute the filename
- */
- private long nextFilenameComputingMillis = System.currentTimeMillis () - 1;
-
- /**
- The default constructor does no longer set a default layout nor a
- default output target. */
- public
- DailyFileAppender() {
- }
-
- /**
- Instantiate a RollingFileAppender and open the file designated by
- <code>filename</code>. The opened filename will become the ouput
- destination for this appender.
-
- <p>If the <code>append</code> parameter is true, the file will be
- appended to. Otherwise, the file desginated by
- <code>filename</code> will be truncated before being opened.
- */
- public DailyFileAppender (Layout layout,String filename,boolean append) throws IOException {
- super(layout, filename, append);
- }
-
- /**
- Instantiate a FileAppender and open the file designated by
- <code>filename</code>. The opened filename will become the output
- destination for this appender.
-
- <p>The file will be appended to. */
- public DailyFileAppender (Layout layout,String filename) throws IOException {
- super(layout, filename);
- }
-
- /**
- Set the current output file.
-
- The function will compute a new filename, and open a new file only
- when the name has changed.
-
- The function is automatically called once a day, to allow for
- daily files -- the purpose of this class.
- */
-
- public
- synchronized
- void setFile(String fileName, boolean append) throws IOException {
-
- /* Compute filename, but only if fileNamePattern is specified */
- if (fileNamePattern == null) {
- errorHandler.error("Missing file pattern (" + FILE_NAME_PATTERN_OPTION + ") in setFile().");
- return;
- }
-
- Date now = new Date();
-
- fileName = new SimpleDateFormat(fileNamePattern).format (now);
- if (fileName.equals(currentFileName))
- return;
-
- /* Set up next filename checkpoint */
- DailyFileAppenderCalendar c = new DailyFileAppenderCalendar();
- c.rollToNextDay ();
- nextFilenameComputingMillis = c.getTimeInMillis ();
-
- currentFileName = fileName;
-
- super.setFile(fileName, append);
- }
-
- /**
- This method differentiates RollingFileAppender from its super
- class.
-
- */
- protected
- void subAppend(LoggingEvent event) {
-
- if (System.currentTimeMillis () >= nextFilenameComputingMillis) {
- try {
- setFile (super.fileName, super.fileAppend);
- }
- catch(IOException e) {
- System.err.println("setFile(null, false) call failed.");
- e.printStackTrace();
- }
- }
-
- super.subAppend(event);
- }
-
- /**
- Retuns the option names for this component, namely {@link
- #FILE_NAME_PATTERN_OPTION} in
- addition to the options of {@link FileAppender#getOptionStrings
- FileAppender}.
- */
- public
- String[] getOptionStrings() {
-
- return OptionConverter.concatanateArrays(super.getOptionStrings(),
- new String[] {FILE_NAME_PATTERN_OPTION});
- }
-
- /**
- Set the options for the appender
- */
- public
- void setOption(String key, String value) {
- super.setOption(key, value);
- if(key.equalsIgnoreCase(FILE_NAME_PATTERN_OPTION)) {
- fileNamePattern = value;
- }
- }
-
- /**
- If the a value for {@link #FILE_OPTION} is non-null, then {@link
- #setFile} is called with the values of {@link #FILE_OPTION} and
- {@link #APPEND_OPTION}.
-
- @since 0.8.1 */
- public
- void activateOptions() {
- try {
- setFile(null, super.fileAppend);
- }
- catch(java.io.IOException e) {
- errorHandler.error("setFile(null,"+fileAppend+") call failed.",
- e, ErrorCode.FILE_OPEN_FAILURE);
- }
- }
-}
-
-/**
- DailyFileAppenderCalendar is a helper class to DailyFileAppender. Using
- this class, it is easy to compute and access the next Millis()
-
- It subclasses the standard
- <a href="http://java.sun.com/j2se/1.3/docs/api/java/text/GregorianCalendar.html">
- java.util.GregorianCalendar</a>-object, to allow access to the protected
- function getTimeInMillis(), which it then exports.
-
- @author <a HREF="mailto:eirik.lygre@evita.no">Eirik Lygre</a>
-*/
-class DailyFileAppenderCalendar extends java.util.GregorianCalendar
-{
- /**
- Returns the current time in Millis
- */
- public long getTimeInMillis() {
- return super.getTimeInMillis();
- }
-
- /**
- Roll the date to the next hour, with minute, second and millisecond
- set to zero.
- */
- public void rollToNextDay () {
- this.add(java.util.Calendar.DATE, 0);
- this.add(java.util.Calendar.HOUR, 0);
- this.set(java.util.Calendar.MINUTE, 0);
- this.set(java.util.Calendar.SECOND, 0);
- this.set(java.util.Calendar.MILLISECOND, 0);
- }
-}
\ No newline at end of file
diff --git a/contribs/EirikLygre/mail-2001-01-18 b/contribs/EirikLygre/mail-2001-01-18
deleted file mode 100644
index 98ed56e..0000000
--- a/contribs/EirikLygre/mail-2001-01-18
+++ /dev/null
@@ -1,27 +0,0 @@
-Delivered-To: urba-cgu@urbanet.ch
-To: Ceki Gulcu <cg...@urbanet.ch>
-From: Eirik_Lygre/evita/no%EVITA@evita.no
-Subject: Re: Suggestion for new appender "DailyFileAppender"
-Date: Thu, 18 Jan 2001 20:18:27 +0100
-X-MIMETrack: Serialize by Router on domino1/evita/no(Release 5.0.5 |September 22, 2000) at
- 18.01.2001 20:18:30
-
-
-
-This version subclasses GregorianCalendar, to get access to the
-millis-variable used in the Calendar-classes (it is protected).
-
-
-What do you think?
-
-
-Eirik
-
-
-++++++++++
-Eirik Lygre
-eirik.lygre@evita.no
-e-vita as, Stortorvet 3, Oslo
-Mobil: (+47) 905 66476
-Fax: (+47) 23 35 70 51
- DailyFileAppender1.jav
\ No newline at end of file
diff --git a/contribs/JamesHouse/LogTextPanel.java b/contribs/JamesHouse/LogTextPanel.java
deleted file mode 100644
index db59e3d..0000000
--- a/contribs/JamesHouse/LogTextPanel.java
+++ /dev/null
@@ -1,182 +0,0 @@
-package org.apache.log4j.gui;
-
-
-/**
- * Title:
- * Description:
- * Copyright: Copyright (c) 2001
- * Company:
- * @author
- * @version 1.0
- */
-
-import java.awt.Color;
-import java.awt.Image;
-import java.awt.Toolkit;
-import java.awt.BorderLayout;
-
-import javax.swing.*;
-import javax.swing.text.StyledDocument;
-import javax.swing.text.SimpleAttributeSet;
-import javax.swing.text.MutableAttributeSet;
-import javax.swing.text.StyleConstants;
-
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-import java.util.Enumeration;
-import java.util.ArrayList;
-
-import org.apache.log4j.*;
-
-public class LogTextPanel extends JPanel {
-
- private JScrollBar scrollBar;
- private JTextPane textPane;
- private JCheckBox cbxTail;
- private StyledDocument doc;
-
- private Hashtable fontAttributes;
-
- private int eventBufferMaxSize = 10000;
- private ArrayList eventBuffer = new ArrayList(eventBufferMaxSize);
- private int eventViewIndex = 0;
-
- public LogTextPanel() {
- constructComponents();
- createDefaultFontAttributes();
- }
-
- private void constructComponents() {
- // setup the panel's additional components...
- this.setLayout(new BorderLayout());
-
- cbxTail = new JCheckBox();
- cbxTail.setSelected(true);
- cbxTail.setText("Tail log events");
-
- JPanel bottomPanel = new JPanel();
- bottomPanel.add(cbxTail, null);
-
- textPane = new JTextPane();
- textPane.setEditable(false);
- textPane.setText("");
- doc = textPane.getStyledDocument();
-
- scrollBar = new JScrollBar(JScrollBar.VERTICAL);
-
- this.add(bottomPanel, BorderLayout.SOUTH);
- this.add(scrollBar, BorderLayout.EAST);
- this.add(textPane, BorderLayout.CENTER);
- }
-
- public
- void setTextBackground(Color color) {
- textPane.setBackground(color);
- }
-
- public
- void setTextBackground(String v) {
- textPane.setBackground(parseColor(v));
- }
-
- private void createDefaultFontAttributes() {
- Priority[] prio = Priority.getAllPossiblePriorities();
-
- fontAttributes = new Hashtable();
- for (int i=0; i<prio.length;i++) {
- MutableAttributeSet att = new SimpleAttributeSet();
- fontAttributes.put(prio[i], att);
- //StyleConstants.setFontSize(att,11);
- }
-
- setTextColor(Priority.FATAL, Color.red);
- setTextColor(Priority.ERROR, Color.magenta);
- setTextColor(Priority.WARN, Color.orange);
- setTextColor(Priority.INFO, Color.blue);
- setTextColor(Priority.DEBUG, Color.black);
- }
-
- private
- Color parseColor (String v) {
- StringTokenizer st = new StringTokenizer(v,",");
- int val[] = {255,255,255,255};
- int i=0;
- while (st.hasMoreTokens()) {
- val[i]=Integer.parseInt(st.nextToken());
- i++;
- }
- return new Color(val[0],val[1],val[2],val[3]);
- }
-
- void setTextColor(Priority p, String v) {
- StyleConstants.setForeground(
- (MutableAttributeSet)fontAttributes.get(p),parseColor(v));
- }
-
- void setTextColor(Priority p, Color c) {
- StyleConstants.setForeground(
- (MutableAttributeSet)fontAttributes.get(p),c);
- }
-
- void setTextFontSize(int size) {
- Enumeration e = fontAttributes.elements();
- while (e.hasMoreElements()) {
- StyleConstants.setFontSize((MutableAttributeSet)e.nextElement(),size);
- }
- return;
- }
-
- void setTextFontName(String name) {
- Enumeration e = fontAttributes.elements();
- while (e.hasMoreElements()) {
- StyleConstants.setFontFamily((MutableAttributeSet)e.nextElement(),name);
- }
- return;
- }
-
- void setEventBufferSize(int bufferSize) {
- eventBufferMaxSize = bufferSize;
- }
-
- void newEvents(EventBufferElement[] evts) {
-
- if((eventBuffer.size() + evts.length) >= eventBufferMaxSize) {
- for(int i=0; i < evts.length; i++) {
- eventBuffer.remove(0);
- }
- eventViewIndex -= evts.length;
- if(eventViewIndex < 0)
- eventViewIndex = 0;
- }
- for(int i=0; i < evts.length; i++)
- eventBuffer.add(evts[i]);
-
- if((eventBuffer.size() > maxR) && cbxTail.isSelected()) {
- eventViewIndex = (eventBuffer.size() - maxR);
- }
-
- // only redraw if new line is visible...
- if((maxR < 0) || (eventBuffer.size() >= eventViewIndex && eventBuffer.size() <= (eventViewIndex + maxR)))
- drawText();
- }
-
- int maxR = -1;
-
- void drawText() {
- if(maxR < 0)
- maxR = textPane.getHeight() / textPane.getFontMetrics(textPane.getFont()).getHeight();
- try {
- doc.remove(0, doc.getLength());
- } catch(Exception e) { e.printStackTrace(); }
-
- for(int i=eventViewIndex; (i < eventBuffer.size()) && (i < (eventViewIndex + maxR)); i++) {
- EventBufferElement evt = (EventBufferElement)eventBuffer.get(i);
-
- try {
- doc.insertString(doc.getLength(), evt.text, (MutableAttributeSet)fontAttributes.get(evt.prio));
- } catch(Exception e) { e.printStackTrace(); }
- }
- }
-
-
-}
\ No newline at end of file
diff --git a/contribs/JamesHouse/LogTextPanelExample.java b/contribs/JamesHouse/LogTextPanelExample.java
deleted file mode 100644
index 74f1c3f..0000000
--- a/contribs/JamesHouse/LogTextPanelExample.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.apache.log4j.gui.examples;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.*;
-
-import org.apache.log4j.*;
-import org.apache.log4j.gui.TextPanelAppender;
-
-public class LogTextPanelExample {
- boolean packFrame = false;
-
- String catName = "dum.cat.name";
-
- public LogTextPanelExample() {
-
- // setup the logging
- TextPanelAppender tpa = new TextPanelAppender(new PatternLayout("%-5p %d [%t]: %m%n"), "logTextPanel");
- tpa.setThreshold(Priority.DEBUG);
- Category cat = Category.getInstance(catName);
- cat.addAppender(tpa);
-
- LogFrame frame = new LogFrame(tpa);
- frame.validate();
-
- //Center the frame (window), and show it
- Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
- Dimension frameSize = frame.getSize();
- if (frameSize.height > screenSize.height) {
- frameSize.height = screenSize.height;
- }
- if (frameSize.width > screenSize.width) {
- frameSize.width = screenSize.width;
- }
- frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
- frame.setVisible(true);
- }
-
- /**Main method*/
- public static void main(String[] args) {
- try {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- LogTextPanelExample foo = new LogTextPanelExample();
- new LogTextPanelExampleGenThread(foo.catName);
- }
-}
-
-class LogFrame extends JFrame {
-
- public LogFrame(TextPanelAppender tpa) {
- enableEvents(AWTEvent.WINDOW_EVENT_MASK);
- JPanel contentPane = (JPanel) this.getContentPane();
- contentPane.setLayout(new BorderLayout());
- this.setSize(new Dimension(600, 400));
- this.setTitle("LogTextPanel Example");
- contentPane.add(tpa.getLogTextPanel(), BorderLayout.CENTER);
- }
-
- // exit when window is closed
- protected void processWindowEvent(WindowEvent e) {
- super.processWindowEvent(e);
- if (e.getID() == WindowEvent.WINDOW_CLOSING) {
- System.exit(0);
- }
- }
-}
-
-class LogTextPanelExampleGenThread extends Thread {
-
- String catName;
-
- public LogTextPanelExampleGenThread(String catName) {
- this.catName = catName;
- this.setPriority(Thread.NORM_PRIORITY - 1);
- this.start();
- }
-
- public void run() {
- Category cat = Category.getInstance(catName);
- int cnt = 0;
- while(true) {
- cnt++;
- int randEvt = (int)(Math.random() * 125);
- if(randEvt < 3)
- cat.fatal("{" + cnt + "} Something screwed up bad.");
- else if(randEvt < 10)
- cat.error("{" + cnt + "} An error occured while trying to delete all of your files.");
- else if(randEvt < 25)
- cat.warn("{" + cnt + "} It seems as if your hard disk is getting full.");
- else if(randEvt < 55)
- cat.info("{" + cnt + "} It is now time for tea.");
- else if(randEvt < 65)
- cat.debug("{" + cnt + "} Something bad is happening on line 565 of com.foo.Crap");
- else if(randEvt < 75)
- cat.debug("{" + cnt + "} Input value for xe343dd is not equal to xe39dfd!");
- else if(randEvt < 85)
- cat.debug("{" + cnt + "} Successfully reached line 2312 of com.foo.Goo");
- else if(randEvt < 105)
- cat.debug("{" + cnt + "} Here is some extra handy debugging information for you.");
- else if(randEvt < 115)
- cat.debug("{" + cnt + "} The file you are about to write to is not open.");
- else if(randEvt < 125)
- cat.debug("{" + cnt + "} The input value to the method was <null>.");
-
- try {
- Thread.sleep(10);
- }
- catch(Exception e) {}
-
- }
- }
-}
\ No newline at end of file
diff --git a/contribs/JamesHouse/TextPanelAppender.java b/contribs/JamesHouse/TextPanelAppender.java
deleted file mode 100644
index c4d45bc..0000000
--- a/contribs/JamesHouse/TextPanelAppender.java
+++ /dev/null
@@ -1,201 +0,0 @@
-package org.apache.log4j.gui;
-
-
-import java.awt.Color;
-import java.awt.Image;
-import java.awt.Toolkit;
-import java.io.*;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-import java.util.Hashtable;
-import java.util.ArrayList;
-
-import javax.swing.JPanel;
-
-import org.apache.log4j.*;
-
-import org.apache.log4j.spi.LoggingEvent;
-import org.apache.log4j.helpers.Loader;
-import org.apache.log4j.helpers.QuietWriter;
-import org.apache.log4j.helpers.TracerPrintWriter;
-import org.apache.log4j.helpers.OptionConverter;
-
-
-/**
- *
- * @author James House
- */
-
-public class TextPanelAppender extends AppenderSkeleton {
-
- TracerPrintWriter tp;
- StringWriter sw;
- QuietWriter qw;
- LogTextPanel logTextPanel;
- LogPublishingThread logPublisher;
-
- final String COLOR_OPTION_FATAL = "Color.Fatal";
- final String COLOR_OPTION_ERROR = "Color.Error";
- final String COLOR_OPTION_WARN = "Color.Warn";
- final String COLOR_OPTION_INFO = "Color.Info";
- final String COLOR_OPTION_DEBUG = "Color.Debug";
- final String COLOR_OPTION_BACKGROUND = "Color.Background";
- final String FONT_NAME_OPTION = "Font.Name";
- final String FONT_SIZE_OPTION = "Font.Size";
- final String EVENT_BUFFER_SIZE_OPTION = "EventBuffer.Size";
-
- public TextPanelAppender(Layout layout, String name) {
- this.layout = layout;
- this.name = name;
- this.sw = new StringWriter();
- this.qw = new QuietWriter(sw, errorHandler);
- this.tp = new TracerPrintWriter(qw);
- setLogTextPanel(new LogTextPanel());
- logPublisher = new LogPublishingThread(logTextPanel, Priority.ERROR, 500);
- //logPublisher = new LogPublishingThread(logTextPanel, null, 500);
- }
-
- public
- void close() {
- }
-
- public void append(LoggingEvent event) {
-
- String text = this.layout.format(event);
-
- // Print Stacktrace
- // Quick Hack maybe there is a better/faster way?
- if (event.throwable!=null) {
- event.throwable.printStackTrace(tp);
- for (int i=0; i< sw.getBuffer().length(); i++) {
- if (sw.getBuffer().charAt(i)=='\t')
- sw.getBuffer().replace(i,i+1," ");
- }
- text += sw.toString();
- sw.getBuffer().delete(0,sw.getBuffer().length());
- }
- else
- if(!text.endsWith("\n"))
- text += "\n";
-
- logPublisher.publishEvent(event.priority, text);
- }
-
- public
- JPanel getLogTextPanel() {
- return logTextPanel;
- }
-
- public
- String[] getOptionStrings() {
- return new String[] { COLOR_OPTION_FATAL, COLOR_OPTION_ERROR,
- COLOR_OPTION_WARN, COLOR_OPTION_INFO, COLOR_OPTION_DEBUG,
- COLOR_OPTION_BACKGROUND, FONT_NAME_OPTION, FONT_SIZE_OPTION};
- }
-
-
- public
- void setName(String name) {
- this.name = name;
- }
-
- protected
- void setLogTextPanel(LogTextPanel logTextPanel) {
- this.logTextPanel = logTextPanel;
- logTextPanel.setTextBackground(Color.white);
- }
-
- public
- void setOption(String option, String value) {
- if (option.equalsIgnoreCase(COLOR_OPTION_FATAL))
- logTextPanel.setTextColor(Priority.FATAL,value);
- if (option.equalsIgnoreCase(COLOR_OPTION_ERROR))
- logTextPanel.setTextColor(Priority.ERROR,value);
- if (option.equalsIgnoreCase(COLOR_OPTION_WARN))
- logTextPanel.setTextColor(Priority.WARN,value);
- if (option.equalsIgnoreCase(COLOR_OPTION_INFO))
- logTextPanel.setTextColor(Priority.INFO,value);
- if (option.equalsIgnoreCase(COLOR_OPTION_DEBUG))
- logTextPanel.setTextColor(Priority.DEBUG,value);
- if (option.equalsIgnoreCase(COLOR_OPTION_BACKGROUND))
- logTextPanel.setTextBackground(value);
- if (option.equalsIgnoreCase(FONT_SIZE_OPTION))
- logTextPanel.setTextFontSize(Integer.parseInt(value));
- if (option.equalsIgnoreCase(FONT_NAME_OPTION))
- logTextPanel.setTextFontName(value);
- if (option.equalsIgnoreCase(EVENT_BUFFER_SIZE_OPTION))
- logTextPanel.setEventBufferSize(Integer.parseInt(value));
- return;
- }
-
- public
- boolean requiresLayout() {
- return true;
- }
-
-
-
- class LogPublishingThread extends Thread {
-
- LogTextPanel logTextPanel;
- ArrayList evts;
- Priority triggerPrio;
- long pubInterval;
-
- public LogPublishingThread(LogTextPanel logTextPanel, Priority triggerPrio, long pubInterval) {
- this.logTextPanel = logTextPanel;
- this.evts = new ArrayList(1000);
- this.triggerPrio = triggerPrio;
- this.pubInterval = pubInterval;
- //this.setPriority(Thread.NORM_PRIORITY - 1);
- this.start();
- }
-
- public void run() {
- while(true) {
- synchronized(evts) {
- try {
- evts.wait(pubInterval);
- }
- catch(InterruptedException e) {}
-
- logTextPanel.newEvents((EventBufferElement[])evts.toArray(new EventBufferElement[evts.size()]));
-
- evts.clear();
- }
- }
-
- }
-
- public void publishEvent(Priority prio, String text) {
- synchronized(evts) {
- evts.add(new EventBufferElement(prio, text));
- if(triggerPrio != null && prio.isGreaterOrEqual(triggerPrio))
- evts.notify();
- }
- }
- }
-
-} // TextPaneAppender
-
-class EventBufferElement {
-
- public String text;
- public Priority prio;
- public int numLines;
-
- EventBufferElement(Priority prio, String text) {
- this.prio = prio;
- this.text = text;
- numLines = 1;
- int pos = pos = text.indexOf('\n', 0);
- int len = text.length() - 1;
-
- while( (pos > 0) && (pos < len) )
- numLines++;
- pos = text.indexOf('\n', pos + 1);
- }
-}
-
-
diff --git a/contribs/JamesHouse/mail-2001-01-23 b/contribs/JamesHouse/mail-2001-01-23
deleted file mode 100644
index 0356f40..0000000
--- a/contribs/JamesHouse/mail-2001-01-23
+++ /dev/null
@@ -1,70 +0,0 @@
-Delivered-To: urba-cgu@urbanet.ch
-From: James House <ja...@medibuy.com>
-To: Ceki Gulcu <cg...@urbanet.ch>
-Subject: RE: Buffering issues
-Date: Tue, 23 Jan 2001 11:38:30 -0800
-X-Mailer: Internet Mail Service (5.5.2650.21)
-
-
-
-Ceki,
-
-
-Most of the "speed" issues can be easily solved, as demonstrated in
-the new versions of the files that are attached, and as described
-here:
-
-
-The "drawing" of the panel is time consuming. And let's face it: we
-will never build a swing component that can re-draw itself thousands
-of times per second - nor could the human eye keep up with that anyway
-(60-ish redraws per second is the limit of what most humans can
-perceive).
-
-
-I think you'll agree that regardless of which choice of swing
-components, the issue of not being able to draw more than 100 times
-per second (if that) will be a constant.
-
-
-Possible solutions to wasting a lot of time redrawing are:
- * Redraw every N messages
- * Redraw every N milliseconds
- * Redraw when a message of a high priority is received
- * Only redraw if the changes (new messages) are visible (depending on
-scroll-bar position)
-
-
-
-I made some very small changes (which are some of what I outlined in
-the previous e-mail as things on the to-do list), and you should be
-able to see a great difference in performance.
-
-
-In general the changes are: Use a "queue" to asynchronously deliver
-the messages to the panel for updating, rather than having the calling
-thread (the one generating the log message) be responsible for
-re-drawing the panel - this frees up the thread to continue on without
-waiting for the logging mechanism. The "queue" has a thread that
-wakes up every N milliseconds, or when a message of a specified
-priority arrives. It then delivers all queued messages to the panel,
-which then redraws ONCE for the entire batch of queued messages IF the
-new messages are visible in the display.
-
-
-With the "tail" mechanism turned on (so that any new set of messages
-forces a redraw, because the last message is always visible), the
-panel can now log about a thousand messages in 1 second. With tail
-turned off (so that redraw is only required if the panel is showing
-the space the new messages will be printed), it can receive over a
-100,000 messages in just a few seconds. Also, most of the flicker is
-already eliminated.
-
-
-Again, everything in the code is really "roughed in" - just there to
-give the general idea, not necessarily to do things in the best way -
-but I really feel that this kind of solution is what you'll have to
-end up with in the long term.
-
-
-James
diff --git a/contribs/Jamie Tsao/JMSQueueAppender.java b/contribs/Jamie Tsao/JMSQueueAppender.java
deleted file mode 100644
index aa475ef..0000000
--- a/contribs/Jamie Tsao/JMSQueueAppender.java
+++ /dev/null
@@ -1,225 +0,0 @@
-
-import org.apache.log4j.AppenderSkeleton;
-import org.apache.log4j.spi.LoggingEvent;
-import org.apache.log4j.spi.ErrorHandler;
-import org.apache.log4j.spi.ErrorCode;
-import org.apache.log4j.helpers.LogLog;
-
-import java.util.Hashtable;
-import java.util.Properties;
-import javax.jms.*;
-import javax.naming.InitialContext;
-import javax.naming.Context;
-import javax.naming.NameNotFoundException;
-import javax.naming.NamingException;
-
-/**
- * A Simple JMS (P2P) Queue Appender.
- *
- * @author Ceki Gülcü
- * @author Jamie Tsao
-*/
-public class JMSQueueAppender extends AppenderSkeleton {
-
- protected QueueConnection queueConnection;
- protected QueueSession queueSession;
- protected QueueSender queueSender;
- protected Queue queue;
-
- String initialContextFactory;
- String providerUrl;
- String queueBindingName;
- String queueConnectionFactoryBindingName;
-
- public
- JMSQueueAppender() {
- }
-
-
- /**
- * The <b>InitialContextFactory</b> option takes a string value.
- * Its value, along with the <b>ProviderUrl</b> option will be used
- * to get the InitialContext.
- */
- public void setInitialContextFactory(String initialContextFactory) {
- this.initialContextFactory = initialContextFactory;
- }
-
- /**
- * Returns the value of the <b>InitialContextFactory</b> option.
- */
- public String getInitialContextFactory() {
- return initialContextFactory;
- }
-
- /**
- * The <b>ProviderUrl</b> option takes a string value.
- * Its value, along with the <b>InitialContextFactory</b> option will be used
- * to get the InitialContext.
- */
- public void setProviderUrl(String providerUrl) {
- this.providerUrl = providerUrl;
- }
-
- /**
- * Returns the value of the <b>ProviderUrl</b> option.
- */
- public String getProviderUrl() {
- return providerUrl;
- }
-
- /**
- * The <b>QueueConnectionFactoryBindingName</b> option takes a
- * string value. Its value will be used to lookup the appropriate
- * <code>QueueConnectionFactory</code> from the JNDI context.
- */
- public void setQueueConnectionFactoryBindingName(String queueConnectionFactoryBindingName) {
- this.queueConnectionFactoryBindingName = queueConnectionFactoryBindingName;
- }
-
- /**
- * Returns the value of the <b>QueueConnectionFactoryBindingName</b> option.
- */
- public String getQueueConnectionFactoryBindingName() {
- return queueConnectionFactoryBindingName;
- }
-
- /**
- * The <b>QueueBindingName</b> option takes a
- * string value. Its value will be used to lookup the appropriate
- * destination <code>Queue</code> from the JNDI context.
- */
- public void setQueueBindingName(String queueBindingName) {
- this.queueBindingName = queueBindingName;
- }
-
- /**
- Returns the value of the <b>QueueBindingName</b> option.
- */
- public String getQueueBindingName() {
- return queueBindingName;
- }
-
-
- /**
- * Overriding this method to activate the options for this class
- * i.e. Looking up the Connection factory ...
- */
- public void activateOptions() {
-
- QueueConnectionFactory queueConnectionFactory;
-
- try {
-
- Context ctx = getInitialContext();
- queueConnectionFactory = (QueueConnectionFactory) ctx.lookup(queueConnectionFactoryBindingName);
- queueConnection = queueConnectionFactory.createQueueConnection();
-
- queueSession = queueConnection.createQueueSession(false,
- Session.AUTO_ACKNOWLEDGE);
-
- Queue queue = (Queue) ctx.lookup(queueBindingName);
- queueSender = queueSession.createSender(queue);
-
- queueConnection.start();
-
- ctx.close();
-
- } catch(Exception e) {
- errorHandler.error("Error while activating options for appender named ["+name+
- "].", e, ErrorCode.GENERIC_FAILURE);
- }
- }
-
- protected InitialContext getInitialContext() throws NamingException {
- try {
- Hashtable ht = new Hashtable();
-
- //Populate property hashtable with data to retrieve the context.
- ht.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
- ht.put(Context.PROVIDER_URL, providerUrl);
-
- return (new InitialContext(ht));
-
- } catch (NamingException ne) {
- LogLog.error("Could not get initial context with ["+initialContextFactory + "] and [" + providerUrl + "].");
- throw ne;
- }
- }
-
-
- protected boolean checkEntryConditions() {
-
- String fail = null;
-
- if(this.queueConnection == null) {
- fail = "No QueueConnection";
- } else if(this.queueSession == null) {
- fail = "No QueueSession";
- } else if(this.queueSender == null) {
- fail = "No QueueSender";
- }
-
- if(fail != null) {
- errorHandler.error(fail +" for JMSQueueAppender named ["+name+"].");
- return false;
- } else {
- return true;
- }
- }
-
- /**
- * Close this JMSQueueAppender. Closing releases all resources used by the
- * appender. A closed appender cannot be re-opened.
- */
- public synchronized // avoid concurrent append and close operations
- void close() {
-
- if(this.closed)
- return;
-
- LogLog.debug("Closing appender ["+name+"].");
- this.closed = true;
-
- try {
- if(queueSession != null)
- queueSession.close();
- if(queueConnection != null)
- queueConnection.close();
- } catch(Exception e) {
- LogLog.error("Error while closing JMSQueueAppender ["+name+"].", e);
- }
-
- // Help garbage collection
- queueSender = null;
- queueSession = null;
- queueConnection = null;
- }
-
- /**
- * This method called by {@link AppenderSkeleton#doAppend} method to
- * do most of the real appending work. The LoggingEvent will be
- * be wrapped in an ObjectMessage to be put on the JMS queue.
- */
- public void append(LoggingEvent event) {
-
- if(!checkEntryConditions()) {
- return;
- }
-
- try {
-
- ObjectMessage msg = queueSession.createObjectMessage();
- msg.setObject(event);
- queueSender.send(msg);
-
- } catch(Exception e) {
- errorHandler.error("Could not send message in JMSQueueAppender ["+name+"].", e,
- ErrorCode.GENERIC_FAILURE);
- }
- }
-
- public boolean requiresLayout() {
- return false;
- }
-}
\ No newline at end of file
diff --git a/contribs/Jamie Tsao/mail-2001-06-20 b/contribs/Jamie Tsao/mail-2001-06-20
deleted file mode 100644
index 9ddbb50..0000000
--- a/contribs/Jamie Tsao/mail-2001-06-20
+++ /dev/null
@@ -1,11 +0,0 @@
-Hi,
-
-I have written a JMSQueueAppender that essentially logs to a JMS Queue
-(Point 2 Point). The JMSAppender currently packaged with log4j logs to
-a JMS Topic (I would rename it JMSTopicAppender). I also made it so
-that the InitialContextFactory and ProviderUrl are configurable appender
-options. I would like to submit this to Apache.
-
-Thanks,
-
-Jamie Tsao
\ No newline at end of file
diff --git a/contribs/JayFunnell/NetSendAppender.cpp b/contribs/JayFunnell/NetSendAppender.cpp
deleted file mode 100644
index 97c8260..0000000
--- a/contribs/JayFunnell/NetSendAppender.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
- *
- * This software is published under the terms of the Apache Software
- * License version 1.1, a copy of which has been included with this
- * distribution in the LICENSE.txt file.
- */
-
-#include <windows.h>
-#include "org_apache_log4j_net_NetSendAppender.h"
-#include "jni.h"
-
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- return TRUE;
-}
-
-JNIEXPORT jboolean JNICALL Java_org_apache_log4j_net_NetSendAppender_sendMessage(JNIEnv * env, jobject obj, jstring c, jstring f,jstring t, jstring m)
-{
-
- BOOL success=false;
- DWORD msgLength;
- DWORD bytesWritten;
-
- const char * computer=env->GetStringUTFChars(c,0);
- const char * from=env->GetStringUTFChars(f,0);
- const char * to=env->GetStringUTFChars(t,0);
- const char * message=env->GetStringUTFChars(m,0);
-
- //Prepearing WinPopup message
-
- msgLength=lstrlen(from)+lstrlen(to)+lstrlen(message)+4;
- char * winPopMsg=new char[msgLength];
- lstrcpy(winPopMsg,from);
- lstrcpy(winPopMsg+lstrlen(from)+1,to);
- lstrcpy(winPopMsg+lstrlen(from)+1+lstrlen(to)+1,message);
-
- //Prepearing Mailslot
-
- char mailslot[256];
- lstrcpy(mailslot,"\\\\");
- lstrcat(mailslot,computer);
- lstrcat(mailslot,"\\mailslot\\messngr");
-
- //Opening Mailslot
-
- HANDLE fileHandle=CreateFile(mailslot,GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
- if(fileHandle!=NULL)
- success=WriteFile(fileHandle,winPopMsg,msgLength,&bytesWritten,NULL);
-
- //Cleaning
-
- delete winPopMsg;
- env->ReleaseStringUTFChars(c,computer);
- env->ReleaseStringUTFChars(f,from);
- env->ReleaseStringUTFChars(t,to);
- env->ReleaseStringUTFChars(m,message);
-
- if(success)
- return JNI_TRUE;
- else
- return JNI_FALSE;
-
-}
diff --git a/contribs/JayFunnell/NetSendAppender.dll b/contribs/JayFunnell/NetSendAppender.dll
deleted file mode 100644
index ee6c737..0000000
Binary files a/contribs/JayFunnell/NetSendAppender.dll and /dev/null differ
diff --git a/contribs/JayFunnell/NetSendAppender.java b/contribs/JayFunnell/NetSendAppender.java
deleted file mode 100644
index 1e0f45f..0000000
--- a/contribs/JayFunnell/NetSendAppender.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
- *
- * This software is published under the terms of the Apache Software
- * License version 1.1, a copy of which has been included with this
- * distribution in the LICENSE.txt file. */
-
-package org.apache.log4j.net;
-
-import org.apache.log4j.Layout;
-import org.apache.log4j.spi.LoggingEvent;
-import org.apache.log4j.AppenderSkeleton;
-import org.apache.log4j.helpers.LogLog;
-
-/**
- <p>The NetSendAppender is a log4j appender that uses the popular Windows NET SEND
- command to announce log events. This is handy for situations where immediate
- notification is required for critical log events. It's extremely unhandy for
- low-priority log messages because it will quickly annoy the user(s) receiving them :)
-
- <p>A JNI component is used to perform the actual network communication. It must be
- in your path when using this appender. The source code for this component was
- originally found
- <a href="http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20286388.html">here</a>
-
- <p>Here is a list of the available configuration options:
- <p>
- <table border=1>
- <tr>
- <th>Name</th>
- <th>Requirement</th>
- <th>Description</th>
- <th>Sample Value</th>
- </tr>
- <tr>
- <td>computer</td>
- <td>required</td>
- <td>This parameter determines the destination computer for the messages. This is the Windows machine name.</td>
- <td>sideshow-bob</td>
- </tr>
- <tr>
- <td>from</td>
- <td>required</td>
- <td>This parameter determines the name of the user sending each log message. This is a Windows user name.</td>
- <td>mary</td>
- </tr>
- <tr>
- <td>to</td>
- <td>required</td>
- <td>This parameter determines which user will receive the log messages. This is a Windows user name.</td>
- <td>fred</td>
- </tr>
- </table>
-
- <p>Here is a sample configuration. It assigns a "netsend" appender to the emergency channel. The destination computer
- is called "sideshow-bob" and the destination user is "fred". Each time a message is logged to the emergency channel,
- fred is sent a copy to his machine, "sideshow-bob".
- <p>
- <pre>
- log4j.logger.emergency=DEBUG, netsend
- log4j.appender.netsend=org.apache.log4j.net.NetSendAppender
- log4j.appender.netsend.computer=sideshow-bob
- log4j.appender.netsend.to=fred
- log4j.appender.netsend.from=Emergency Monitor
- log4j.appender.netsend.layout=org.apache.log4j.PatternLayout
- log4j.appender.netsend.layout.ConversionPattern=%-5p %c{1} - %m%n
- </pre>
-
- <p>
- A common problem with NET SENDs is that the recipient can receive duplicates messages. Note that this is because
- the message is sent on every available transport layer. So if you have TCP/IP and IPX enabled, each will
- be used to send the message to the user. This is not a problem with the NetSendAppender.
-
- @author <a HREF="mailto:jay-funnell@shaw.ca">Jay Funnell</a>
-
-*/
-
-public class NetSendAppender extends AppenderSkeleton {
-
- static boolean libraryLoaded = false;
-
- String computer = null;
- String toUser = null;
- String fromUser = null;
- boolean activated = false;
-
- /** Default constructor */
- public NetSendAppender() {
- if (!libraryLoaded) {
- try {
- System.loadLibrary("NetSendAppender");
- libraryLoaded = true;
- } catch (UnsatisfiedLinkError err) {
- LogLog.warn("problem loading NetSendAppender.dll:", err);
- } catch (SecurityException ex) {
- LogLog.warn("problem loading NetSendAppender.dll:", ex);
- }
- }
- }
-
- /** This appender requires a layout to format the text to the
- attached client(s). */
- public boolean requiresLayout() {
- return true;
- }
-
- /** Validates the configuration settings. */
- public void activateOptions() {
-
- activated = true;
- if (computer == null) {
- LogLog.error("'computer' setting not found. You must provide a destination computer when configuring this appender.");
- activated = false;
- }
- if (toUser == null) {
- LogLog.error("'to' setting not found. You must provide a destination user when configuring this appender.");
- activated = false;
- }
- if (fromUser == null) {
- LogLog.error("'from' setting not found. You must provide a source user when configuring this appender.");
- activated = false;
- }
-
- }
-
- /** Assigns the name of the computer that will receive log messages. */
- public void setComputer(String computer) {
- this.computer = computer;
- }
-
- /** Retrieves the name of the computer that will receive log messages. */
- public String getComputer() {
- return computer;
- }
-
- /** Assigns the name of the user that will send the log messages. */
- public void setFrom(String fromUser) {
- this.fromUser = fromUser;
- }
-
- /** Retrieves the name of the user that will send the log messages. */
- public String getFrom() {
- return fromUser;
- }
-
- /** Assigns the name of the user that will receive log messages. */
- public void setTo(String toUser) {
- this.toUser = toUser;
- }
-
- /** Retrieves the name of the user that will receive log messages. */
- public String getTo() {
- return toUser;
- }
-
- /** Shuts down the appender. */
- public void close() {
- }
-
- /** Handles a log event. For this appender, that means writing the
- message to a JNI component that can handle the NET SEND. */
- protected void append(LoggingEvent event) {
- if (libraryLoaded && activated) {
- sendMessage(computer, fromUser, toUser, this.layout.format(event));
- if(layout.ignoresThrowable()) {
- String[] s = event.getThrowableStrRep();
- if (s != null) {
- int len = s.length;
- for(int i = 0; i < len; i++) {
- sendMessage(computer, fromUser, toUser, s[i]);
- }
- }
- }
- }
- }
-
- /** This method is provided in NetSendAppender.dll and performs the actual network calls. */
- public native boolean sendMessage(String computer, String from, String to, String message);
-
-}
diff --git a/contribs/JayFunnell/NetSendAppender.txt b/contribs/JayFunnell/NetSendAppender.txt
deleted file mode 100644
index f8fa36e..0000000
--- a/contribs/JayFunnell/NetSendAppender.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-Appender : NetSendAppender
-Creation Date : December 12/2002
-Author : jay.funnell@shaw.ca
-
-Overview
---------
-
-What is NET SEND? If you have a Windows (98,2k,XP) machine, try it:
-
-c:\> NET SEND %computername% This is a test
-
-If it worked, you should see a popup box on your screen with the message:
-
- -----------------------------------------------------------
- | Message from <computername> to <computername> on <date> |
- | This is a test |
- | |
- | OK |
- -----------------------------------------------------------
-
-The NetSendAppender is a log4j appender that uses the popular Windows NET SEND command to announce log events.
-This is handy for situations where immediate notification is required for critical log events. It's extremely
-unhandy for low-priority log messages because it will quickly annoy the user(s) receiving them.
-
-This appender is like the NTEventLogAppender in that it requires a JNI Dll. Make sure that "NetSendAppender.dll"
-is in your path or the appender will not work.
-
-Build
------
-
-There are three important files required to build the NetSendAppender.
-
-NetSendAppender.java
- - This is the Java component of the Appender. It has a native method that is implemented
- within the JNI Dll.
-
-<package>_NetSendAppender.h
- - This file must be generated using javah against the NetSendAppender class.
-
-NetSendAppender.cpp
- - This file is required to build the JNI NetSendAppender dll
-
-I used Visual Studio 6 to build the JNI component. Specifically, a win32 DLL project was used. It must include
-references to the Sun JDK "include" and "include\win32" directories. It must also include a library reference to
-"jvm.lib"
-
-Options
--------
-
-This appender requires you to set some parameters.
-
-- "from" is the user name that will be used for sending the message.
-- "to" is the destination user.
-- "computer" is the destination computer.
-
-Here is a sample configuration that creates an "emergency" category that announces log messages
-to Fred on machine sideshow-bob.
-
-log4j.logger.emergency=DEBUG, netsend
-log4j.appender.netsend=org.apache.log4j.net.NetSendAppender
-log4j.appender.netsend.computer=sideshow-bob
-log4j.appender.netsend.to=fred
-log4j.appender.netsend.from=Emergency Monitor
-log4j.appender.netsend.layout=org.apache.log4j.PatternLayout
-log4j.appender.netsend.layout.ConversionPattern=%-5p %c{1} - %m%n
-
diff --git a/contribs/JimMoore/LoggingOutputStream.java b/contribs/JimMoore/LoggingOutputStream.java
deleted file mode 100644
index 053779f..0000000
--- a/contribs/JimMoore/LoggingOutputStream.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
- *
- * This software is published under the terms of the Apache Software
- * License version 1.1, a copy of which has been included with this
- * distribution in the LICENSE.APL file.
- */
-
-
-import java.io.*;
-import org.apache.log4j.*;
-
-
-/**
- * An OutputStream that flushes out to a Category.<p>
- *
- * Note that no data is written out to the Category until the stream is
- * flushed or closed.<p>
- *
- * Example:<pre>
- * // make sure everything sent to System.err is logged
- * System.setErr(new PrintStream(new LoggingOutputStream(Category.getRoot(), Priority.WARN), true));
- *
- * // make sure everything sent to System.out is also logged
- * System.setOut(new PrintStream(new LoggingOutputStream(Category.getRoot(), Priority.INFO), true));
- * </pre>
- *
- * @author <a href="mailto://Jim.Moore@rocketmail.com">Jim Moore</a>
- * @see Category
- */
-public class LoggingOutputStream extends OutputStream {
- protected static final String LINE_SEPERATOR = System.getProperty("line.separator");
-
-
- /**
- * Used to maintain the contract of {@link #close()}.
- */
- protected boolean hasBeenClosed = false;
-
- /**
- * The internal buffer where data is stored.
- */
- protected byte[] buf;
-
- /**
- * The number of valid bytes in the buffer. This value is always
- * in the range <tt>0</tt> through <tt>buf.length</tt>; elements
- * <tt>buf[0]</tt> through <tt>buf[count-1]</tt> contain valid
- * byte data.
- */
- protected int count;
-
-
- /**
- * Remembers the size of the buffer for speed.
- */
- private int bufLength;
-
- /**
- * The default number of bytes in the buffer. =2048
- */
- public static final int DEFAULT_BUFFER_LENGTH = 2048;
-
-
- /**
- * The category to write to.
- */
- protected Category category;
-
- /**
- * The priority to use when writing to the Category.
- */
- protected Priority priority;
-
-
- private LoggingOutputStream() {
- // illegal
- }
-
-
- /**
- * Creates the LoggingOutputStream to flush to the given Category.
- *
- * @param cat the Category to write to
- *
- * @param priority the Priority to use when writing to the Category
- *
- * @exception IllegalArgumentException
- * if cat == null or priority == null
- */
- public LoggingOutputStream(Category cat, Priority priority)
- throws IllegalArgumentException {
- if (cat == null) {
- throw new IllegalArgumentException("cat == null");
- }
- if (priority == null) {
- throw new IllegalArgumentException("priority == null");
- }
-
- this.priority = priority;
- category = cat;
- bufLength = DEFAULT_BUFFER_LENGTH;
- buf = new byte[DEFAULT_BUFFER_LENGTH];
- count = 0;
- }
-
-
- /**
- * Closes this output stream and releases any system resources
- * associated with this stream. The general contract of <code>close</code>
- * is that it closes the output stream. A closed stream cannot perform
- * output operations and cannot be reopened.
- */
- public void close() {
- flush();
- hasBeenClosed = true;
- }
-
-
- /**
- * Writes the specified byte to this output stream. The general
- * contract for <code>write</code> is that one byte is written
- * to the output stream. The byte to be written is the eight
- * low-order bits of the argument <code>b</code>. The 24
- * high-order bits of <code>b</code> are ignored.
- *
- * @param b the <code>byte</code> to write
- *
- * @exception IOException
- * if an I/O error occurs. In particular,
- * an <code>IOException</code> may be thrown if the
- * output stream has been closed.
- */
- public void write(final int b) throws IOException {
- if (hasBeenClosed) {
- throw new IOException("The stream has been closed.");
- }
-
- // don't log nulls
- if (b == 0) {
- return;
- }
-
- // would this be writing past the buffer?
- if (count == bufLength) {
- // grow the buffer
- final int newBufLength = bufLength+DEFAULT_BUFFER_LENGTH;
- final byte[] newBuf = new byte[newBufLength];
-
- System.arraycopy(buf, 0, newBuf, 0, bufLength);
-
- buf = newBuf;
- bufLength = newBufLength;
- }
-
- buf[count] = (byte)b;
- count++;
- }
-
-
- /**
- * Flushes this output stream and forces any buffered output bytes
- * to be written out. The general contract of <code>flush</code> is
- * that calling it is an indication that, if any bytes previously
- * written have been buffered by the implementation of the output
- * stream, such bytes should immediately be written to their
- * intended destination.
- */
- public void flush() {
- if (count == 0) {
- return;
- }
-
- // don't print out blank lines; flushing from PrintStream puts out these
- if (count == LINE_SEPERATOR.length()) {
- if ( ((char)buf[0]) == LINE_SEPERATOR.charAt(0) &&
- ( ( count == 1 ) || // <- Unix & Mac, -> Windows
- ( (count == 2) && ((char)buf[1]) == LINE_SEPERATOR.charAt(1) ) ) ) {
- reset();
- return;
- }
- }
-
- final byte[] theBytes = new byte[count];
-
- System.arraycopy(buf, 0, theBytes, 0, count);
-
- category.log(priority, new String(theBytes));
-
- reset();
- }
-
-
- private void reset() {
- // not resetting the buffer -- assuming that if it grew that it
- // will likely grow similarly again
- count = 0;
- }
-
-}
-
diff --git a/contribs/JimMoore/mail-2001-03-12T1326 b/contribs/JimMoore/mail-2001-03-12T1326
deleted file mode 100644
index 52a88c7..0000000
--- a/contribs/JimMoore/mail-2001-03-12T1326
+++ /dev/null
@@ -1,39 +0,0 @@
-Copied from:
-http://www.mail-archive.com/log4j-user@jakarta.apache.org/msg00430.html
-
---------------------------------------------------------------------------------
-diverting System.stderr/stdout into log4j
---------------------------------------------------------------------------------
-
-From: Joseph Panico
-Subject: diverting System.stderr/stdout into log4j
-Date: Mon, 12 Mar 2001 13:26:41 -0800
-
---------------------------------------------------------------------------------
-
-Folks,
-
-We use a number of third-party packages that do stderr.print... at various
-random places in their code. I'm finding it quite useful to divert these
-messages into our log4j heirarchy. I do this by replacing stderr/stdout with
-my own PrintStreams that log the lines to a special log4j Category-- as
-suggested on this list a while back. The only fly-in-the-ointment with this
-scheme is LogLog. If there is a problem with log4j such that it cannot log
-for some reason, then log4j internals use LogLog to attempt to print an
-error message. This obviously leads to an infinite recursion. Has anyone
-else been bothered by this? Would it make sense to add interface to LogLog
-which would set the PrintStream it uses to log its error messages to?
-
-thanks for any ideas
-
-joe
-
-_________________________________________________________________
-Get your FREE download of MSN Explorer at http://explorer.msn.com
-
-
----------------------------------------------------------------------
-To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
-For additional commands, e-mail: log4j-user-help@jakarta.apache.org
-
-
diff --git a/contribs/JimMoore/mail-2001-03-12T1454 b/contribs/JimMoore/mail-2001-03-12T1454
deleted file mode 100644
index 1a81e53..0000000
--- a/contribs/JimMoore/mail-2001-03-12T1454
+++ /dev/null
@@ -1,112 +0,0 @@
-
-Copied from:
-http://www.mail-archive.com/log4j-user@jakarta.apache.org/msg00433.html
-
---------------------------------------------------------------------------------
-RE: diverting System.stderr/stdout into log4j
---------------------------------------------------------------------------------
-
-From: Jim Moore
-Subject: RE: diverting System.stderr/stdout into log4j
-Date: Mon, 12 Mar 2001 14:54:13 -0800
-
---------------------------------------------------------------------------------
-
-It doesn't. I haven't worried about it, since log4j doesn't contain any
-bugs and therefore it would never happen... :)
-
-Probably the best way to handle it is to add a
-LogLog.setPrintStream(PrintStream) method, so you can do something like:
-
-// remember STDERR
-PrintStream se = System.err;
-
-// make sure everything sent to System.err is logged
-System.setErr(new PrintStream(new LoggingOutputStream(Category.getRoot(),
- Priority.WARN), true));
-
-// make sure everything sent to System.out is also logged
-System.setOut(new PrintStream(new LoggingOutputStream(Category.getRoot(),
- Priority.INFO), true));
-
-// prevent infinate recursion in LogLog
-LogLog.setPrintStream(se);
-
-
-I can't think of any other way to do it in the current version besides
-getting extremely kludgey by checking the stack to see if it's being called
-from LogLog and logging out the the "real" STDERR then in the
-LoggingOutputStream. It can be done on the theory that LogLog wouldn't be
-called very often, but still...
-
--Jim Moore
-
-
------Original Message-----
-From: Ceki G�lc� [mailto:cgu@qos.ch]
-Sent: Monday, March 12, 2001 5:15 PM
-To: LOG4J Users Mailing List
-Subject: RE: diverting System.stderr/stdout into log4j
-
-
-Jim, Joseph,
-
-Here is a link containing Jim's code:
-
-http://marc.theaimsgroup.com/?l=log4j-user&m=98097669218571&w=2
-
-How does this code handle the infinite recursion problem mentioned by
-Joseph? Ceki
-
-At 17:03 12.03.2001 -0500, Jim Moore wrote:
->Go to the mailing list archives (theAimsGroup.com is the best) and search
->for the thread with the subject of "Capturing System.err"
->
->-Jim Moore
->"I think so, Brain; but if we gave peas a chance, won't the lima beans get
->jealous?" - Pinky
->
->
->-----Original Message-----
->From: Joseph Panico [mailto:joe_panico@hotmail.com]
->Sent: Monday, March 12, 2001 4:43 PM
->To: log4j-user@jakarta.apache.org
->Subject: diverting System.stderr/stdout into log4j
->
->
->Folks,
->
->We use a number of third-party packages that do stderr.print... at various
->random places in their code. I'm finding it quite useful to divert these
->messages into our log4j heirarchy. I do this by replacing stderr/stdout
-with
->
->my own PrintStreams that log the lines to a special log4j Category-- as
->suggested on this list a while back. The only fly-in-the-ointment with this
-
->scheme is LogLog. If there is a problem with log4j such that it cannot log
->for some reason, then log4j internals use LogLog to attempt to print an
->error message. This obviously leads to an infinite recursion. Has anyone
->else been bothered by this? Would it make sense to add interface to LogLog
->which would set the PrintStream it uses to log its error messages to?
->
->thanks for any ideas
->
->joe
-
-I hope to see you at my ApacheCon 2001 presentation
-entitled "Log4j, A Logging Package for Java".
-
-See http://ApacheCon.Com/2001/US/ for more details.
-
-----
-Ceki G�lc� Web: http://qos.ch
-av. de Rumine 5 email: cgu@qos.ch (preferred)
-CH-1005 Lausanne ceki_gulcu@yahoo.com
-Switzerland Tel: ++41 21 351 23 15
-
----------------------------------------------------------------------
-To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
-For additional commands, e-mail: log4j-user-help@jakarta.apache.org
-
-
diff --git a/contribs/JimMoore/mail-2001-03-13T0646 b/contribs/JimMoore/mail-2001-03-13T0646
deleted file mode 100644
index 9b7d019..0000000
--- a/contribs/JimMoore/mail-2001-03-13T0646
+++ /dev/null
@@ -1,214 +0,0 @@
-
-Copied from
-http://www.mail-archive.com/log4j-user@jakarta.apache.org/msg00445.html
-
---------------------------------------------------------------------------------
-RE: diverting System.stderr/stdout into log4j
---------------------------------------------------------------------------------
-
-From: Michael Smith
-Subject: RE: diverting System.stderr/stdout into log4j
-Date: Tue, 13 Mar 2001 06:46:04 -0800
-
---------------------------------------------------------------------------------
-
-There is another way!
-
-In LogLog, completely ignore System.err. Instead, use the following to get
-the standard error stream:
-
-PrintStream err =
- new PrintStream(new FileOutputStream(FileDescriptor.err));
-
-When you use System.setErr, it changes System.err, but not
-FileDescriptor.err, which maintains a descriptor for the original error
-stream.
-
-michael
-
-For a sample program to test this, see below:
-
-import java.io.*;
-
-public class Stderr {
-
- public static void main(String[] args) {
-
- // create a print stream to represent a redirect
- PrintStream nonStandardErr =
- new PrintStream(new ByteArrayOutputStream());
-
- // Redirect standard out and standard err
- System.setOut(nonStandardErr);
- System.setErr(nonStandardErr);
-
- // attempt to print something
- System.err.println("You should *not* see this on the console!");
-
- // the stuff that would appear in LogLog
- PrintStream logLogOut =
- new PrintStream(new FileOutputStream(FileDescriptor.err));
-
- // attempt to print something
- logLogOut.println("You *should* see this on the console!");
- }
-}
-
-
-
-> -----Original Message-----
-> From: Ceki G�lc� [mailto:cgu@qos.ch]
-> Sent: Monday, March 12, 2001 7:18 PM
-> To: LOG4J Users Mailing List
-> Subject: RE: diverting System.stderr/stdout into log4j
->
->
->
-> Hate to follow up on myself, but the System.setErr method
-> reassigns the System.err variable. This can be deduced without
-> experimentation because the user calls the System.err variable
-> directly to print to the console, whatever it might be. Thus, the
-> reference itself must change to allow the System.err variable to
-> point to the new target stream.
->
-> The funny part is that the err variable is declared 'public
-> final' in the JDK source code. The setErr method makes a call to
-> setErr0 which is declared as being 'native'. It looks like the
-> native part is circumventing the JDK restrictions. I find this
-> quite entertaining. Ceki
->
-> At 00:58 13.03.2001 +0100, Ceki G�lc� wrote:
->
-> >Running the risk of disappointing you here, although not full of
-> bugs, log4j is not bug-free as bugs creep out regularly. They
-> just get corrected quickly before many people are affected by them.
-> >
-> >The PrintStream se = System.err; LogLog.setPrintStream(see);
-> combination is simple and rather bright. I initially overlooked
-> the PrintStream se = System.err; part, making me think that a
-> lot of code needed to be modified to cater for the redirected
-> console case. The remedy looked worse than the illness. My fears
-> are largely unfounded and the solution should work quite well if
-> one is careful.
-> >
-> >Regards, Ceki
-> >
-> >ps: I wonder if System.err always refers to the real STDERR or
-> if really gets reassigned with the setErr call. It's easy to find out...
-> >
-> >At 23:20 12.03.2001 +0000, Joseph Panico wrote:
-> >>Of course log4j is completely bug free, but that doesn't
-> preclude user error. For instance, I neglected to add appenders
-> in my config file (actually I intentionally left them out,
-> thinking that would simply turn off logging) and then log4j went
-> into an infinite loop. The setPrintStream makes sense to me.
-> >>
-> >>joe
-> >>
-> >>
-> >>>From: Jim Moore <ji...@veritas.com>
-> >>>Reply-To: "LOG4J Users Mailing List" <lo...@jakarta.apache.org>
-> >>>To: 'LOG4J Users Mailing List' <lo...@jakarta.apache.org>
-> >>>Subject: RE: diverting System.stderr/stdout into log4j
-> >>>Date: Mon, 12 Mar 2001 18:10:37 -0500
-> >>>
-> >>>It doesn't. I haven't worried about it, since log4j doesn't
-> contain any
-> >>>bugs and therefore it would never happen... :)
-> >>>
-> >>>Probably the best way to handle it is to add a
-> >>>LogLog.setPrintStream(PrintStream) method, so you can do
-> something like:
-> >>>
-> >>>// remember STDERR
-> >>>PrintStream se = System.err;
-> >>>
-> >>>// make sure everything sent to System.err is logged
-> >>>System.setErr(new PrintStream(new
-> LoggingOutputStream(Category.getRoot(),
-> >>> Priority.WARN), true));
-> >>>
-> >>>// make sure everything sent to System.out is also logged
-> >>>System.setOut(new PrintStream(new
-> LoggingOutputStream(Category.getRoot(),
-> >>> Priority.INFO), true));
-> >>>
-> >>>// prevent infinate recursion in LogLog
-> >>>LogLog.setPrintStream(se);
-> >>>
-> >>>
-> >>>I can't think of any other way to do it in the current version besides
-> >>>getting extremely kludgey by checking the stack to see if it's
-> being called
-> >>>from LogLog and logging out the the "real" STDERR then in the
-> >>>LoggingOutputStream. It can be done on the theory that LogLog
-> wouldn't be
-> >>>called very often, but still...
-> >>>
-> >>>-Jim Moore
-> >>>
-> >>>
-> >>>-----Original Message-----
-> >>>From: Ceki G�lc� [mailto:cgu@qos.ch]
-> >>>Sent: Monday, March 12, 2001 5:15 PM
-> >>>To: LOG4J Users Mailing List
-> >>>Subject: RE: diverting System.stderr/stdout into log4j
-> >>>
-> >>>
-> >>>Jim, Joseph,
-> >>>
-> >>>Here is a link containing Jim's code:
-> >>>
-> >>>http://marc.theaimsgroup.com/?l=log4j-user&m=98097669218571&w=2
-> >>>
-> >>>How does this code handle the infinite recursion problem mentioned by
-> >>>Joseph? Ceki
-> >>>
-> >>>At 17:03 12.03.2001 -0500, Jim Moore wrote:
-> >>>>Go to the mailing list archives (theAimsGroup.com is the
-> best) and search
-> >>>>for the thread with the subject of "Capturing System.err"
-> >>>>
-> >>>>-Jim Moore
-> >>>>"I think so, Brain; but if we gave peas a chance, won't the
-> lima beans get
-> >>>>jealous?" - Pinky
-> >>>>
-> >>>>
-> >>>>-----Original Message-----
-> >>>>From: Joseph Panico [mailto:joe_panico@hotmail.com]
-> >>>>Sent: Monday, March 12, 2001 4:43 PM
-> >>>>To: log4j-user@jakarta.apache.org
-> >>>>Subject: diverting System.stderr/stdout into log4j
-> >>>>
-> >>>>
-> >>>>Folks,
-> >>>>
-> >>>>We use a number of third-party packages that do
-> stderr.print... at various
-> >>>>random places in their code. I'm finding it quite useful to
-> divert these
-> >>>>messages into our log4j heirarchy. I do this by replacing
-> stderr/stdout
-> >>>with
-> >>>>
-> >>>>my own PrintStreams that log the lines to a special log4j
-> Category-- as
-> >>>>suggested on this list a while back. The only
-> fly-in-the-ointment with this
-> >>>
-> >>>>scheme is LogLog. If there is a problem with log4j such that
-> it cannot log
-> >>>>for some reason, then log4j internals use LogLog to attempt
-> to print an
-> >>>>error message. This obviously leads to an infinite recursion.
-> Has anyone
-> >>>>else been bothered by this? Would it make sense to add
-> interface to LogLog
-> >>>>which would set the PrintStream it uses to log its error messages to?
-> >>>>
-> >>>>thanks for any ideas
-> >>>>
-> >>>>joe
-
-
diff --git a/contribs/KevinSteppe/CompositeRollingAppender.java b/contribs/KevinSteppe/CompositeRollingAppender.java
deleted file mode 100644
index 82f3709..0000000
--- a/contribs/KevinSteppe/CompositeRollingAppender.java
+++ /dev/null
@@ -1,698 +0,0 @@
-package org.apache.log4j;
-
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
- *
- * This software is published under the terms of the Apache Software
- * License version 1.1, a copy of which has been included with this
- * distribution in the LICENSE.APL file.
- */
-
-import org.apache.log4j.RollingCalendar;
-import org.apache.log4j.helpers.OptionConverter;
-import org.apache.log4j.helpers.QuietWriter;
-import org.apache.log4j.helpers.CountingQuietWriter;
-import org.apache.log4j.helpers.LogLog;
-import org.apache.log4j.spi.LoggingEvent;
-
-import java.util.Date;
-import java.io.IOException;
-import java.io.Writer;
-import java.text.SimpleDateFormat;
-import java.io.File;
-import java.io.FilenameFilter;
-
-/**
- * <p>CompositeRollingAppender combines RollingFileAppender and DailyRollingFileAppender<br>
- * It can function as either or do both at the same time (making size
- * based rolling files like RollingFileAppender until a data/time boundary
- * is crossed at which time it rolls all of those files as per the DailyRollingFileAppender)
- * based on the setting for <code>rollingStyle</code>.<br>
- * <br>
- * To use CompositeRollingAppender to roll log files as they reach a certain
- * size (like RollingFileAppender), set rollingStyle=1 (@see config.size)<br>
- * To use CompositeRollingAppender to roll log files at certain time intervals
- * (daily for example), set rollingStyle=2 and a datePattern (@see config.time)<br>
- * To have CompositeRollingAppender roll log files at a certain size AND rename those
- * according to time intervals, set rollingStyle=3 (@see config.composite)<br>
- *
- * <p>A of few additional optional features have been added:<br>
- * -- Attach date pattern for current log file (@see staticLogFileName)<br>
- * -- Backup number increments for newer files (@see countDirection)<br>
- * -- Infinite number of backups by file size (@see maxSizeRollBackups)<br>
- * <br>
- * <p>A few notes and warnings: For large or infinite number of backups
- * countDirection > 0 is highly recommended, with staticLogFileName = false if
- * time based rolling is also used -- this will reduce the number of file renamings
- * to few or none. Changing staticLogFileName or countDirection without clearing
- * the directory could have nasty side effects. If Date/Time based rolling
- * is enabled, CompositeRollingAppender will attempt to roll existing files
- * in the directory without a date/time tag based on the last modified date
- * of the base log files last modification.<br>
- * <br>
- * <p>A maximum number of backups based on date/time boundries would be nice
- * but is not yet implemented.<br>
- *
- * @author Kevin Steppe
- * @author Heinz Richter
- * @author Eirik Lygre
- * @author Ceki Gülcü
- */
-public class CompositeRollingAppender extends org.apache.log4j.FileAppender
-{
- // The code assumes that the following 'time' constants are in a increasing
- // sequence.
- static final int TOP_OF_TROUBLE=-1;
- static final int TOP_OF_MINUTE = 0;
- static final int TOP_OF_HOUR = 1;
- static final int HALF_DAY = 2;
- static final int TOP_OF_DAY = 3;
- static final int TOP_OF_WEEK = 4;
- static final int TOP_OF_MONTH = 5;
-
- /** Style of rolling to use */
- static final int BY_SIZE = 1;
- static final int BY_DATE = 2;
- static final int BY_COMPOSITE = 3;
-
- //Not currently used
- static final String S_BY_SIZE = "Size";
- static final String S_BY_DATE = "Date";
- static final String S_BY_COMPOSITE = "Composite";
-
- /**
- The date pattern. By default, the pattern is set to
- "'.'yyyy-MM-dd" meaning daily rollover.
- */
- private String datePattern = "'.'yyyy-MM-dd";
-
- /** The actual formatted filename that is currently being written to
- or will be the file transferred to on roll over
- (based on staticLogFileName). */
- private String scheduledFilename = null;
-
- /** The timestamp when we shall next recompute the filename. */
- private long nextCheck = System.currentTimeMillis () - 1;
-
- /** Holds date of last roll over */
- Date now = new Date();
-
- SimpleDateFormat sdf;
-
- /** Helper class to determine next rollover time */
- RollingCalendar rc = new RollingCalendar();
-
- /** Current period for roll overs */
- int checkPeriod = TOP_OF_TROUBLE;
-
- /** The default maximum file size is 10MB. */
- protected long maxFileSize = 10*1024*1024;
-
- /** There is zero backup files by default. */
- protected int maxSizeRollBackups = 0;
- /** How many sized based backups have been made so far */
- protected int curSizeRollBackups = 0;
-
- /** not yet implemented */
- protected int maxTimeRollBackups = -1;
- protected int curTimeRollBackups = 0;
-
- /** By default newer files have lower numbers. (countDirection < 0)
- * ie. log.1 is most recent, log.5 is the 5th backup, etc...
- * countDirection > 0 does the opposite ie.
- * log.1 is the first backup made, log.5 is the 5th backup made, etc.
- * For infinite backups use countDirection > 0 to reduce rollOver costs.
- */
- protected int countDirection = -1;
-
- /** Style of rolling to Use. BY_SIZE (1), BY_DATE(2), BY COMPOSITE(3) */
- protected int rollingStyle = BY_COMPOSITE;
- protected boolean rollDate = true;
- protected boolean rollSize = true;
-
- /** By default file.log is always the current file. Optionally
- * file.log.yyyy-mm-dd for current formated datePattern can by the currently
- * logging file (or file.log.curSizeRollBackup or even
- * file.log.yyyy-mm-dd.curSizeRollBackup) This will make time based roll
- * overs with a large number of backups much faster -- it won't have to
- * rename all the backups!
- */
- protected boolean staticLogFileName = true;
-
- /** FileName provided in configuration. Used for rolling properly */
- protected String baseFileName;
-
- /** The default constructor does nothing. */
- public CompositeRollingAppender() {
- }
-
- /**
- Instantiate a <code>CompositeRollingAppender</code> and open the
- file designated by <code>filename</code>. The opened filename will
- become the ouput destination for this appender.
- */
- public CompositeRollingAppender (Layout layout, String filename,
- String datePattern) throws IOException {
- this(layout, filename, datePattern, true);
- }
-
- /**
- Instantiate a CompositeRollingAppender and open the file designated by
- <code>filename</code>. The opened filename will become the ouput
- destination for this appender.
-
- <p>If the <code>append</code> parameter is true, the file will be
- appended to. Otherwise, the file desginated by
- <code>filename</code> will be truncated before being opened.
- */
- public CompositeRollingAppender(Layout layout, String filename, boolean append)
- throws IOException {
- super(layout, filename, append);
- }
-
- /**
- Instantiate a CompositeRollingAppender and open the file designated by
- <code>filename</code>. The opened filename will become the ouput
- destination for this appender.
- */
- public CompositeRollingAppender (Layout layout, String filename,
- String datePattern, boolean append) throws IOException {
- super(layout, filename, append);
- this.datePattern = datePattern;
- activateOptions();
- }
- /**
- Instantiate a CompositeRollingAppender and open the file designated by
- <code>filename</code>. The opened filename will become the output
- destination for this appender.
-
- <p>The file will be appended to. DatePattern is default.
- */
- public CompositeRollingAppender(Layout layout, String filename) throws IOException {
- super(layout, filename);
- }
-
- /**
- The <b>DatePattern</b> takes a string in the same format as
- expected by {@link SimpleDateFormat}. This options determines the
- rollover schedule.
- */
- public void setDatePattern(String pattern) {
- datePattern = pattern;
- }
-
- /** Returns the value of the <b>DatePattern</b> option. */
- public String getDatePattern() {
- return datePattern;
- }
-
- /**
- Returns the value of the <b>maxSizeRollBackups</b> option.
- */
- public int getMaxSizeRollBackups() {
- return maxSizeRollBackups;
- }
-
- /**
- Get the maximum size that the output file is allowed to reach
- before being rolled over to backup files.
-
- @since 1.1
- */
- public long getMaximumFileSize() {
- return maxFileSize;
- }
-
- /**
- <p>Set the maximum number of backup files to keep around based on file size.
-
- <p>The <b>MaxSizeRollBackups</b> option determines how many backup
- files are kept before the oldest is erased. This option takes
- an integer value. If set to zero, then there will be no
- backup files and the log file will be truncated when it reaches
- <code>MaxFileSize</code>. If a negative number is supplied then
- no deletions will be made. Note that this could result in
- very slow performance as a large number of files are rolled over unless
- {@link #setCountDirection} up is used.
-
- <p>The maximum applys to -each- time based group of files and -not- the total.
- Using a daily roll the maximum total files would be (#days run) * (maxSizeRollBackups)
-
- */
- public void setMaxSizeRollBackups(int maxBackups) {
- maxSizeRollBackups = maxBackups;
- }
-
- /**
- Set the maximum size that the output file is allowed to reach
- before being rolled over to backup files.
-
- <p>This method is equivalent to {@link #setMaxFileSize} except
- that it is required for differentiating the setter taking a
- <code>long</code> argument from the setter taking a
- <code>String</code> argument by the JavaBeans {@link
- java.beans.Introspector Introspector}.
-
- @see #setMaxFileSize(String)
- */
- public void setMaxFileSize(long maxFileSize) {
- this.maxFileSize = maxFileSize;
- }
-
- /**
- Set the maximum size that the output file is allowed to reach
- before being rolled over to backup files.
-
- <p>This method is equivalent to {@link #setMaxFileSize} except
- that it is required for differentiating the setter taking a
- <code>long</code> argument from the setter taking a
- <code>String</code> argument by the JavaBeans {@link
- java.beans.Introspector Introspector}.
-
- @see #setMaxFileSize(String)
- */
- public void setMaximumFileSize(long maxFileSize) {
- this.maxFileSize = maxFileSize;
- }
-
- /**
- Set the maximum size that the output file is allowed to reach
- before being rolled over to backup files.
-
- <p>In configuration files, the <b>MaxFileSize</b> option takes an
- long integer in the range 0 - 2^63. You can specify the value
- with the suffixes "KB", "MB" or "GB" so that the integer is
- interpreted being expressed respectively in kilobytes, megabytes
- or gigabytes. For example, the value "10KB" will be interpreted
- as 10240.
- */
- public void setMaxFileSize(String value) {
- maxFileSize = OptionConverter.toFileSize(value, maxFileSize + 1);
- }
-
- protected void setQWForFiles(Writer writer) {
- qw = new CountingQuietWriter(writer, errorHandler);
- }
-
- //Taken verbatum from DailyRollingFileAppender
- int computeCheckPeriod() {
- RollingCalendar c = new RollingCalendar();
- // set sate to 1970-01-01 00:00:00 GMT
- Date epoch = new Date(0);
- if(datePattern != null) {
- for(int i = TOP_OF_MINUTE; i <= TOP_OF_MONTH; i++) {
- String r0 = sdf.format(epoch);
- c.setType(i);
- Date next = new Date(c.getNextCheckMillis(epoch));
- String r1 = sdf.format(next);
- //LogLog.debug("Type = "+i+", r0 = "+r0+", r1 = "+r1);
- if(r0 != null && r1 != null && !r0.equals(r1)) {
- return i;
- }
- }
- }
- return TOP_OF_TROUBLE; // Deliberately head for trouble...
- }
-
- //Now for the new stuff
- /**
- * Handles append time behavior for CompositeRollingAppender. This checks
- * if a roll over either by date (checked first) or time (checked second)
- * is need and then appends to the file last.
- */
- protected void subAppend(LoggingEvent event) {
-
- if (rollDate) {
- long n = System.currentTimeMillis();
- if (n >= nextCheck) {
- now.setTime(n);
- nextCheck = rc.getNextCheckMillis(now);
-
- rollOverTime();
- }
- }
-
- if (rollSize) {
- if ((fileName != null) && ((CountingQuietWriter) qw).getCount() >= maxFileSize) {
- rollOverSize();
- }
- }
-
- super.subAppend(event);
- }
-
- public void setFile(String file)
- {
- baseFileName = file.trim();
- fileName = file.trim();
- }
-
- /**
- * Creates and opens the file for logging. If <code>staticLogFileName</code>
- * is false then the fully qualified name is determined and used.
- */
- public synchronized void setFile(String fileName, boolean append) throws IOException {
- if (!staticLogFileName) {
- scheduledFilename = fileName = fileName.trim() + sdf.format(now);
- if (countDirection > 0) {
- scheduledFilename = fileName = fileName + '.' + (++curSizeRollBackups);
- }
- }
-
- super.setFile(fileName, append);
- if(append) {
- File f = new File(fileName);
- ((CountingQuietWriter) qw).setCount(f.length());
- }
- }
-
- public int getCountDirection() {
- return countDirection;
- }
-
- public void setCountDirection(int direction) {
- countDirection = direction;
- }
-
- public int getRollingStyle () {
- return rollingStyle;
- }
-
- public void setRollingStyle(int style) {
- rollingStyle = style;
- switch (rollingStyle) {
- case BY_SIZE:
- rollDate = false;
- rollSize = true;
- break;
- case BY_DATE:
- rollDate = true;
- rollSize = false;
- break;
- case BY_COMPOSITE:
- rollDate = true;
- rollSize = true;
- break;
- default:
- errorHandler.error("Invalid rolling Style, use 1 (by size only), 2 (by date only) or 3 (both)");
- }
- }
-
-/*
- public void setRollingStyle(String style) {
- if (style == S_BY_SIZE) {
- rollingStyle = BY_SIZE;
- }
- else if (style == S_BY_DATE) {
- rollingStyle = BY_DATE;
- }
- else if (style == S_BY_COMPOSITE) {
- rollingStyle = BY_COMPOSITE;
- }
- }
-*/
- public boolean getStaticLogFileName() {
- return staticLogFileName;
- }
-
- public void setStaticLogFileName(boolean s) {
- staticLogFileName = s;
- }
-
- public void setStaticLogFileName(String value) {
- setStaticLogFileName(OptionConverter.toBoolean(value, true));
- }
-
- /**
- * Initializes based on exisiting conditions at time of <code>
- * activateOptions</code>. The following is done:<br>
- * <br>
- * A) determine curSizeRollBackups<br>
- * B) determine curTimeRollBackups (not implemented)<br>
- * C) initiates a roll over if needed for crossing a date boundary since
- * the last run.
- */
- protected void existingInit() {
-
- curSizeRollBackups = 0;
- curTimeRollBackups = 0;
-
- //part A starts here
- String filter;
- if (staticLogFileName || !rollDate) {
- filter = baseFileName + ".*";
- }
- else {
- filter = scheduledFilename + ".*";
- }
-
- File f = new File(baseFileName);
- f = f.getParentFile();
- if (f == null)
- f = new File(".");
-
- LogLog.debug("Searching for existing files in: " + f);
- String[] files = f.list();
-
- if (files != null) {
- for (int i = 0; i < files.length; i++) {
- if (!files[i].startsWith(baseFileName))
- continue;
-
- int index = files[i].lastIndexOf(".");
-
- if (staticLogFileName) {
- int endLength = files[i].length() - index;
- if (baseFileName.length() + endLength != files[i].length()) {
- //file is probably scheduledFilename + .x so I don't care
- continue;
- }
- }
-
- try {
- int backup = Integer.parseInt(files[i].substring(index + 1, files[i].length()));
- LogLog.debug("From file: " + files[i] + " -> " + backup);
- if (backup > curSizeRollBackups)
- curSizeRollBackups = backup;
- }
- catch (Exception e) {
- //this happens when file.log -> file.log.yyyy-mm-dd which is normal
- //when staticLogFileName == false
- LogLog.debug("Encountered a backup file not ending in .x " + files[i]);
- }
- }
- }
- LogLog.debug("curSizeRollBackups starts at: " + curSizeRollBackups);
- //part A ends here
-
- //part B not yet implemented
-
- //part C
- if (staticLogFileName && rollDate) {
- File old = new File(baseFileName);
- if (old.exists()) {
- Date last = new Date(old.lastModified());
- if (!(sdf.format(last).equals(sdf.format(now)))) {
- scheduledFilename = baseFileName + sdf.format(last);
- LogLog.debug("Initial roll over to: " + scheduledFilename);
- rollOverTime();
- }
- }
- }
- LogLog.debug("curSizeRollBackups after rollOver at: " + curSizeRollBackups);
- //part C ends here
-
- }
-
- /**
- * Sets initial conditions including date/time roll over information, first check,
- * scheduledFilename, and calls <code>existingInit</code> to initialize
- * the current # of backups.
- */
- public void activateOptions() {
-
- //REMOVE removed rollDate from boolean to enable Alex's change
- if(datePattern != null) {
- now.setTime(System.currentTimeMillis());
- sdf = new SimpleDateFormat(datePattern);
- int type = computeCheckPeriod();
- //printPeriodicity(type);
- rc.setType(type);
- //next line added as this removes the name check in rollOver
- nextCheck = rc.getNextCheckMillis(now);
- } else {
- if (rollDate)
- LogLog.error("Either DatePattern or rollingStyle options are not set for ["+
- name+"].");
- }
-
- existingInit();
-
- super.activateOptions();
-
- if (rollDate && fileName != null && scheduledFilename == null)
- scheduledFilename = fileName + sdf.format(now);
- }
-
- /**
- Rollover the file(s) to date/time tagged file(s).
- Opens the new file (through setFile) and resets curSizeRollBackups.
- */
- protected void rollOverTime() {
-
- curTimeRollBackups++;
-
- //delete the old stuff here
-
- if (staticLogFileName) {
- /* Compute filename, but only if datePattern is specified */
- if (datePattern == null) {
- errorHandler.error("Missing DatePattern option in rollOver().");
- return;
- }
-
- //is the new file name equivalent to the 'current' one
- //something has gone wrong if we hit this -- we should only
- //roll over if the new file will be different from the old
- String dateFormat = sdf.format(now);
- if (scheduledFilename.equals(fileName + dateFormat)) {
- errorHandler.error("Compare " + scheduledFilename + " : " + fileName + dateFormat);
- return;
- }
-
- // close current file, and rename it to datedFilename
- this.closeFile();
-
- //we may have to roll over a large number of backups here
- String from, to;
- for (int i = 1; i <= curSizeRollBackups; i++) {
- from = fileName + '.' + i;
- to = scheduledFilename + '.' + i;
- rollFile(from, to);
- }
-
- rollFile(fileName, scheduledFilename);
- }
-
- try {
- // This will also close the file. This is OK since multiple
- // close operations are safe.
- curSizeRollBackups = 0; //We're cleared out the old date and are ready for the new
-
- //new scheduled name
- scheduledFilename = fileName + sdf.format(now);
- this.setFile(baseFileName, false);
- }
- catch(IOException e) {
- errorHandler.error("setFile("+fileName+", false) call failed.");
- }
-
- }
-
- /** Renames file <code>from</code> to file <code>to</code>. It
- * also checks for existence of target file and deletes if it does.
- */
- protected static void rollFile(String from, String to) {
- File target = new File(to);
- if (target.exists()) {
- LogLog.debug("deleting existing target file: " + target);
- target.delete();
- }
-
- File file = new File(from);
- file.renameTo(target);
- LogLog.debug(from +" -> "+ to);
- }
-
- /** Delete's the specified file if it exists */
- protected static void deleteFile(String fileName) {
- File file = new File(fileName);
- if (file.exists()) {
- file.delete();
- }
- }
-
- /**
- Implements roll overs base on file size.
-
- <p>If the maximum number of size based backups is reached
- (<code>curSizeRollBackups == maxSizeRollBackups</code) then the oldest
- file is deleted -- it's index determined by the sign of countDirection.<br>
- If <code>countDirection</code> < 0, then files
- {<code>File.1</code>, ..., <code>File.curSizeRollBackups -1</code>}
- are renamed to {<code>File.2</code>, ...,
- <code>File.curSizeRollBackups</code>}. Moreover, <code>File</code> is
- renamed <code>File.1</code> and closed.<br>
-
- A new file is created to receive further log output.
-
- <p>If <code>maxSizeRollBackups</code> is equal to zero, then the
- <code>File</code> is truncated with no backup files created.
-
- <p>If <code>maxSizeRollBackups</code> < 0, then <code>File</code> is
- renamed if needed and no files are deleted.
- */
-
- // synchronization not necessary since doAppend is alreasy synched
- protected void rollOverSize() {
- File file;
-
- this.closeFile(); // keep windows happy.
-
- LogLog.debug("rolling over count=" + ((CountingQuietWriter) qw).getCount());
- LogLog.debug("maxSizeRollBackups = " + maxSizeRollBackups);
- LogLog.debug("curSizeRollBackups = " + curSizeRollBackups);
- LogLog.debug("countDirection = " + countDirection);
-
- // If maxBackups <= 0, then there is no file renaming to be done.
- if (maxSizeRollBackups != 0) {
-
- if (countDirection < 0) {
- // Delete the oldest file, to keep Windows happy.
- if (curSizeRollBackups == maxSizeRollBackups) {
- deleteFile(fileName + '.' + maxSizeRollBackups);
- curSizeRollBackups--;
- }
-
- // Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
- for (int i = curSizeRollBackups; i >= 1; i--) {
- rollFile((fileName + "." + i), (fileName + '.' + (i + 1)));
- }
-
- curSizeRollBackups++;
- // Rename fileName to fileName.1
- rollFile(fileName, fileName + ".1");
-
- } //REMOVE This code branching for Alexander Cerna's request
- else if (countDirection == 0) {
- //rollFile based on date pattern
- curSizeRollBackups++;
- now.setTime(System.currentTimeMillis());
- scheduledFilename = fileName + sdf.format(now);
- rollFile(fileName, scheduledFilename);
- }
- else { //countDirection > 0
- if (curSizeRollBackups >= maxSizeRollBackups && maxSizeRollBackups > 0) {
- //delete the first and keep counting up.
- int oldestFileIndex = curSizeRollBackups - maxSizeRollBackups + 1;
- deleteFile(fileName + '.' + oldestFileIndex);
- }
-
- if (staticLogFileName) {
- curSizeRollBackups++;
- rollFile(fileName, fileName + '.' + curSizeRollBackups);
- }
- }
- }
-
- try {
- // This will also close the file. This is OK since multiple
- // close operations are safe.
- this.setFile(baseFileName, false);
- }
- catch(IOException e) {
- LogLog.error("setFile("+fileName+", false) call failed.", e);
- }
- }
-
-}
\ No newline at end of file
diff --git a/contribs/KevinSteppe/JDBCTest.java b/contribs/KevinSteppe/JDBCTest.java
deleted file mode 100644
index 70ee1ab..0000000
--- a/contribs/KevinSteppe/JDBCTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.apache.log4j.varia.test;
-
-
-import org.apache.log4j.varia.JDBCAppender;
-import org.apache.log4j.*;
-
-
-public class JDBCTest
-{
- public static void main (String argv[])
- {
- try {
- Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.out.println(e.toString());
- }
-
-
- Category rootLog = Category.getRoot();
- Layout layout = new PatternLayout("%p [%t] %c - %m%n");
- JDBCAppender appender = new JDBCAppender();
- appender.setLayout(layout);
- appender.setOption(JDBCAppender.URL_OPTION, "jdbc:odbc:someDB");
-
-
- appender.setOption(JDBCAppender.USER_OPTION, "auser");
- appender.setOption(JDBCAppender.PASSWORD_OPTION, "thepassword");
-
-
-
- rootLog.addAppender(appender);
-
-
- try {
- Category log = Category.getInstance("main");
- log.debug("Debug 1");
- Thread.sleep(500);
- log.info("info 1");
- Thread.sleep(500);
- log.warn("warn 1");
- Thread.sleep(500);
- log.error("error 1");
- Thread.sleep(500);
- log.fatal("fatal 1");
- Thread.sleep(500);
-
-
- appender.setOption(JDBCAppender.BUFFER_OPTION, "5");
- log.debug("Debug 2");
- Thread.sleep(500);
- log.info("info 2");
- Thread.sleep(500);
- log.warn("warn 2");
- Thread.sleep(500);
- log.error("error 2");
- Thread.sleep(500);
- log.fatal("fatal 2");
- Thread.sleep(500);
-
-
- appender.setOption(JDBCAppender.BUFFER_OPTION, "2");
- appender.setThreshold(Priority.WARN);
- log.debug("Debug 3");
- Thread.sleep(500);
- log.info("info 3");
- Thread.sleep(500);
- log.warn("warn 3");
- Thread.sleep(500);
- log.error("error 3");
- Thread.sleep(500);
- log.fatal("fatal 3");
- }
- catch (InterruptedException e)
- {
- System.out.println("Interrupted");
- }
- }
-}
diff --git a/contribs/KevinSteppe/mail-2001-02-01 b/contribs/KevinSteppe/mail-2001-02-01
deleted file mode 100644
index 5024da8..0000000
--- a/contribs/KevinSteppe/mail-2001-02-01
+++ /dev/null
@@ -1,542 +0,0 @@
-Delivered-To: urba-cgu@urbanet.ch
-Mailing-List: contact log4j-user-help@jakarta.apache.org; run by ezmlm
-List-Post: <ma...@jakarta.apache.org>
-List-Help: <ma...@jakarta.apache.org>
-List-Unsubscribe: <ma...@jakarta.apache.org>
-List-Subscribe: <ma...@jakarta.apache.org>
-Reply-To: "LOG4J Users Mailing List" <lo...@jakarta.apache.org>
-Delivered-To: mailing list log4j-user@jakarta.apache.org
-Date: Thu, 01 Feb 2001 14:26:34 -0800
-From: Kevin Steppe <ks...@pacbell.net>
-X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U)
-X-Accept-Language: en
-To: LOG4J Users Mailing List <lo...@jakarta.apache.org>
-Subject: JDBC Appender
-X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
-
-
-Ok, here it is. Since there will be differences in database schemas and
-connection/execution methods, I wrote this with the intention that those
-parts would be overriden by subclasses (that's what I'm doing for my
-company), however it will work as is if you have a stored procedure
-spLog @msg. I'm sure there are optimizations which could be done.
-
-
-The code for org.apache.log4j.varia.JDBCAppender and
-org.apache.log4j.varia.test.JDBCTest follow and files attached. At the
-bottem is the SQL I used to test this on M$ SQL-Server.
-
-
-I help this proves useful,
-Kevin
-
-
-
-
-package org.apache.log4j.varia;
-
-
-import org.apache.log4j.*;
-import org.apache.log4j.spi.*;
-
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-
-import java.sql.DriverManager;
-import java.sql.Connection;
-import java.sql.Statement;
-import java.sql.SQLException;
-
-
-/**
- * Contribution from MD Data Direct.
- *
- * Implements an ArrayList buffer before storing messages to the DB.
- * Override getSQL to fit your database schema (or implement spLog msg
-on your DB)
- * Override executeSQL to modify how DB connection and SQL execution is
-made.
- *
- * @author: Kevin Steppe
- */
-public class JDBCAppender extends org.apache.log4j.AppenderSkeleton
- implements org.apache.log4j.Appender
-{
- protected String databaseURL = "jdbc:odbc:myDB";
- protected String databaseUser = "me";
- protected String databasePassword = "mypassword";
-
-
- public static final String URL_OPTION = "URL";
- public static final String USER_OPTION = "User";
- public static final String PASSWORD_OPTION = "Password";
- public static final String BUFFER_OPTION = "Buffer";
- protected int bufferSize = 1;
- protected List buffer;
-
-
- public JDBCAppender()
- {
- super();
- buffer = new ArrayList();
- }
-
-
- public void append(LoggingEvent event)
- {
- buffer.add(event);
-
-
- if (buffer.size() >= bufferSize)
- flushBuffer();
- }
-
-
- public void close()
- {
- flushBuffer();
- this.closed = true;
- }
-
-
- public void setOption(String key, String value)
- {
- super.setOption(key, value);
-
-
- if (key.equalsIgnoreCase(URL_OPTION))
- databaseURL = value;
- else if (key.equalsIgnoreCase(USER_OPTION))
- databaseUser = value;
- else if (key.equalsIgnoreCase(PASSWORD_OPTION))
- databasePassword = value;
- else if (key.equalsIgnoreCase(BUFFER_OPTION))
- bufferSize = Integer.parseInt(value);
- }
-
-
- /**
- * Override this to create the SQL needed for your DB schema
- */
- protected String getSQL(LoggingEvent event)
- {
- String msg = this.layout.format(event);
- String sql = "spLog '" + msg + "'";
- return sql;
- }
-
-
- /**
- * Override this to provide an alertnate method of getting
-connections (such as caching)
- * This implementation creates a new connection and statement for
-every execution which
- * is very wastefull. One method to fix this is to open connections
-at the start of
- * flushBuffer() and close them at the end. MD Data uses a
-connection pool outside
- * of JDBCAppender which is accessed in the override of this method.
-
-
- */
- protected void executeSQL(String sql) throws SQLException
- {
- Connection con = null;
- Statement stmt = null;
-
-
- try {
- con = DriverManager.getConnection(databaseURL, databaseUser,
-databasePassword);
- stmt = con.createStatement();
- stmt.executeUpdate(sql);
- }
- catch (SQLException e)
- {
- if (con != null)
- con.close();
- if (stmt != null)
- stmt.close();
-
-
- throw e;
- }
- stmt.close();
- con.close();
- }
-
-
- public void flushBuffer()
- {
- //Do the actual logging
- for (Iterator i = buffer.iterator(); i.hasNext();)
- {
- try {
- String sql = getSQL((LoggingEvent)i.next());
- executeSQL(sql);
- }
- catch (SQLException e)
- {
- errorHandler.error("Failed to excute sql", e,
-ErrorCode.FLUSH_FAILURE);
- }
- }
- buffer.clear();
- }
-
-
- public void finalize()
- {
- close();
- }
-
-
- public boolean requiresLayout()
- {
- return true;
- }
-
-
-}
-
-
-
-package org.apache.log4j.varia.test;
-
-
-import org.apache.log4j.varia.JDBCAppender;
-import org.apache.log4j.*;
-
-
-public class JDBCTest
-{
- public static void main (String argv[])
- {
- try {
- Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.out.println(e.toString());
- }
-
-
- Category rootLog = Category.getRoot();
- Layout layout = new PatternLayout("%p [%t] %c - %m%n");
- JDBCAppender appender = new JDBCAppender();
- appender.setLayout(layout);
- appender.setOption(JDBCAppender.URL_OPTION, "jdbc:odbc:someDB");
-
-
- appender.setOption(JDBCAppender.USER_OPTION, "auser");
- appender.setOption(JDBCAppender.PASSWORD_OPTION, "thepassword");
-
-
-
- rootLog.addAppender(appender);
-
-
- try {
- Category log = Category.getInstance("main");
- log.debug("Debug 1");
- Thread.sleep(500);
- log.info("info 1");
- Thread.sleep(500);
- log.warn("warn 1");
- Thread.sleep(500);
- log.error("error 1");
- Thread.sleep(500);
- log.fatal("fatal 1");
- Thread.sleep(500);
-
-
- appender.setOption(JDBCAppender.BUFFER_OPTION, "5");
- log.debug("Debug 2");
- Thread.sleep(500);
- log.info("info 2");
- Thread.sleep(500);
- log.warn("warn 2");
- Thread.sleep(500);
- log.error("error 2");
- Thread.sleep(500);
- log.fatal("fatal 2");
- Thread.sleep(500);
-
-
- appender.setOption(JDBCAppender.BUFFER_OPTION, "2");
- appender.setThreshold(Priority.WARN);
- log.debug("Debug 3");
- Thread.sleep(500);
- log.info("info 3");
- Thread.sleep(500);
- log.warn("warn 3");
- Thread.sleep(500);
- log.error("error 3");
- Thread.sleep(500);
- log.fatal("fatal 3");
- }
- catch (InterruptedException e)
- {
- System.out.println("Interrupted");
- }
- }
-}
-
-
-
-drop table JDBCAppenderTest
-go
-create table JDBCAppenderTest (EventID int identity, entrytime datetime,
-message varchar(255))
-
-
-drop procedure spLog
-go
-create procedure spLog (@msg varchar(255)) as
- insert into JDBCAppenderTest (message, entrytime) values (@msg,
-getdate())
-
-
-select * from JDBCAppenderTest
-
-
-
-drop table JDBCAppenderTest
-go
-create table JDBCAppenderTest (EventID int identity, entrytime datetime, message varchar(255))
-
-
-drop procedure spLog
-go
-create procedure spLog (@msg varchar(255)) as
- insert into JDBCAppenderTest (message, entrytime) values (@msg, getdate())
-
-
-select * from JDBCAppenderTest
-package org.apache.log4j.varia;
-
-
-import org.apache.log4j.*;
-import org.apache.log4j.spi.*;
-
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-
-import java.sql.DriverManager;
-import java.sql.Connection;
-import java.sql.Statement;
-import java.sql.SQLException;
-
-
-/**
- * Contribution from MD Data Direct.
- *
- * Implements an ArrayList buffer before storing messages to the DB.
- * Override getSQL to fit your database schema (or implement spLog msg on your DB)
- * Override executeSQL to modify how DB connection and SQL execution is made.
- *
- * @author: Kevin Steppe
- */
-public class JDBCAppender extends org.apache.log4j.AppenderSkeleton
- implements org.apache.log4j.Appender
-{
- protected String databaseURL = "jdbc:odbc:myDB";
- protected String databaseUser = "me";
- protected String databasePassword = "mypassword";
-
- public static final String URL_OPTION = "URL";
- public static final String USER_OPTION = "User";
- public static final String PASSWORD_OPTION = "Password";
- public static final String BUFFER_OPTION = "Buffer";
- protected int bufferSize = 1;
- protected List buffer;
-
- public JDBCAppender()
- {
- super();
- buffer = new ArrayList();
- }
-
- public void append(LoggingEvent event)
- {
- buffer.add(event);
-
- if (buffer.size() >= bufferSize)
- flushBuffer();
- }
-
-
- public void close()
- {
- flushBuffer();
- this.closed = true;
- }
-
-
- public void setOption(String key, String value)
- {
- super.setOption(key, value);
-
- if (key.equalsIgnoreCase(URL_OPTION))
- databaseURL = value;
- else if (key.equalsIgnoreCase(USER_OPTION))
- databaseUser = value;
- else if (key.equalsIgnoreCase(PASSWORD_OPTION))
- databasePassword = value;
- else if (key.equalsIgnoreCase(BUFFER_OPTION))
- bufferSize = Integer.parseInt(value);
- }
-
-
- /**
- * Override this to create the SQL needed for your DB schema
- */
- protected String getSQL(LoggingEvent event)
- {
- String msg = this.layout.format(event);
- String sql = "spLog '" + msg + "'";
- System.out.println(sql); //DEBUG
- return sql;
- }
-
- /**
- * Override this to provide an alertnate method of getting connections (such as caching)
- * This implementation creates a new connection and statement for every execution which
- * is very wastefull. One method to fix this is to open connections at the start of
- * flushBuffer() and close them at the end. MD Data uses a connection pool outside
- * of JDBCAppender which is accessed in the override of this method.
- */
- protected void executeSQL(String sql) throws SQLException
- {
- Connection con = null;
- Statement stmt = null;
-
-
- try {
- con = DriverManager.getConnection(databaseURL, databaseUser, databasePassword);
- stmt = con.createStatement();
- stmt.executeUpdate(sql);
- }
- catch (SQLException e)
- {
- if (con != null)
- con.close();
- if (stmt != null)
- stmt.close();
-
- throw e;
- }
- stmt.close();
- con.close();
- }
-
- public void flushBuffer()
- {
- //Do the actual logging
- for (Iterator i = buffer.iterator(); i.hasNext();)
- {
- try {
- String sql = getSQL((LoggingEvent)i.next());
- executeSQL(sql);
- }
- catch (SQLException e)
- {
- errorHandler.error("Failed to excute sql", e, ErrorCode.FLUSH_FAILURE);
- }
- }
- buffer.clear();
- }
-
- public void finalize()
- {
- close();
- }
-
- public boolean requiresLayout()
- {
- return true;
- }
-
-
-}package org.apache.log4j.varia.test;
-
-
-import org.apache.log4j.varia.JDBCAppender;
-import org.apache.log4j.*;
-
-
-public class JDBCTest
-{
- public static void main (String argv[])
- {
- try {
- Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.out.println(e.toString());
- }
-
- Category rootLog = Category.getRoot();
- Layout layout = new PatternLayout("%p [%t] %c - %m%n");
- JDBCAppender appender = new JDBCAppender();
- appender.setLayout(layout);
- appender.setOption(JDBCAppender.URL_OPTION, "jdbc:odbc:someDB");
- appender.setOption(JDBCAppender.USER_OPTION, "auser");
- appender.setOption(JDBCAppender.PASSWORD_OPTION, "thepassword");
-
- rootLog.addAppender(appender);
-
-
- try {
- Category log = Category.getInstance("main");
- log.debug("Debug 1");
- Thread.sleep(500);
- log.info("info 1");
- Thread.sleep(500);
- log.warn("warn 1");
- Thread.sleep(500);
- log.error("error 1");
- Thread.sleep(500);
- log.fatal("fatal 1");
- Thread.sleep(500);
-
- appender.setOption(JDBCAppender.BUFFER_OPTION, "5");
- log.debug("Debug 2");
- Thread.sleep(500);
- log.info("info 2");
- Thread.sleep(500);
- log.warn("warn 2");
- Thread.sleep(500);
- log.error("error 2");
- Thread.sleep(500);
- log.fatal("fatal 2");
- Thread.sleep(500);
-
-
- appender.setOption(JDBCAppender.BUFFER_OPTION, "2");
- appender.setThreshold(Priority.WARN);
- log.debug("Debug 3");
- Thread.sleep(500);
- log.info("info 3");
- Thread.sleep(500);
- log.warn("warn 3");
- Thread.sleep(500);
- log.error("error 3");
- Thread.sleep(500);
- log.fatal("fatal 3");
- }
- catch (InterruptedException e)
- {
- System.out.println("Interrupted");
- }
- }
-}
diff --git a/contribs/KevinSteppe/mail-2002-03-27.txt b/contribs/KevinSteppe/mail-2002-03-27.txt
deleted file mode 100644
index 22505e3..0000000
--- a/contribs/KevinSteppe/mail-2002-03-27.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-Received: (qmail 12476 invoked from network); 28 Mar 2002 06:19:49 -0000
-Date: Wed, 27 Mar 2002 22:28:58 -0800
-From: Kevin Steppe <ks...@pacbell.net>
-Subject: Re: RollingFileAppender and DailyRollingFileAppender
-To: Log4J Users List <lo...@jakarta.apache.org>
-Reply-To: ksteppe@pacbell.net
-Message-id: <3C...@pacbell.net>
-MIME-version: 1.0
-X-Mailer: Mozilla 4.7 [en] (WinNT; I)
-Content-type: multipart/mixed; boundary="Boundary_(ID_TnKsnil+d0oYB9TV0P+fgA)"
-X-Accept-Language: en
-References:
- <8D...@tepg-server2.tepgsyd.tycoint.com.au>
-X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
-
-I wrote a CompositeRollingAppender last August to do that. I'm attaching that
-code and some example config files to you separately.
-
-Ceki... Could you please put these files in the log4j/contribs/KevinSteppe
-folder of the available releases? This seems to be coming up occasionally and
-it would be more convenient to just point people there.
-
-Thanks,
-Kevin
-
-
-Janusz Dalecki wrote:
-
-> Is there a way of having the mixture of both RollingFileAppender and
-> DailyRollingFileAppender options?. I have a requirement to log daily and
-> delete old files weekly.
-> Thanks,
-> Janusz
->
-> --
-> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
-> For additional commands, e-mail: <ma...@jakarta.apache.org>
-
-#Config file for CompositeRollingAppender
-#This is an example config to use CompositeRollingAppender in Size based Backups only
-
-log4j.rootCategory=debug, R
-log4j.appender.R=org.apache.log4j.CompositeRollingAppender
-
-#How to perform rolling -- 1 = By Size
-#Note -- this is the only difference from RollingFileAppender!
-log4j.appender.R.RollingStyle=1
-
-#file to log to
-log4j.appender.R.File=example.log
-
-#Size Rolling params
-log4j.appender.R.MaxFileSize=10MB
-log4j.appender.R.MaxSizeRollBackups=10
-
-#layout options
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
-#Config file for CompositeRollingAppender
-#This is an example config to use CompositeRollingAppender in Time based Backups only
-
-log4j.rootCategory=debug, R
-log4j.appender.R=org.apache.log4j.CompositeRollingAppender
-
-#How to perform rolling -- 2 = By Time
-#Note -- this is the only difference from DailyRollingFileAppender!
-log4j.appender.R.RollingStyle=2
-
-#file to log to
-log4j.appender.R.File=example.log
-
-#Date Rolling params
-log4j.appender.R.datePattern='.'yyyy-MM-dd
-
-#layout options
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
-#Default Config file for CompositeRollingAppender
-log4j.rootCategory=debug, R
-
-log4j.appender.R=org.apache.log4j.CompositeRollingAppender
-
-#How to perform rolling -- Composite is the default
-log4j.appender.R.RollingStyle=3
-
-#Use same file name for all inprocess logging?
-log4j.appender.R.staticLogFileName=true
-log4j.appender.R.File=example.log
-
-#Size Rolling params
-log4j.appender.R.CountDirection=-1
-log4j.appender.R.MaxFileSize=5KB
-log4j.appender.R.MaxSizeRollBackups=10
-
-#Date Rolling params
-log4j.appender.R.datePattern='.'yyyy-MM-dd
-
-#layout options
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
-
diff --git a/contribs/KitchingSimon/DatagramStringAppender.java b/contribs/KitchingSimon/DatagramStringAppender.java
deleted file mode 100644
index a532f96..0000000
--- a/contribs/KitchingSimon/DatagramStringAppender.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
- *
- * This software is published under the terms of the Apache Software
- * License version 1.1, a copy of which has been included with this
- * distribution in the LICENSE.APL file. */
-
-package org.apache.log4j.net;
-
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.DatagramPacket;
-import java.net.UnknownHostException;
-import java.net.SocketException;
-
-import org.apache.log4j.helpers.OptionConverter;
-import org.apache.log4j.AppenderSkeleton;
-import org.apache.log4j.spi.LoggingEvent;
-import org.apache.log4j.Category;
-import org.apache.log4j.Priority;
-import org.apache.log4j.Layout;
-
-import org.apache.log4j.helpers.SingleLineTracerPrintWriter;
-import org.apache.log4j.helpers.LogLog;
-import org.apache.log4j.helpers.QuietWriter;
-
-
-/**
- Use DatagramStringAppender to send log messages to a remote daemon
- which accepts Datagram (UDP) messages.
- <p>
- The benefits of UDP are that the client is guarunteed not to
- slow down if the network or remote log daemon is slow, and that
- no permanent TCP connection between client and server exists.
- <p>
- The disadvantages are that log messages can be lost if the network
- or remote daemon are under excessive load.
- <p>
- This class builts the final message string <b>before</b> sending
- the UDP packet, hence the "string" component in the class name. This
- means that the receiving application can be written in any language.
- The data is transmitted in whatever encoding is specified in the
- configuration file; this may be an 8-bit encoding (eg ISO-8859-1, also
- known as LATIN-1) or a larger encoding, eg UTF-16.
- <p>
- An alternative to building the message string within DatagramStringAppender
- would be to serialize & send the complete logging event object (perhaps
- such a class could be called a DatagramSerialAppender??). The
- receiving end could then be configured with appropriate Layout objects
- to generate the actual logged messages. This would ensure that the
- logging of messages from different sources is done in a consistent
- format, and give a central place to configure that format. It would ensure
- (by transmitting messages as unicode) that the receiving end could control
- the encoding in which the output is generated. It also would possibly allow
- he receiving end to use the full log4j flexibility to pass the event to
- different appenders at the receiving end, as the category information is
- retained, etc. However, this does require that the receiving end is in
- java, and that all clients of the logging daemon are java applications.
- In contrast, this DatagramStringAppender can send mesages to a log daemon
- that accepts messages from a variety of sources.
-
- @author Simon Kitching
- */
-public class DatagramStringAppender extends AppenderSkeleton {
-
- /**
- A string constant used in naming the option for setting the destination
- server for messages. Current value of this string constant is
- <b>DatagramHost</b>. */
- public static final String DATAGRAM_HOST_OPTION = "DatagramHost";
-
- /**
- A string constant used in naming the option for setting the destination
- port for messages. Current value of this string constant is
- <b>DatagramPort</b>. */
- public static final String DATAGRAM_PORT_OPTION = "DatagramPort";
-
- /**
- A string constant used in naming the option for setting the character
- encoding used when generating the log message. Current value of this
- string constant is <b>DatagramEncoding</b>. */
- public static final String DATAGRAM_ENCODING_OPTION = "DatagramEncoding";
-
- /**
- The default value for the "host" attribute, ie the machine to which
- messages are sent. Current value of this string constant is
- <b>localhost</b>. */
- public static final String DEFAULT_HOST = "localhost";
-
- /**
- The default value for the "port" attribute, ie the UDP port to which
- messages are sent. Current value of this integer constant is
- <b>8200</b>. This value was chosen for no particular reason. */
- public static final int DEFAULT_PORT = 8200;
-
- /**
- The default value for the "encoding" attribute, ie the way in which
- unicode message strings are converted into a stream of bytes before
- their transmission as a UDP packet. The current value of this constant
- is <b>null</b>, which means that the default platform encoding will
- be used. */
- public static final String DEFAULT_ENCODING = null;
-
- String host = DEFAULT_HOST;
- int port = DEFAULT_PORT;
- String encoding = DEFAULT_ENCODING;
-
- SingleLineTracerPrintWriter stp;
- QuietWriter qw;
-
- public
- DatagramStringAppender() {
- this.setDestination(DEFAULT_HOST, DEFAULT_PORT, DEFAULT_ENCODING);
- }
-
- public
- DatagramStringAppender(Layout layout) {
- this.setLayout(layout);
- this.setDestination(DEFAULT_HOST, DEFAULT_PORT, DEFAULT_ENCODING);
- }
-
- public
- DatagramStringAppender(Layout layout, String host, int port) {
- this.setLayout(layout);
- this.setDestination(host, port, DEFAULT_ENCODING);
- }
-
- public
- DatagramStringAppender(Layout layout, String host, int port, String encoding) {
- this.setLayout(layout);
- this.setDestination(host, port, encoding);
- }
-
- /**
- Release any resources held by this Appender
- */
- public
- void close() {
- closed = true;
- // A DatagramWriter is UDP based and needs no opening. Hence, it
- // can't be closed. We just unset the variables here.
- qw = null;
- stp = null;
- }
-
- public
- void append(LoggingEvent event) {
- if(!isAsSevereAsThreshold(event.priority))
- return;
-
- // We must not attempt to append if qw is null.
- if(qw == null) {
- errorHandler.error(
- "No host is set for DatagramStringAppender named \""
- + this.name + "\".");
- return;
- }
-
- String buffer = layout.format(event);
- qw.write(buffer);
-
- if(event.throwable != null)
- event.throwable.printStackTrace(stp);
- else if (event.throwableInformation != null) {
- // we must be the receiver of a serialized/deserialized LoggingEvent;
- // the event's throwable member is transient, ie becomes null when
- // deserialized, but that's ok because throwableInformation should
- // have the string equivalent of the same info (ie stack trace)
- qw.write(event.throwableInformation);
- }
- }
-
- /**
- Activate the options set via the setOption method.
-
- @see #setOption
- */
- public
- void activateOptions() {
- this.setDestination(this.host, this.port, this.encoding);
- }
-
- /**
- Returns the option names for this component, namely the string
- array consisting of {{@link #DATAGRAM_HOST_OPTION}, {@link
- #DATAGRAM_PORT_OPTION}, {@link #DATAGRAM_ENCODING_OPTION} */
- public
- String[] getOptionStrings() {
- return OptionConverter.concatanateArrays(super.getOptionStrings(),
- new String[] {
- DATAGRAM_HOST_OPTION,
- DATAGRAM_PORT_OPTION,
- DATAGRAM_ENCODING_OPTION});
- }
-
- /**
- The DatagramStringAppender requires a layout. Hence, this method return
- <code>true</code>.
-
- @since 0.8.4 */
- public
- boolean requiresLayout() {
- return true;
- }
-
- /**
- Set DatagramStringAppender specific parameters.
- <p>
- The recognized options are <b>DatagramHost</b>, <b>DatagramPort</b> and
- <b>DatagramEncoding</b>, i.e. the values of the string constants
- {@link #DATAGRAM_HOST_OPTION}, {@link #DATAGRAM_PORT_OPTION} and
- {@link #DATAGRAM_ENCODING_OPTION} respectively.
- <p>
- <dl>
- <p>
- <dt><b>DatagramHost</b>
- <dd>
- The name (or ip address) of the host machine where log output should go.
- If the DatagramHost is not set, then this appender will default to
- {@link #DEFAULT_HOST}.
- <p>
- <dt><b>DatagramPort</b>
- <dd>
- The UDP port number where log output should go. See {@link #DEFAULT_PORT}
- <p>
- <dt><b>DatagramEncoding</b>
- <dd>
- The ISO character encoding to be used when converting the Unicode
- message to a sequence of bytes within a UDP packet. If not defined, then
- the encoding defaults to the default platform encoding.
- </dl>
- */
- public
- void setOption(String option, String value) {
- if(value == null) return;
-
- super.setOption(option, value);
-
- if(option.equals(DATAGRAM_HOST_OPTION))
- {
- this.host = value;
- }
- else if(option.equals(DATAGRAM_PORT_OPTION))
- {
- this.port = OptionConverter.toInt(value, DEFAULT_PORT);
- }
- else if(option.equals(DATAGRAM_ENCODING_OPTION))
- {
- this.encoding = value;
- }
- }
-
- public
- void setDestination(String host, int port, String encoding) {
- if (host==null) {
- LogLog.error("setDestination: host is null");
- host = DEFAULT_HOST;
- }
-
- this.host = host;
- this.port = port;
- this.encoding = encoding;
-
- this.qw = new QuietWriter(
- new DatagramStringWriter(host, port, encoding),
- errorHandler);
- this.stp = new SingleLineTracerPrintWriter(qw);
- }
-
- public
- void setLayout(Layout layout) {
- this.layout = layout;
- }
-}
diff --git a/contribs/KitchingSimon/DatagramStringWriter.java b/contribs/KitchingSimon/DatagramStringWriter.java
deleted file mode 100644
index 9f7f6bc..0000000
--- a/contribs/KitchingSimon/DatagramStringWriter.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
- *
- * This software is published under the terms of the Apache Software License
- * version 1.1, a copy of which has been included with this distribution in
- * the LICENSE.APL file.
- */
-
-package org.apache.log4j.net;
-
-import java.io.Writer;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.DatagramPacket;
-import java.net.UnknownHostException;
-import java.net.SocketException;
-import java.io.IOException;
-
-import org.apache.log4j.helpers.LogLog;
-
-/**
- * DatagramStringWriter is a wrapper around the java.net.DatagramSocket class
- * so that it behaves like a java.io.Writer.
- */
-public class DatagramStringWriter extends Writer {
-
- static final int SYSLOG_PORT = 514;
-
- private int port;
- private String host;
- private String encoding;
- private String prefix;
-
- private InetAddress address;
- private DatagramSocket ds;
-
- /**
- * This constructor assumes that it is sending to a remote syslog daemon
- * on the normal syslog port (514), and uses the default platform character
- * encoding when converting the message string to a byte sequence.
- */
- public
- DatagramStringWriter(String host) {
- this(host, SYSLOG_PORT, null, null);
- }
-
- /**
- * This constructor sends messages to the specified host and port, and
- * uses the default platform character encoding when converting the message
- * string to a byte sequence.
- */
- public
- DatagramStringWriter(String host, int port) {
- this(host, port, null, null);
- }
-
- /**
- * This constructor sends messages to the specified host and port, and
- * uses the specified character encoding when converting the message
- * string to a byte sequence.
- */
- public
- DatagramStringWriter(String host, int port, String encoding) {
- this(host, port, null, null);
- }
- /**
- * This constructor sends messages to the specified host and port, and
- * uses the specified character encoding when converting the message
- * string to a byte sequence; the specified prefix (which may be null)
- * is prepended to each message.
- */
- public
- DatagramStringWriter(String host, int port, String encoding, String prefix) {
- this.host = host;
- this.port = port;
- this.encoding = encoding;
- this.prefix = prefix;
-
- try {
- this.address = InetAddress.getByName(host);
- }
- catch (UnknownHostException e) {
- LogLog.error("Could not find " + host +
- ". All logging will FAIL.", e);
- }
-
- try {
- this.ds = new DatagramSocket();
- }
- catch (SocketException e) {
- e.printStackTrace();
- LogLog.error("Could not instantiate DatagramSocket to " + host +
- ". All logging will FAIL.", e);
- }
- }
-
-
- public
- void write(char[] buf, int off, int len) throws IOException {
- this.write(new String(buf, off, len));
- }
-
- public
- void write(String string) throws IOException {
- if (prefix != null) {
- string = prefix + string;
- }
-
- byte[] rawData;
- if (this.encoding == null)
- {
- // convert to byte sequence using platform's default encoding
- rawData = string.getBytes();
- }
- else
- {
- // convert to specified encoding - which may be sequence of
- // 8-bit chars, or multi-byte encodings like UTF-8 or UTF-16.
- // The receiving end had better be expecting whatever encoding
- // is used here on the sending end!
- rawData = string.getBytes(encoding);
- }
-
- DatagramPacket packet =
- new DatagramPacket(
- rawData,
- rawData.length,
- address,
- port);
-
- if(this.ds != null)
- {
- ds.send(packet);
- }
- else
- {
- LogLog.error(
- "write: failed to create DatagramPacket");
- }
- }
-
- public
- void flush() {}
-
- public
- void close() {}
-
- /**
- * Set a string to be prefixed to every message sent by this Writer.
- * For example, this method could be used to prepend a syslog
- * facility/priority code on the front of each message.
- * <p>
- * Note that this method is not synchronised, so should not be called in
- * a situation where other threads may be logging messages at the same
- * moment.
- * <p>
- * @param prefix may be a prefix string, or null which indicates no
- * prefix should be added.
- */
- public
- void setPrefix(String prefix){
- this.prefix = prefix;
- }
-}
diff --git a/contribs/KitchingSimon/SingleLineTracerPrintWriter.java b/contribs/KitchingSimon/SingleLineTracerPrintWriter.java
deleted file mode 100644
index c47e0b9..0000000
--- a/contribs/KitchingSimon/SingleLineTracerPrintWriter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
- *
- * This software is published under the terms of the Apache Software
- * License version 1.1, a copy of which has been included with this
- * distribution in the LICENSE.APL file. */
-
-package org.apache.log4j.helpers;
-
-/**
- SingleLineTracerPrintWriter overrides the println function in
- TracerPrintWriter by replacing the TAB character with spaces.
- It also does not print the "\n".
- <p>
- The default format generated by TracerPrintWriter for exceptions
- prints on multiple lines, which does not interact well with some
- logging systems. On the other hand, a stack-trace on one line can be a
- mite difficult to read, so this class should only be used where really
- necessary :-)
- <p>
- For syslog daemons, tabs in messages are not friendly, hence the
- replacement of tabs by spaces here. It shouldn't do any harm to
- do this for all messages...
- <p>
- Perhaps it might be better to enhance TracerPrintWriter to have
- a configuration item for one-line or multi-line mode...
-*/
-public class SingleLineTracerPrintWriter extends TracerPrintWriter {
-
- static String TAB = " ";
-
- public SingleLineTracerPrintWriter(QuietWriter qWriter) {
- super(qWriter);
- }
-
- /**
- Make the first Exception line print properly by omitting the \n at the
- end.
- */
- public
- void println(Object o) {
- this.qWriter.write(o.toString());
- }
-
- // Note: the Char[] form is handled by the TracerPrinterWriter super
- // class
-
- /**
- Remove the first character from the string (usually a TAB) and do
- not print "\n"
- */
- public
- void println(String s) {
- // remove '^I' and replace it with 4 spaces
- this.qWriter.write(TAB+s.substring(1));
- }
-}
diff --git a/contribs/KitchingSimon/logconfig.xml b/contribs/KitchingSimon/logconfig.xml
deleted file mode 100644
index bc53733..0000000
--- a/contribs/KitchingSimon/logconfig.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<configuration configDebug="true">
-
- <appender name="STDOUT" class="org.apache.log4j.FileAppender">
- <param name="File" value="System.out" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern"
- value="aa:%p#%d#%c#%m%n"/>
- </layout>
- </appender>
-
- <appender name="UDPVENUS" class="org.apache.log4j.net.DatagramStringAppender">
- <param name="DatagramHost" value="Venus" />
- <param name="DatagramPort" value="8300" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern"
- value="%p#%d#%c#%m"/>
- </layout>
- <filter class="org.apache.log4j.filters.PriorityRangeFilter">
- <param name="PriorityMin" value="WARN" />
- </filter>
- </appender>
-
- <category name="org.apache.log4j.xml">
- <priority value="INFO" />
- </category>
-
- <category name="ch">
- <priority value ="DEBUG2" class="ch.orange.log.Priority"/>
- </category>
-
- <category name="script">
- <priority value ="DEBUG2" class="ch.orange.log.Priority"/>
- </category>
-
- <root>
- <priority value ="DEBUG2" class="ch.orange.log.Priority"/>
- <appender-ref ref="STDOUT" />
- <appender-ref ref="UDPVENUS" />
- </root>
-
-</configuration>
diff --git a/contribs/KitchingSimon/mail-2001-02-07 b/contribs/KitchingSimon/mail-2001-02-07
deleted file mode 100644
index 063e3ff..0000000
--- a/contribs/KitchingSimon/mail-2001-02-07
+++ /dev/null
@@ -1,88 +0,0 @@
-Delivered-To: urba-cgu@urbanet.ch
-Mailing-List: contact log4j-dev-help@jakarta.apache.org; run by ezmlm
-List-Post: <ma...@jakarta.apache.org>
-List-Help: <ma...@jakarta.apache.org>
-List-Unsubscribe: <ma...@jakarta.apache.org>
-List-Subscribe: <ma...@jakarta.apache.org>
-Reply-To: "LOG4J Developers Mailing List" <lo...@jakarta.apache.org>
-Delivered-To: mailing list log4j-dev@jakarta.apache.org
-From: Kitching Simon <Si...@orange.ch>
-To: "'log4j-dev@jakarta.apache.org'" <lo...@jakarta.apache.org>
-Subject: PATCH: New classes: DatagramStreamAppender & friends
-Date: Wed, 7 Feb 2001 12:41:54 +0100
-X-Mailer: Internet Mail Service (5.5.2650.21)
-X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
-
-
-Hi log4j developers....
-
-
-Here, for your consideration, is a set of files that
-implement an Appender which sends messages
-to a remote host/port via UDP (datagram).
-
-
-There was brief discussion of this Appender on the
-log4j-user group, about a week ago. Ceki suggested
-that the Appender send serialized log event objects
-over UDP; while this approach has a number of
-advantages, I have decided to instead perform the
-message formatting at the client end, mainly so
-that:
-(a) the UDP server application does not have to be in java
-(b) non-java clients can send messages to the same UDP
- server.
-
-
-The appender has been named "DatagramStringAppender"
-to allow someone to write a serialization-based version at
-some later time, if desired, without any name confusion.
-------------------------------
-Notes:
-
-
-DatagramStringAppender is based on SyslogAppender, but
-with a fair number of changes.
-
-
-DatagramStringWriter is based on SyslogWriter, with a few changes.
-In particular, it takes an "encoding" parameter, so that the character
-encoding used can be specified, and a "port".
-
-
-SingleLineTracerPrintWriter is almost identical to
-SyslogTracerPrintWriter; just the name & some comments
-have changed. [I didn't want to call a class called SyslogXXX
-from the DatagramStreamAppender classes]
-------------------------------
-
-
-If this patch is accepted, then it may be worth rewriting SyslogAppender
-to use the DatagramStringWriter and SingleLineTracerPrintWriter
-classes. These classes should be compatible with SyslogAppender,
-as they implement the same functionality, or a superset of the
-Syslog functionality, and have more "general" names.
-------------------------------
- <<DatagramStringAppender.java>>
-
-
-
- <<DatagramStringWriter.java>>
-
-
- <<SingleLineTracerPrintWriter.java>>
-
-
---------------------------------
-And here's a simple perl UDP server, and an xml
-config file for testing the appender.
- <<logconfig.xml>>
-
-
- <<udpserver.pl>>
-
-
-Regards,
-
-
-Simon
diff --git a/contribs/KitchingSimon/udpserver.pl b/contribs/KitchingSimon/udpserver.pl
deleted file mode 100644
index 2f5f900..0000000
--- a/contribs/KitchingSimon/udpserver.pl
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/opt/perl5/bin/perl -w
-use strict;
-use Socket;
-use IO::Socket;
-use Sys::Hostname;
-
-main();
-exit(0);
-
-sub main()
-{
- my $MAX_MSG_SIZE = 16384; # 16KBytes should be enough...
-
- my $svrport = 8300;
- my $svriaddr = gethostbyname(hostname());
- my $svrproto = getprotobyname('udp');
- my $svrpaddr = sockaddr_in($svrport, $svriaddr);
-
- socket(SOCKET, PF_INET, SOCK_DGRAM, $svrproto) || die "socket: $!";
- bind(SOCKET, $svrpaddr) || die "bind: $!";
-
- my $rin = '';
- vec($rin, fileno(SOCKET), 1) = 1;
-
- # timeout after 10.0 seconds
- # at some time, I'm going to add signal handlers so that signals can be
- # sent to cause logfile rollover, or tidy exit...then the timeout will
- # come in useful..
-
- my $exit = 0;
- while (!$exit)
- {
- my $rout = $rin;
-
- # select(readvec, writevec, exceptionvec, timeout)
- # : returns # of selected filehandles, modifies
- # vector parameters so that set bits indicate
- # filehandles which are readable, writable or have
- # an exception state
-
- my $nSelected = select($rout, undef, undef, 10.0);
- if ($nSelected == 0)
- {
- # timedout : go back to start of loop
- next;
- }
-
- my $msgData = '';
- my $clientpaddr = recv(SOCKET, $msgData, $MAX_MSG_SIZE, 0);
- if (!$clientpaddr)
- {
- die "recv: $!";
- }
-
- my ($clientport, $clientiaddr) = sockaddr_in($clientpaddr);
- my $clienthost = gethostbyaddr($clientiaddr, AF_INET);
- if (!$clienthost)
- {
- # unable to determine name for client : show raw ip address
- $clienthost = inet_ntoa($clientiaddr);
- }
-
- print "$clienthost:$msgData\n";
- }
-}
-
-
diff --git a/contribs/LeosLiterak/TempFileAppender.java b/contribs/LeosLiterak/TempFileAppender.java
deleted file mode 100644
index 74fe216..0000000
--- a/contribs/LeosLiterak/TempFileAppender.java
+++ /dev/null
@@ -1,178 +0,0 @@
- package org.apache.log4j;
-
-import java.io.File;
-import java.io.Writer;
-import java.io.FileWriter;
-import java.io.BufferedWriter;
-import org.apache.log4j.spi.LoggingEvent;
-import org.apache.log4j.helpers.OptionConverter;
-import org.apache.log4j.spi.ErrorHandler;
-
-/**
- TempFileAppender creates new unique file for each logging statement.
-
- @author <a HREF="mailto:leos.literak@12snap.com">Leos Literak</a>
- @author Ceki Gülcü
-
-*/
-public class TempFileAppender extends AppenderSkeleton {
-
- /**
- A string constant used in naming the option for setting the
- directory where the log files will be created. Current value
- of this string constant is <b>Path</b>. java.io.tmpdir directory
- will be used, if ommited.
- */
- static final public String PATH_OPTION = "Path";
-
- /**
- The default path is actual directory.
- */
- protected String path = null;
-
- /**
- A string constant used in naming the option for setting the
- prefix of the log files. It has to have at least 3 characters!
- Current value of this string constant is <b>Prefix</b>.
- */
- static final public String PREFIX_OPTION = "Prefix";
-
- /**
- The default path is actual directory.
- */
- protected String prefix = "l4j_";
-
- /**
- A string constant used in naming the option for setting the
- suffix of the log files. Current value of this string constant
- is <b>Suffix</b>.
- */
- static final public String SUFFIX_OPTION = "Suffix";
-
- /**
- The default path is actual directory.
- */
- protected String suffix = ".tmp";
-
- /**
- Default dir
- */
-
- protected File dir = null;
-
-
-
-
- /**
- The default constructor simply calls its parent's constructor.
- */
- public TempFileAppender() {
- super();
- }
-
- /**
- Retuns the option names for this component
- */
- public String[] getOptionStrings() {
- return OptionConverter.concatanateArrays(super.getOptionStrings(),
- new String[] {PATH_OPTION,PREFIX_OPTION,SUFFIX_OPTION});
- }
-
- /**
- Set TempFileAppender specific options.
-
- The recognized options are <b>Path</b>, <b>Prefix</b> and <b>Suffix</b>,
- i.e. the values of the string constants {@link #PATH_OPTION},
- {@link #PREFIX_OPTION} and respectively {@link #SUFFIX_OPTION}.
- The options of the super class {@link AppenderSkeleton} are also
- recognized.
- */
-
- public void setOption(String key, String value) {
- super.setOption(key, value);
- if(key.equalsIgnoreCase(PATH_OPTION)) {
- path = value;
- if(path==null) {
- errorHandler.error("Path cannot be empty!",null,0);
- }
-
- dir = new File(path);
- if(!(dir.exists() && dir.isDirectory() && dir.canWrite())) {
- errorHandler.error("Cannot write to directory " + path + "!",null,0);
- }
- }
- else if(key.equalsIgnoreCase(PREFIX_OPTION)) {
- if(value!=null && value.length()>=3) {
- prefix = value;
- } else {
- errorHandler.error("Prefix cannot be shorter than 3 characters!",
- null,0);
- }
- }
- else if(key.equalsIgnoreCase(SUFFIX_OPTION)) {
- if(value!=null && value.length()>=1) {
- suffix = value;
- } else {
- errorHandler.error("Suffix cannot be empty!",null,0);
- }
- }
- }
-
- /**
- This method is called by {@link AppenderSkeleton#doAppend}
- method.
-
- <p>Whenever this method is called, new unique file is created
- with specified prefix and suffix. The file is closed afterwards.
-
- <p>The format of the output will depend on this appender's
- layout.
-
- */
- public void append(LoggingEvent event) {
- if(!checkEntryConditions()) {
- return;
- }
- subAppend(event);
- }
-
- /**
- This method determines if there is a sense in attempting to append.
- */
- protected boolean checkEntryConditions() {
- return true;
- }
-
- /**
- This method does actual writing
- */
- protected void subAppend(LoggingEvent event) {
- try {
- File tmp = File.createTempFile(prefix,suffix,dir);
- Writer out = new BufferedWriter(new FileWriter(tmp));
- out.write(event.message);
- out.close();
- /* this Appender is not supposed to be used for logging of Exceptions */
- } catch (Exception e) {
- errorHandler.error("Error during creation of temporary File!",e,1);
- }
- }
-
- public boolean requiresLayout() {
- return false;
- }
-
- public void close() {
- /* nothing to do */
- }
-}
-/*
- * @author $Author$
- * @version $Revision$
- * @since $Date$
- *
- * $Log$
- * Revision 1.1 2001/04/20 17:38:31 ceki
- * Added LeosLiterak's TempFileAppender.java
- *
-*/
diff --git a/contribs/LeosLiterak/mail b/contribs/LeosLiterak/mail
deleted file mode 100644
index 072e7d9..0000000
--- a/contribs/LeosLiterak/mail
+++ /dev/null
@@ -1,41 +0,0 @@
-To: ceki@apache.org
-Subject: TempFileAppender
-
-
-Hi Ceki,
-
-
-I have created one small Appender, which puts each
-logging statement into separate file. We use it
-for storing incomming messages into second process'es
-spool directory. If you like it, please include it
-into Log4j with APL license.
-
-
-Usage:
-
-
-log4j.appender.A1=org.apache.log4j.TempFileAppender
-log4j.appender.A1.Path=spool_dir
-log4j.appender.A1.Prefix=out_
-log4j.appender.A1.Suffix=.msg
-
-
- Leo
-
------------------------------------------------------
-Leos Literak
-Software Engineer
-
-
-12snap s.r.o.
-Pstrossova 24
-110 00 Praha 1
-Czech Republic
-
-
-mobile: ?605-849-087
-phone: ?2-21-970-239
-fax: ?2-21-970-241
-e-mail: leos.literak@12snap.com
-
diff --git a/contribs/MarkDouglas/Log.txt b/contribs/MarkDouglas/Log.txt
deleted file mode 100644
index f773f53..0000000
--- a/contribs/MarkDouglas/Log.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-INFO ( Server:main ) systemsunion.LoggingServer.SocketServer2 - Connected to client at RDDSOWE2/129.153.78.195
-INFO ( Server:main ) systemsunion.LoggingServer.SocketServer2 - Starting new socket node.
-INFO ( Server:main ) systemsunion.LoggingServer.SocketServer2 - Waiting to accept a new client.
-INFO ( RDDSOWE2:main ) systemsunion.SSTS.system - ClosedownController: starting
-INFO ( Server:main ) systemsunion.LoggingServer.SocketServer2 - Connected to client at RDDSOWE2/129.153.78.195
-INFO ( Server:main ) systemsunion.LoggingServer.SocketServer2 - Starting new socket node.
-INFO ( Server:main ) systemsunion.LoggingServer.SocketServer2 - Waiting to accept a new client.
-INFO ( RDDSOWE2:main ) systemsunion.SSTS.system - ClosedownController: starting
-INFO ( RDDSOWE2:AWT-EventQueue-0) systemsunion.SSTS.components - Packing component Operator
-INFO ( RDDSOWE2:AWT-EventQueue-0) systemsunion.SSTS.components - Packing class file d:/SSDev/SSTS/components\Operator\Operator.class for component Operator
-INFO ( RDDSOWE2:AWT-EventQueue-0) systemsunion.SSTS.components - Packing class file d:/SSDev/SSTS/components\Operator\Operator.class for component Operator
-INFO ( RDDSOWE2:AWT-EventQueue-0) systemsunion.SSTS.components - Packing proxy class file d:/SSDev/SSTS/components\Operator\OperatorProxy.class for component Operator
-INFO ( RDDSOWE2:AWT-EventQueue-0) systemsunion.SSTS.components - Packing class file d:/SSDev/SSTS/components\Operator\OperatorProxy.class for component Operator
-INFO ( RDDSOWE2:AWT-EventQueue-0) systemsunion.SSTS.components - Packing test XML page file d:/SSDev/SSTS/components\Operator\Operator.XML for component Operator
-INFO ( RDDSOWE2:AWT-EventQueue-0) systemsunion.SSTS.components - Packing class file d:/SSDev/SSTS/components\Operator\Operator.XML for component Operator
-INFO ( RDDSOWE2:AWT-EventQueue-0) systemsunion.SSTS.components - Packing descriptor file d:/SSDev/SSTS/components\Operator\OperatorDeploymentDescriptor.XML for component Operator
-INFO ( RDDSOWE2:AWT-EventQueue-0) systemsunion.SSTS.components - Packing class file d:/SSDev/SSTS/components\Operator\OperatorDeploymentDescriptor.XML for component Operator
diff --git a/contribs/MarkDouglas/SocketNode2.java b/contribs/MarkDouglas/SocketNode2.java
deleted file mode 100644
index a868c92..0000000
--- a/contribs/MarkDouglas/SocketNode2.java
+++ /dev/null
@@ -1,102 +0,0 @@
-
-package com.systemsunion.LoggingServer;
-
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.ServerSocket;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-
-
-import org.apache.log4j.Category;
-import org.apache.log4j.spi.LoggingEvent;
-import org.apache.log4j.Priority;
-import org.apache.log4j.NDC;
-
-// Contributors: Moses Hohman <mm...@rainbow.uchicago.edu>
-
-/**
- Read {@link LoggingEvent} objects sent from a remote client using
- Sockets (TCP). These logging events are logged according to local
- policy, as if they were generated locally.
-
- <p>For example, the socket node might decide to log events to a
- local file and also resent them to a second socket node.
-
- @author Ceki Gülcü
-
- @since 0.8.4
-*/
-public class SocketNode2 implements Runnable {
-
- Socket socket;
- ObjectInputStream ois;
-
- static Category cat = Category.getInstance(SocketNode2.class.getName());
-
- public
- SocketNode2(Socket socket) {
- this.socket = socket;
- try {
- ois = new ObjectInputStream(socket.getInputStream());
- }
- catch(Exception e) {
- cat.error("Could not open ObjectInputStream to "+socket, e);
- }
- }
-
- //public
- //void finalize() {
- //System.err.println("-------------------------Finalize called");
- // System.err.flush();
- //}
-
- public void run() {
- LoggingEvent event;
- Category remoteCategory;
- String strClientName;
-
- // Get the client name.
- InetAddress addr = socket.getInetAddress();
- strClientName = addr.getHostName();
- if(strClientName == null || strClientName.length() == 0)
- {
- strClientName = addr.getHostAddress();
- }
-
- try {
- while(true) {
- event = (LoggingEvent) ois.readObject();
-
- if(event.ndc != null)
- {
- event.ndc = strClientName + ":" + event.ndc;
- }
- else
- {
- event.ndc = strClientName;
- }
-
- remoteCategory = Category.getInstance(event.categoryName);
- remoteCategory.callAppenders(event);
- }
- }
- catch(java.io.EOFException e) {
- cat.info("Caught java.io.EOFException will close conneciton.", e);
- }
- catch(java.net.SocketException e) {
- cat.info("Caught java.net.SocketException, will close conneciton.", e);
- }
- catch(Exception e) {
- cat.error("Unexpected exception. Closing conneciton.", e);
- }
-
- try {
- ois.close();
- }
- catch(Exception e) {
- cat.info("Could not close connection.", e);
- }
- }
-}
diff --git a/contribs/MarkDouglas/SocketServer2.java b/contribs/MarkDouglas/SocketServer2.java
deleted file mode 100644
index 97a5414..0000000
--- a/contribs/MarkDouglas/SocketServer2.java
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-package com.systemsunion.LoggingServer;
-
-import java.net.Socket;
-import java.net.ServerSocket;
-import java.io.IOException;
-
-import org.apache.log4j.Category;
-import org.apache.log4j.PropertyConfigurator;
-import org.apache.log4j.NDC;
-
-/**
- A simple {@link SocketNode} based server.
-
- <pre>
- <b>Usage:</b> java org.apache.log4j.net.SocketServer port configFile
-
- where <em>port</em> is a part number where the server listens and
- <em>configFile</em> is a configuration file fed to the {@link
- PropertyConfigurator}.
- </pre>
-
-
-
-
-
- @author Ceki Gülcü
-
- @since 0.8.4 */
-
-public class SocketServer2 {
-
- static Category cat = Category.getInstance(SocketServer2.class.getName());
-
- static int port;
-
- public
- static
- void main(String argv[]) {
- if(argv.length == 2)
- init(argv[0], argv[1]);
- else
- usage("Wrong number of arguments.");
-
- try {
- cat.info("Listening on port " + port);
- ServerSocket serverSocket = new ServerSocket(port);
- while(true) {
- cat.info("Waiting to accept a new client.");
- Socket socket = serverSocket.accept();
- cat.info("Connected to client at " + socket.getInetAddress());
- cat.info("Starting new socket node.");
- new Thread(new SocketNode2(socket)).start();
- }
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- }
-
-
- static
- void usage(String msg) {
- System.err.println(msg);
- System.err.println(
- "Usage: java " + SocketServer2.class.getName() + " port configFile");
- System.exit(1);
- }
-
- static
- void init(String portStr, String configFile) {
- try {
- port = Integer.parseInt(portStr);
- }
- catch(java.lang.NumberFormatException e) {
- e.printStackTrace();
- usage("Could not interpret port number ["+ portStr +"].");
- }
- PropertyConfigurator.configure(configFile);
- NDC.push("Server");
- }
-}
diff --git a/contribs/MarkDouglas/mail-2001-01-17 b/contribs/MarkDouglas/mail-2001-01-17
deleted file mode 100644
index 163dffc..0000000
--- a/contribs/MarkDouglas/mail-2001-01-17
+++ /dev/null
@@ -1,50 +0,0 @@
-Delivered-To: urba-cgu@urbanet.ch
-From: Mark Douglas <Ma...@systemsunion.com>
-To: "'cgu@urbanet.ch'" <cg...@urbanet.ch>
-Subject: Enhanced SocketServer and SocketNode classes
-Date: Wed, 17 Jan 2001 09:57:38 -0000
-X-Mailer: Internet Mail Service (5.5.2650.21)
-
-
-Hi Ceki,
-
-
-I have made small changes to SocketServer and SockerNode to allow the client
-machine name to be displayed in the logging output. This is important for
-us as we are using a single logging server with several clients.
-
-
-The new SocketServer2 and SocketNode2 classes (couldn't think of better
-names) prepends the NDC string with the clients Host Name (or IP address if
-the HostName can not be found). I thought the NDC string was a good place
-to add this information, but you may have a better place?
-
-
-I have created an NDC entry for the server such that server logging messages
-can easily be identified.
-
-
-I have included the two new source files plus a short example of the output.
-
-
-The output was generated with the following layout: %-6p (%9x:%-10t)
-%-40c{3} - %m%n
-
-
- <<Log.txt>> <<SocketNode2.java>> <<SocketServer2.java>>
-
-
-Note: I have changed the package names for the two classes to fit with our
-package names - sorry. Also, I find it difficult to follow the coding
-style, so again, sorry.
-
-
-If you think this may be useful to others, please feel free to include it as
-an addition in the next release or change the current SocketServer and
-SocketNode objects to include this new behaviour by default.
-
-
-Mark Douglas
-Systems Union Group plc
-
-
diff --git a/contribs/SvenReimers/gui/JListView.java b/contribs/SvenReimers/gui/JListView.java
deleted file mode 100644
index 42ce7ff..0000000
--- a/contribs/SvenReimers/gui/JListView.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
- *
- * This software is published under the terms of the Apache Software
- * License version 1.1, a copy of which has been included with this
- * distribution in the LICENSE.APL file. */
-
-
-package org.apache.log4j.gui;
-
-import org.apache.log4j.helpers.CyclicBuffer;
-import org.apache.log4j.helpers.LogLog;
-import org.apache.log4j.Priority;
-import org.apache.log4j.Category;
-import org.apache.log4j.Layout;
-import org.apache.log4j.PatternLayout;
-import org.apache.log4j.spi.LoggingEvent;
-
-import javax.swing.JList;
-import javax.swing.AbstractListModel;
-import javax.swing.JFrame;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JTextArea;
-import javax.swing.JScrollPane;
-import javax.swing.ListCellRenderer;
-import java.awt.Component;
-import java.awt.FlowLayout;
-import java.awt.GridLayout;
-import javax.swing.BoxLayout;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
-import java.awt.Container;
-import javax.swing.ImageIcon;
-import java.awt.Image;
-import java.awt.Toolkit;
-import java.net.URL;
-import java.awt.Rectangle;
-
-public class JListView extends JList {
-
-
- static Category cat = Category.getInstance(JListView.class.getName());
-
-
- //JListViewModel model;
- PatternLayout layout;
-
- static LoggingEvent proto = new LoggingEvent("x", cat, Priority.ERROR,
- "Message ", new Throwable());
-
- public
- JListView(JListViewModel model) {
- super(model);
- layout = new PatternLayout("%r %p %c [%t] - %m");
- //this.setModel(model);
- this.setCellRenderer(new MyCellRenderer());
- // setFixedCellWidth(10);
- //setFixedCellHeight(20);
-
- }
-
- public
- void add(LoggingEvent event) {
- ((JListViewModel)getModel()).add(event);
- }
-
- /*
- public
- Dimension getPreferredSize() {
- System.out.println("getPreferredSize() called");
- return super.getPreferredSize();
- }
-
-
- public
- int getScrollableUnitIncrement(Rectangle visibleRect, int orientation,
- int direction) {
- System.out.println("getScrollableUnitIncrement called with " + visibleRect +
- "orientation: "+orientation+", direction: "+direction);
- return super.getScrollableUnitIncrement(visibleRect, orientation,
- direction);
- }
-
- public
- int getScrollableBlockIncrement(Rectangle visibleRect, int orientation,
- int direction) {
- System.out.println("getScrollableBlockIncrement called with " +
- visibleRect + "orientation: "+orientation+
- ", direction: "+direction);
- return super.getScrollableBlockIncrement(visibleRect, orientation,
- direction);
- }
- */
-
- //public
- //boolean getScrollableTracksViewportWidth() {
- //System.out.println("getScrollableTracksViewportWidth called.");
- //return true;
- //boolean b = super.getScrollableTracksViewportWidth();
- //System.out.println("result is: "+b);
- //return b;
- //}
-
- //public
- //boolean getScrollableTracksViewportHeight() {
- // System.out.println("getScrollableTracksViewportHeight called.");
- // return true;
- //boolean b = super.getScrollableTracksViewportHeight();
- //System.out.println("result is: "+b);
- //return b;
- //}
-
- //public
- //int getFirstVisibleIndex() {
- //int r = getFirstVisibleIndex();
- // System.out.println("----------getFirstVisibleIndex called, result: "+r);
- //return r;
- //}
-
- //public
- //Object getPrototypeCellValue() {
- //return proto;
- //}
-
-
-
- static public void main(String[] args) {
-
- JFrame frame = new JFrame("JListView test");
- Container container = frame.getContentPane();
-
- JListView view = new JListView(new JListViewModel(Integer.parseInt(args[0])));
-
-
- JScrollPane sp = new JScrollPane(view);
- sp.setPreferredSize(new Dimension(250, 80));
-
- container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS));
- //container.add(view);
- container.add(sp);
-
- JButton b1 = new JButton("Add 1");
- JButton b10 = new JButton("Add 10");
- JButton b100 = new JButton("Add 100");
- JButton b1000 = new JButton("Add 1000");
- JButton b10000 = new JButton("Add 10000");
-
- JPanel panel = new JPanel(new GridLayout(0,1));
- container.add(panel);
-
- panel.add(b1);
- panel.add(b10);
- panel.add(b100);
- panel.add(b1000);
- panel.add(b10000);
-
-
- AddAction a1 = new AddAction(view, 1);
- AddAction a10 = new AddAction(view, 10);
- AddAction a100 = new AddAction(view, 100);
- AddAction a1000 = new AddAction(view, 1000);
- AddAction a10000 = new AddAction(view, 10000);
-
- b1.addActionListener(a1);
- b10.addActionListener(a10);
- b100.addActionListener(a100);
- b1000.addActionListener(a1000);
- b10000.addActionListener(a10000);
-
- frame.setVisible(true);
- frame.setSize(new Dimension(700,700));
-
- long before = System.currentTimeMillis();
-
- int RUN = 1000;
- int i = 0;
- while(i++ < RUN) {
- LoggingEvent event0 = new LoggingEvent("x", cat, Priority.ERROR,
- "Message "+i, null);
-
- Throwable t = new Exception("hello "+i);
- LoggingEvent event1 = new LoggingEvent("x", cat, Priority.ERROR,
- "Message "+i, t);
-
-
- if(i % 10 == 0) {
- event1.getThreadName();
- view.add(event1);
- } else {
- event0.getThreadName();
- view.add(event0);
- }
- }
-
- long after = System.currentTimeMillis();
- System.out.println("Time taken :"+ ((after-before)*1000/RUN));
-
- }
-
- class MyCellRenderer extends JTextArea implements ListCellRenderer {
-
- Object o = new Object();
- int i = 0;
- final ImageIcon longIcon = new ImageIcon("RedFlag.gif");
-
- public
- MyCellRenderer() {
- System.out.println("----------------------");
-
- }
-
-
-
- public
- int getTabSize() {
- return 2;
- }
-
- public Image loadIcon ( String path ) {
- Image img = null;
- try {
- URL url = ClassLoader.getSystemResource(path);
- img = (Image) (Toolkit.getDefaultToolkit()).getImage(url);
- } catch (Exception e) {
- System.out.println("Exception occured: " + e.getMessage() +
- " - " + e );
- }
- return (img);
- }
-
- public Component getListCellRendererComponent(JList list,
- Object value,
- int index, // cell index
- boolean isSelected,
- boolean cellHasFocus) {
-
- // System.out.println(o + " ============== " + i++);
- //LogLog.error("=======", new Exception());
- //setIcon(longIcon);
- if(value instanceof LoggingEvent) {
- LoggingEvent event = (LoggingEvent) value;
- String str = layout.format(event);
- String t = event.getThrowableInformation();
-
- if(t != null) {
- setText(str + Layout.LINE_SEP + t);
- } else {
- setText(str);
- }
-
- } else {
- setText(value.toString());
- }
-
-
- return this;
- }
- }
-}
-
-
-
-class JListViewModel extends AbstractListModel {
-
- CyclicBuffer cb;
-
- JListViewModel(int size) {
- cb = new CyclicBuffer(size);
- }
-
- public
- void add(LoggingEvent event) {
- //System.out.println("JListViewModel.add called");
- cb.add(event);
- int j = cb.length();
- fireContentsChanged(this, 0, j);
- }
-
-
-
- public
- Object getElementAt(int index) {
- return cb.get(index);
- }
-
- public
- int getSize() {
- return cb.length();
- }
-
-}
-
-class AddAction implements ActionListener {
-
- Thread t;
-
- static int counter = 0;
-
- public
- AddAction(JListView view, int burst) {
- this.t = new AddThread(view, burst);
- t.start();
- }
-
- public
- void actionPerformed(ActionEvent e) {
- System.out.println("Action occured");
- synchronized(t) {
- t.notify();
- }
- }
-
- class AddThread extends Thread {
- int burst;
- JListView view;
-
- Category cat = Category.getInstance("x");
-
- AddThread(JListView view, int burst) {
- super();
- this.burst = burst;
- this.view = view;
- setName("AddThread"+burst);
- }
-
- public
- void run() {
-
- while(true) {
- synchronized(this) {
- try {
- this.wait();
- } catch(Exception e) {
- }
- }
- for(int i = 0; i < burst; i++) {
- LoggingEvent event = new LoggingEvent("x", cat, Priority.DEBUG,
- "Message "+counter, null);
-
- event.getThreadName();
- if(counter % 50 == 0) {
- //event.throwable = new Exception("hello "+counter);
- }
- counter++;
- view.add(event);
- }
- }
- }
- }
-}
diff --git a/contribs/SvenReimers/gui/JTableAppender.java b/contribs/SvenReimers/gui/JTableAppender.java
deleted file mode 100644
index 3197a1d..0000000
--- a/contribs/SvenReimers/gui/JTableAppender.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
- *
- * This software is published under the terms of the Apache Software
- * License version 1.1, a copy of which has been included with this
- * distribution in the LICENSE.APL file. */
-
-
-package org.apache.log4j.gui;
-
-import org.apache.log4j.helpers.CyclicBuffer;
-import org.apache.log4j.helpers.LogLog;
-import org.apache.log4j.Priority;
-import org.apache.log4j.Category;
-import org.apache.log4j.Layout;
-import org.apache.log4j.PatternLayout;
-import org.apache.log4j.spi.LoggingEvent;
-
-import javax.swing.JList;
-import javax.swing.AbstractListModel;
-import javax.swing.JFrame;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JTable;
-import javax.swing.JTextArea;
-import javax.swing.table.AbstractTableModel;
-import javax.swing.table.TableCellRenderer;
-import javax.swing.JScrollPane;
-import javax.swing.ListCellRenderer;
-import java.awt.Component;
-import java.awt.FlowLayout;
-import javax.swing.BoxLayout;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
-import java.awt.Container;
-import javax.swing.ImageIcon;
-import java.awt.Image;
-import java.awt.Toolkit;
-import java.net.URL;
-import java.awt.Rectangle;
-
-public class JTableAppender extends JTable {
-
-
- static Category cat = Category.getInstance(JTableAppender.class.getName());
-
- PatternLayout layout;
-
- public
- JTableAppender() {
- layout = new PatternLayout("%r %p %c [%t] - %m");
- this.setDefaultRenderer(Object.class, new Renderer());
-
- }
-
- public
- void add(LoggingEvent event) {
- ((JTableAppenderModel)getModel()).add(event);
- }
-
- public
- Dimension getPreferredSize() {
- System.out.println("getPreferredSize() called");
- return super.getPreferredSize();
- }
-
- static public void main(String[] args) {
-
- JFrame frame = new JFrame("JListView test");
- Container container = frame.getContentPane();
-
- JTableAppender appender = new JTableAppender();
-
- JTableAppenderModel model = new
- JTableAppenderModel(Integer.parseInt(args[0]));
- appender.setModel(model);
- //appender.createDefaultColumnsFromModel();
-
-
- JScrollPane sp = new JScrollPane(appender);
- sp.setPreferredSize(new Dimension(250, 80));
-
- container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS));
- //container.add(view);
- container.add(sp);
-
- JButton button = new JButton("ADD");
- container.add(button);
-
-
- button.addActionListener(new JTableAddAction(appender));
-
- frame.setVisible(true);
- frame.setSize(new Dimension(700,700));
-
- long before = System.currentTimeMillis();
-
- int RUN = 10000;
- int i = 0;
- while(i++ < RUN) {
- LoggingEvent event = new LoggingEvent("x", cat, Priority.ERROR,
- "Message "+i, null);
- event.getThreadName();
- if(i % 10 == 0) {
- //event.throwable = new Exception("hello "+i);
- }
- appender.add(event);
- }
-
- long after = System.currentTimeMillis();
- System.out.println("Time taken :"+ ((after-before)*1000/RUN));
-
- }
-
- class Renderer extends JTextArea implements TableCellRenderer {
-
- Object o = new Object();
- int i = 0;
-
- public
- Renderer() {
- System.out.println("Render() called ----------------------");
- }
-
- public Component getTableCellRendererComponent(JTable table,
- Object value,
- boolean isSelected,
- boolean hasFocus,
- int row,
- int column) {
-
- System.out.println(o + " ============== " + i++);
- //LogLog.error("=======", new Exception());
- //setIcon(longIcon);
- if(value instanceof LoggingEvent) {
- LoggingEvent event = (LoggingEvent) value;
- String str = layout.format(event);
- String t = event.getThrowableInformation();
-
- if(t != null) {
- System.out.println("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
- setText(str + Layout.LINE_SEP + t);
- } else {
- setText(str);
- }
-
- } else {
- setText(value.toString());
- }
-
-
- return this;
- }
- }
-}
-
-
-
-class JTableAppenderModel extends AbstractTableModel {
-
- CyclicBuffer cb;
-
- JTableAppenderModel(int size) {
- cb = new CyclicBuffer(size);
- }
-
- public
- void add(LoggingEvent event) {
- //System.out.println("JListViewModel.add called");
- cb.add(event);
- int j = cb.length();
-
- fireTableDataChanged();
-
- }
- public
- int getColumnCount() {
- return 1;
- }
-
- public int getRowCount() {
- return cb.length();
- }
-
- //public
- //Class getColumnClass(int index) {
- // System.out.println("getColumnClass called " + index);
- // return LoggingEvent.class;
- //}
-
- public
- Object getValueAt(int row, int col) {
- return cb.get(row);
- }
-}
-
-
-class JTableAddAction implements ActionListener {
-
- int j;
- JTableAppender appender;
-
- Category cat = Category.getInstance("x");
-
- public
- JTableAddAction(JTableAppender appender) {
- this.appender = appender;
- j = 0;
- }
-
- public
- void actionPerformed(ActionEvent e) {
- System.out.println("Action occured");
-
- LoggingEvent event = new LoggingEvent("x", cat, Priority.DEBUG,
- "Message "+j, null);
-
- if(j % 5 == 0) {
- //event.throwable = new Exception("hello "+j);
- }
- j++;
- appender.add(event);
- }
-}
diff --git a/contribs/SvenReimers/gui/TextPaneAppender.java b/contribs/SvenReimers/gui/TextPaneAppender.java
deleted file mode 100644
index 117c354..0000000
--- a/contribs/SvenReimers/gui/TextPaneAppender.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
- *
- * This software is published under the terms of the Apache Software
- * License version 1.1, a copy of which has been included with this
- * distribution in the LICENSE.APL file. */
-
-package org.apache.log4j.gui;
-
-
-import java.awt.Color;
-import java.awt.Image;
-import java.awt.Toolkit;
-import java.io.*;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-import java.util.Hashtable;
-
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
-import javax.swing.JTextPane;
-import javax.swing.text.AttributeSet;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.MutableAttributeSet;
-import javax.swing.text.SimpleAttributeSet;
-import javax.swing.text.StyleConstants;
-import javax.swing.text.StyledDocument;
-import javax.swing.text.TabSet;
-import javax.swing.text.TabStop;
-
-import org.apache.log4j.*;
-
-import org.apache.log4j.spi.LoggingEvent;
-import org.apache.log4j.helpers.Loader;
-import org.apache.log4j.helpers.QuietWriter;
-import org.apache.log4j.helpers.TracerPrintWriter;
-import org.apache.log4j.helpers.OptionConverter;
-
-
-/**
- * <b>Experimental</b> TextPaneAppender. <br>
- *
- *
- * Created: Sat Feb 26 18:50:27 2000 <br>
- *
- * @author Sven Reimers
- */
-
-public class TextPaneAppender extends AppenderSkeleton {
-
- JTextPane textpane;
- StyledDocument doc;
- TracerPrintWriter tp;
- StringWriter sw;
- QuietWriter qw;
- Hashtable attributes;
- Hashtable icons;
-
- private String label;
-
- private boolean fancy;
-
- final String LABEL_OPTION = "Label";
- final String COLOR_OPTION_FATAL = "Color.Emerg";
- final String COLOR_OPTION_ERROR = "Color.Error";
- final String COLOR_OPTION_WARN = "Color.Warn";
- final String COLOR_OPTION_INFO = "Color.Info";
- final String COLOR_OPTION_DEBUG = "Color.Debug";
- final String COLOR_OPTION_BACKGROUND = "Color.Background";
- final String FANCY_OPTION = "Fancy";
- final String FONT_NAME_OPTION = "Font.Name";
- final String FONT_SIZE_OPTION = "Font.Size";
-
- public static Image loadIcon ( String path ) {
- Image img = null;
- try {
- URL url = ClassLoader.getSystemResource(path);
- img = (Image) (Toolkit.getDefaultToolkit()).getImage(url);
- } catch (Exception e) {
- System.out.println("Exception occured: " + e.getMessage() +
- " - " + e );
- }
- return (img);
- }
-
- public TextPaneAppender(Layout layout, String name) {
- this();
- this.layout = layout;
- this.name = name;
- setTextPane(new JTextPane());
- createAttributes();
- createIcons();
- }
-
- public TextPaneAppender() {
- super();
- setTextPane(new JTextPane());
- createAttributes();
- createIcons();
- this.label="";
- this.sw = new StringWriter();
- this.qw = new QuietWriter(sw, errorHandler);
- this.tp = new TracerPrintWriter(qw);
- this.fancy =true;
- }
-
- public
- void close() {
-
- }
-
- private void createAttributes() {
- Priority prio[] = Priority.getAllPossiblePriorities();
-
- attributes = new Hashtable();
- for (int i=0; i<prio.length;i++) {
- MutableAttributeSet att = new SimpleAttributeSet();
- attributes.put(prio[i], att);
- StyleConstants.setFontSize(att,14);
- }
- StyleConstants.setForeground((MutableAttributeSet)attributes.get(Priority.ERROR),Color.red);
- StyleConstants.setForeground((MutableAttributeSet)attributes.get(Priority.WARN),Color.orange);
- StyleConstants.setForeground((MutableAttributeSet)attributes.get(Priority.INFO),Color.gray);
- StyleConstants.setForeground((MutableAttributeSet)attributes.get(Priority.DEBUG),Color.black);
- }
-
- private void createIcons() {
- Priority prio[] = Priority.getAllPossiblePriorities();
-
- icons = new Hashtable();
- for (int i=0; i<prio.length;i++) {
- if (prio[i].equals(Priority.FATAL))
- icons.put(prio[i],new ImageIcon(loadIcon("icons/RedFlag.gif")));
- if (prio[i].equals(Priority.ERROR))
- icons.put(prio[i],new ImageIcon(loadIcon("icons/RedFlag.gif")));
- if (prio[i].equals(Priority.WARN))
- icons.put(prio[i],new ImageIcon(loadIcon("icons/BlueFlag.gif")));
- if (prio[i].equals(Priority.INFO))
- icons.put(prio[i],new ImageIcon(loadIcon("icons/GreenFlag.gif")));
- if (prio[i].equals(Priority.DEBUG))
- icons.put(prio[i],new ImageIcon(loadIcon("icons/GreenFlag.gif")));
- }
- }
-
- public void append(LoggingEvent event) {
- String text = this.layout.format(event);
- String trace="";
- // Print Stacktrace
- // Quick Hack maybe there is a better/faster way?
- if (event.throwable!=null) {
- event.throwable.printStackTrace(tp);
- for (int i=0; i< sw.getBuffer().length(); i++) {
- if (sw.getBuffer().charAt(i)=='\t')
- sw.getBuffer().replace(i,i+1," ");
- }
- trace = sw.toString();
- sw.getBuffer().delete(0,sw.getBuffer().length());
- }
- try {
- if (fancy) {
- textpane.setEditable(true);
- textpane.insertIcon((ImageIcon)icons.get(event.priority));
- textpane.setEditable(false);
- }
- doc.insertString(doc.getLength(),text+trace,
- (MutableAttributeSet)attributes.get(event.priority));
- }
- catch (BadLocationException badex) {
- System.err.println(badex);
- }
- textpane.setCaretPosition(doc.getLength());
- }
-
- public
- JTextPane getTextPane() {
- return textpane;
- }
-
- private
- static
- Color parseColor (String v) {
- StringTokenizer st = new StringTokenizer(v,",");
- int val[] = {255,255,255,255};
- int i=0;
- while (st.hasMoreTokens()) {
- val[i]=Integer.parseInt(st.nextToken());
- i++;
- }
- return new Color(val[0],val[1],val[2],val[3]);
- }
-
- private
- static
- String colorToString(Color c) {
- // alpha component emitted only if not default (255)
- String res = ""+c.getRed()+","+c.getGreen()+","+c.getBlue();
- return c.getAlpha() >= 255 ? res : res + ","+c.getAlpha();
- }
-
- public
- void setLayout(Layout layout) {
- this.layout=layout;
- }
-
- public
- void setName(String name) {
- this.name = name;
- }
-
-
- public
- void setTextPane(JTextPane textpane) {
- this.textpane=textpane;
- textpane.setEditable(false);
- textpane.setBackground(Color.lightGray);
- this.doc=textpane.getStyledDocument();
- }
-
- private
- void setColor(Priority p, String v) {
- StyleConstants.setForeground(
- (MutableAttributeSet)attributes.get(p),parseColor(v));
- }
-
- private
- String getColor(Priority p) {
- Color c = StyleConstants.getForeground(
- (MutableAttributeSet)attributes.get(p));
- return c == null ? null : colorToString(c);
- }
-
- /////////////////////////////////////////////////////////////////////
- // option setters and getters
-
- public
- void setLabel(String label) {
- this.label = label;
- }
- public
- String getLabel() {
- return label;
- }
-
- public
- void setColorEmerg(String color) {
- setColor(Priority.FATAL, color);
- }
- public
- String getColorEmerg() {
- return getColor(Priority.FATAL);
- }
-
- public
- void setColorError(String color) {
- setColor(Priority.ERROR, color);
- }
- public
- String getColorError() {
- return getColor(Priority.ERROR);
- }
-
- public
- void setColorWarn(String color) {
- setColor(Priority.WARN, color);
- }
- public
- String getColorWarn() {
- return getColor(Priority.WARN);
- }
-
- public
- void setColorInfo(String color) {
- setColor(Priority.INFO, color);
- }
- public
- String getColorInfo() {
- return getColor(Priority.INFO);
- }
-
- public
- void setColorDebug(String color) {
- setColor(Priority.DEBUG, color);
- }
- public
- String getColorDebug() {
- return getColor(Priority.DEBUG);
- }
-
- public
- void setColorBackground(String color) {
- textpane.setBackground(parseColor(color));
- }
- public
- String getColorBackground() {
- return colorToString(textpane.getBackground());
- }
-
- public
- void setFancy(boolean fancy) {
- this.fancy = fancy;
- }
- public
- boolean getFancy() {
- return fancy;
- }
-
- public
- void setFontSize(int size) {
- Enumeration e = attributes.elements();
- while (e.hasMoreElements()) {
- StyleConstants.setFontSize((MutableAttributeSet)e.nextElement(),size);
- }
- return;
- }
-
- public
- int getFontSize() {
- AttributeSet attrSet = (AttributeSet) attributes.get(Priority.INFO);
- return StyleConstants.getFontSize(attrSet);
- }
-
- public
- void setFontName(String name) {
- Enumeration e = attributes.elements();
- while (e.hasMoreElements()) {
- StyleConstants.setFontFamily((MutableAttributeSet)e.nextElement(),name);
- }
- return;
- }
-
- public
- String getFontName() {
- AttributeSet attrSet = (AttributeSet) attributes.get(Priority.INFO);
- return StyleConstants.getFontFamily(attrSet);
- }
-
- public
- boolean requiresLayout() {
- return true;
- }
-} // TextPaneAppender
-
-
-
diff --git a/contribs/SvenReimers/gui/examples/TextPaneAppenderExample.java b/contribs/SvenReimers/gui/examples/TextPaneAppenderExample.java
deleted file mode 100644
index 2c297fd..0000000
--- a/contribs/SvenReimers/gui/examples/TextPaneAppenderExample.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
- *
- * This software is published under the terms of the Apache Software
- * License version 1.1, a copy of which has been included with this
- * distribution in the LICENSE.APL file. */
-
-package org.apache.log4j.gui.examples;
-
-import java.awt.BorderLayout;
-import java.awt.event.*;
-import javax.swing.*;
-import org.apache.log4j.*;
-import org.apache.log4j.gui.*;
-
-
-
-public class TextPaneAppenderExample implements ActionListener {
-
- JFrame mainframe;
- ButtonGroup priorities;
- TextPaneAppender tpa;
- Category gui;
- Priority prio[];
- JTabbedPane logview;
-
-
- public TextPaneAppenderExample () {
- mainframe = new JFrame("Testing the TextPaneAppender...");
- mainframe.setSize(300,300);
- logview = new JTabbedPane();
- createLogger();
- createMenuBar();
- mainframe.setVisible(true);
- mainframe.getContentPane().add(logview);
- }
-
- public void createLogger() {
- tpa = new TextPaneAppender(new PatternLayout("%-5p %d [%t]: %m%n"),"Debug");
- logview.addTab("Events ...",new JScrollPane(tpa.getTextPane()));
- gui = Category.getInstance(this.getClass().getName());
- gui.addAppender(tpa);
- }
-
- public void createMenuBar() {
- JMenu file = new JMenu("File");
- JMenuItem exit = new JMenuItem("Exit");
- exit.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent ae) {
- System.exit(0);
- }
- });
- file.add(exit);
- JMenuBar mb = new JMenuBar();
- mb.add(file);
-
- JMenu logevent = new JMenu("LoggingEvents");
- JMenu selectprio = new JMenu("Priority");
-
- prio = Priority.getAllPossiblePriorities();
- JRadioButtonMenuItem priority[]= new JRadioButtonMenuItem[prio.length];
- priorities = new ButtonGroup();
-
- for (int i=0; i<prio.length;i++) {
- if (i==0)
- priority[i] = new JRadioButtonMenuItem(prio[i].toString(),true);
- else
- priority[i] = new JRadioButtonMenuItem(prio[i].toString());
- priority[i].setActionCommand(prio[i].toString());
- selectprio.add(priority[i]);
- priorities.add(priority[i]);
-
- }
-
- logevent.add(selectprio);
-
- JMenuItem lognow = new JMenuItem("LogIt!");
- lognow.addActionListener(this);
- logevent.add(lognow);
-
- mb.add(logevent);
-
- mainframe.setJMenuBar(mb);
-
- }
-
- public void actionPerformed(ActionEvent ae){
- String logtext = JOptionPane.showInputDialog("Text to log");
- if (logtext == null) logtext="NO Input";
- int i=0;
- String name = priorities.getSelection().getActionCommand();
- while (!prio[i].toString().equals(name))
- i=i+1;
- gui.log(prio[i],logtext);
- }
-
- static public void main(String args[]) {
- TextPaneAppenderExample tpex = new TextPaneAppenderExample();
- }
-
-}
diff --git a/contribs/ThomasFenner/JDBCAppender.java b/contribs/ThomasFenner/JDBCAppender.java
deleted file mode 100644
index d82bb20..0000000
--- a/contribs/ThomasFenner/JDBCAppender.java
+++ /dev/null
@@ -1,589 +0,0 @@
-
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
-*/
-
-package com.klopotek.utils.log;
-
-import java.sql.*;
-import java.util.*;
-import org.apache.log4j.*;
-import org.apache.log4j.helpers.*;
-import org.apache.log4j.spi.*;
-
-/**
-The JDBCAppender, writes messages into a database
-
-<p><b>The JDBCAppender is configurable at runtime by setting options in two alternatives : </b></p>
-<dir>
- <p><b>1. Use a configuration-file</b></p>
- <p>Define the options in a file (<A HREF="configfile_example.txt">example</A>) and call a <code>PropertyConfigurator.configure(filename)</code> in your code.</p>
- <p><b>2. Use the methods of JDBCAppender to do it</b></p>
- <p>Call <code>JDBCAppender::setOption(JDBCAppender.xxx_OPTION, String value)</code> to do it analogically without a configuration-file (<A HREF="code_example2.java">example</A>)</p>
-</dir>
-
-<p>All available options are defined as static String-constants in JDBCAppender named xxx_OPTION.</p>
-
-<p><b>Here is a description of all available options :</b></p>
-<dir>
- <p><b>1. Database-options to connect to the database</b></p>
- <p>- <b>URL_OPTION</b> : a database url of the form jdbc:subprotocol:subname</p>
- <p>- <b>USERNAME_OPTION</b> : the database user on whose behalf the connection is being made</p>
- <p>- <b>PASSWORD_OPTION</b> : the user's password</p>
-
- <p><b>2. Connector-option to specify your own JDBCConnectionHandler</b></p>
- <p>- <b>CONNECTOR_OPTION</b> : a classname which is implementing the JDBCConnectionHandler-interface</p>
- <p>This interface is used to get a customized connection.</p>
- <p>If in addition the database-options are given, these options will be used as arguments for the JDBCConnectionHandler-interface to get a connection.</p>
- <p>Else if no database-options are given, the JDBCConnectionHandler-interface is called without them.</p>
- <p>Else if this option is not defined, the database-options are required to open a connection by the JDBCAppender.</p>
-
- <p><b>3. SQL-option to specify a static sql-statement which will be performed with every occuring message-event</b></p>
- <p>- <b>SQL_OPTION</b> : a sql-statement which will be used to write to the database</p>
- <p>Use the variable <b>@MSG@</b> on a location in the statement, which has to be dynamically replaced by the message-text.</p>
- <p>If you give this option, the table-option and columns-option will be ignored !</p>
-
- <p><b>4. Table-option to specify a table contained by the database</b></p>
- <p>- <b>TABLE_OPTION</b> : the table in which the logging will be done</p>
-
- <p><b>5. Columns-option to describe the important columns of the table (Not nullable columns are mandatory to describe!)</b></p>
- <p>- <b>COLUMNS_OPTION</b> : a formatted list of column-descriptions</p>
- <p>Each column description consists of</p>
- <dir>
- <p>- the <b><i>name</i></b> of the column (required)</p>
- <p>- a <b><i>logtype</i></b> which is a static constant of class LogType (required)</p>
- <p>- and a <b><i>value</i></b> which depends by the LogType (optional/required, depending by logtype)</p>
- </dir>
- <p>Here is a description of the available logtypes of class <b>{@link LogType}</b> and how to handle the <b><i>value</i></b>:</p>
- <dir>
- <p>o <b>MSG</b> = a value will be ignored, the column will get the message. (One columns need to be of this type!)</p>
- <p>o <b>STATIC</b> = the value will be filled into the column with every logged message. (Ensure that the type of value can be casted into the sql-type of the column!)</p>
- <p>o <b>ID</b> = value must be a classname, which implements the JDBCIDHandler-interface.</p>
- <p>o <b>TIMESTAMP</b> = a value will be ignored, the column will be filled with a actually timestamp with every logged message.</p>
- <p>o <b>EMPTY</b> = a value will be ignored, the column will be ignored when writing to the database (Ensure to fill not nullable columns by a database trigger!)</p>
- </dir>
- <p>If there are more than one column to describe, the columns must be separated by a Tabulator-delimiter (unicode0008) !</p>
- <p>The arguments of a column-description must be separated by the delimiter '~' !</p>
- <p><i>(Example : name1~logtype1~value1 name2~logtype2~value2...)</i></p>
-
- <p><b>6. Layout-options to define the layout of the messages (optional)</b></p>
- <p>- <b>_</b> : the layout wont be set by a xxx_OPTION</p>
- <p>See the configuration-file and code examples below...</p>
- <p>The default is a layout of the class {@link org.apache.log4j.PatternLayout} with the pattern=%m which representate only the message.</p>
-
- <p><b>7. Buffer-option to define the size of the message-event-buffer (optional)</b></p>
- <p>- <b>BUFFER_OPTION</b> : define how many messages will be buffered until they will be updated to the database.</p>
- <p>The default is buffer=1, which will do a update with every happened message-event.</p>
-
- <p><b>8. Commit-option to define a auto-commitment</b></p>
- <p>- <b>COMMIT_OPTION</b> : define whether updated messages should be committed to the database (Y) or not (N).</p>
- <p>The default is commit=Y.</p>
-</dir>
-
-<p><b>The sequence of some options is important :</b></p>
-<dir>
- <p><b>1. Connector-option OR/AND Database-options</b></p>
- <p>Any database connection is required !</p>
- <p><b>2. (Table-option AND Columns-option) OR SQL-option</b></p>
- <p>Anything of that is required ! Whether where to write something OR what to write somewhere...;-)</p>
- <p><b>3. All other options can be set at any time...</b></p>
- <p>The other options are optional and have a default initialization, which can be customized.</p>
-</dir>
-
-<p><b>Here is a <b>configuration-file example</b>, which can be used as argument for the <b>PropertyConfigurator</b> : </b><A HREF="configfile_example.txt"> configfile_example.txt</A></p>
-
-<p><b>Here is a <b>code-example</b> to configure the JDBCAppender <b>with a configuration-file</b> : </b><A HREF="code_example1.java"> code_example1.java</A></p>
-
-<p><b>Here is a <b>another code-example</b> to configure the JDBCAppender <b>without a configuration-file</b> : </b><A HREF="code_example2.java"> code_example2.java</A></p>
-
-
-
-<p><b>Author : </b><A HREF="mailto:t.fenner@klopotek.de">Thomas Fenner</A></p>
-
-@since 1.0
-*/
-public class JDBCAppender extends AppenderSkeleton
-{
- /**
- A database-option to to set a database url of the form jdbc:subprotocol:subname.
- */
- public static final String URL_OPTION = "url";
-
- /**
- A database-option to set the database user on whose behalf the connection is being made.
- */
- public static final String USERNAME_OPTION = "username";
-
- /**
- A database-option to set the user's password.
- */
- public static final String PASSWORD_OPTION = "password";
-
- /**
- A table-option to specify a table contained by the database
- */
- public static final String TABLE_OPTION = "table";
-
- /**
- A connector-option to specify your own JDBCConnectionHandler
- */
- public static final String CONNECTOR_OPTION = "connector";
-
- /**
- A columns-option to describe the important columns of the table
- */
- public static final String COLUMNS_OPTION = "columns";
-
- /**
- A sql-option to specify a static sql-statement which will be performed with every occuring message-event
- */
- public static final String SQL_OPTION = "sql";
-
- /**
- A buffer-option to define the size of the message-event-buffer
- */
- public static final String BUFFER_OPTION = "buffer";
-
- /**
- A commit-option to define a auto-commitment
- */
- public static final String COMMIT_OPTION = "commit";
-
-
- //Variables to store the options values setted by setOption() :
- private String url = null;
- private String username = null;
- private String password = null;
- private String table = null;
- private String connection_class = null;
- private String sql = null;
- private boolean docommit = true;
- private int buffer_size = 1;
- private JDBCConnectionHandler connectionHandler = null;
-
- //This buffer stores message-events.
- //When the buffer_size is reached, the buffer will be flushed and the messages will updated to the database.
- private ArrayList buffer = new ArrayList();
-
- //Database-connection
- private Connection con = null;
-
- //This class encapsulate the logic which is necessary to log into a table
- private JDBCLogger jlogger = new JDBCLogger();
-
- //Flags :
- //A flag to indicate a established database connection
- private boolean connected = false;
- //A flag to indicate configuration status
- private boolean configured = false;
- //A flag to indicate that everything is ready to get append()-commands.
- private boolean ready = false;
-
- /**
- If program terminates close the database-connection and flush the buffer
- */
- public void finalize()
- {
- close();
- super.finalize();
- }
-
- /**
- Internal method. Returns a array of strings containing the available options which can be set with method setOption()
- */
- public String[] getOptionStrings()
- {
- // The sequence of options in this string is important, because setOption() is called this way ...
- return new String[]{CONNECTOR_OPTION, URL_OPTION, USERNAME_OPTION, PASSWORD_OPTION, SQL_OPTION, TABLE_OPTION, COLUMNS_OPTION, BUFFER_OPTION, COMMIT_OPTION};
- }
-
-
- /**
- Sets all necessary options
- */
- public void setOption(String _option, String _value)
- {
- _option = _option.trim();
- _value = _value.trim();
-
- if(_option == null || _value == null) return;
- if(_option.length() == 0 || _value.length() == 0) return;
-
- _value = _value.trim();
-
- if(_option.equals(CONNECTOR_OPTION))
- {
- if(!connected) connection_class = _value;
- }
- else if(_option.equals(URL_OPTION))
- {
- if(!connected) url = _value;
- }
- else if(_option.equals(USERNAME_OPTION))
- {
- if(!connected) username = _value;
- }
- else if(_option.equals(PASSWORD_OPTION))
- {
- if(!connected) password = _value;
- }
- else if(_option.equals(SQL_OPTION))
- {
- sql = _value;
- }
- else if(_option.equals(TABLE_OPTION))
- {
- if(sql != null) return;
- table = _value;
- }
- else if(_option.equals(COLUMNS_OPTION))
- {
- if(sql != null) return;
-
- String name = null;
- int logtype = -1;
- String value = null;
- String column = null;
- String arg = null;
- int num_args = 0;
- int num_columns = 0;
- StringTokenizer st_col;
- StringTokenizer st_arg;
-
- //Columns are TAB-separated
- st_col = new StringTokenizer(_value, " ");
-
- num_columns = st_col.countTokens();
-
- if(num_columns < 1)
- {
- errorHandler.error("JDBCAppender::setOption(), Invalid COLUMN_OPTION value : " + _value + " !");
- return;
- }
-
- for(int i=1; i<=num_columns; i++)
- {
- column = st_col.nextToken();
-
- //Arguments are ~-separated
- st_arg = new StringTokenizer(column, "~");
-
- num_args = st_arg.countTokens();
-
- if(num_args < 2)
- {
- errorHandler.error("JDBCAppender::setOption(), Invalid COLUMN_OPTION value : " + _value + " !");
- return;
- }
-
- for(int j=1; j<=num_args; j++)
- {
- arg = st_arg.nextToken();
-
- if(j == 1) name = arg;
- else if(j == 2)
- {
- try
- {
- logtype = Integer.parseInt(arg);
- }
- catch(Exception e)
- {
- logtype = LogType.parseLogType(arg);
- }
-
- if(!LogType.isLogType(logtype))
- {
- errorHandler.error("JDBCAppender::setOption(), Invalid COLUMN_OPTION LogType : " + arg + " !");
- return;
- }
- }
- else if(j == 3) value = arg;
- }
-
- if(!setLogType(name, logtype, value)) return;
- }
- }
- else if(_option.equals(BUFFER_OPTION))
- {
- try
- {
- buffer_size = Integer.parseInt(_value);
- }
- catch(Exception e)
- {
- errorHandler.error("JDBCAppender::setOption(), Invalid BUFFER_OPTION value : " + _value + " !");
- return;
- }
- }
- else if(_option.equals(COMMIT_OPTION))
- {
- docommit = _value.equals("Y");
- }
-
- if(_option.equals(SQL_OPTION) || _option.equals(TABLE_OPTION))
- {
- if(!configured) configure();
- }
- }
-
- /**
- Internal method. Returns true, you may define your own layout...
- */
- public boolean requiresLayout()
- {
- return true;
- }
-
-
- /**
- Internal method. Close the database connection & flush the buffer.
- */
- public void close()
- {
- flush_buffer();
- if(connection_class == null)
- {
- try{con.close();}catch(Exception e){errorHandler.error("JDBCAppender::close(), " + e);}
- }
- this.closed = true;
- }
-
-
- /**
- You have to call this function for all provided columns of your log-table !
- */
- public boolean setLogType(String _name, int _logtype, Object _value)
- {
- if(sql != null) return true;
-
- if(!configured)
- {
- if(!configure()) return false;
- }
-
- try
- {
- jlogger.setLogType(_name, _logtype, _value);
- }
- catch(Exception e)
- {
- errorHandler.error("JDBCAppender::setLogType(), " + e);
- return false;
- }
-
- return true;
- }
-
-
- /**
- Internal method. Appends the message to the database table.
- */
- public void append(LoggingEvent event)
- {
- if(!ready)
- {
- if(!ready())
- {
- errorHandler.error("JDBCAppender::append(), Not ready to append !");
- return;
- }
- }
-
- buffer.add(event);
-
- if(buffer.size() >= buffer_size) flush_buffer();
- }
-
-
- /**
- Internal method. Flushes the buffer.
- */
- public void flush_buffer()
- {
- try
- {
- int size = buffer.size();
-
- if(size < 1) return;
-
- for(int i=0; i<size; i++)
- {
- LoggingEvent event = (LoggingEvent)buffer.get(i);
-
- //Insert message into database
- jlogger.append(layout.format(event));
- }
-
- buffer.clear();
-
- if(docommit) con.commit();
- }
- catch(Exception e)
- {
- errorHandler.error("JDBCAppender::flush_buffer(), " + e + " : " + jlogger.getErrorMsg());
- try{con.rollback();} catch(Exception ex){}
- return;
- }
- }
-
-
- /**
- Internal method. Returns true, when the JDBCAppender is ready to append messages to the database, else false.
- */
- public boolean ready()
- {
- if(ready) return true;
-
- if(!configured) return false;
-
- ready = jlogger.ready();
-
- if(!ready){errorHandler.error(jlogger.getErrorMsg());}
-
- return ready;
- }
-
-
- /**
- Internal method. Connect to the database.
- */
- protected void connect() throws Exception
- {
- if(connected) return;
-
- try
- {
- if(connection_class == null)
- {
- if(url == null) throw new Exception("JDBCAppender::connect(), No URL defined.");
-
- if(username == null) throw new Exception("JDBCAppender::connect(), No USERNAME defined.");
-
- if(password == null) throw new Exception("JDBCAppender::connect(), No PASSWORD defined.");
-
- connectionHandler = new DefaultConnectionHandler();
- }
- else
- {
- connectionHandler = (JDBCConnectionHandler)(Class.forName(connection_class).newInstance());
- }
-
- if(url != null && username != null && password != null)
- {
- con = connectionHandler.getConnection(url, username, password);
- }
- else
- {
- con = connectionHandler.getConnection();
- }
-
- if(con.isClosed())
- {
- throw new Exception("JDBCAppender::connect(), JDBCConnectionHandler returns no connected Connection !");
- }
- }
- catch(Exception e)
- {
- throw new Exception("JDBCAppender::connect(), " + e);
- }
-
- connected = true;
- }
-
- /**
- Internal method. Configures for appending...
- */
- protected boolean configure()
- {
- if(configured) return true;
-
- if(!connected)
- {
- if((connection_class == null) && (url == null || username == null || password == null))
- {
- errorHandler.error("JDBCAppender::configure(), Missing database-options or connector-option !");
- return false;
- }
-
- try
- {
- connect();
- }
- catch(Exception e)
- {
- connection_class = null;
- url = null;
- errorHandler.error("JDBCAppender::configure(), " + e);
- return false;
- }
- }
-
- if(sql == null && table == null)
- {
- errorHandler.error("JDBCAppender::configure(), No SQL_OPTION or TABLE_OPTION given !");
- return false;
- }
-
- if(!jlogger.isConfigured())
- {
- try
- {
- jlogger.setConnection(con);
-
- if(sql == null)
- {
- jlogger.configureTable(table);
- }
- else jlogger.configureSQL(sql);
- }
- catch(Exception e)
- {
- errorHandler.error("JDBCAppender::configure(), " + e);
- return false;
- }
- }
-
- //Default Message-Layout
- if(layout == null)
- {
- layout = new PatternLayout("%m");
- }
-
- configured = true;
-
- return true;
- }
-}
-
-/**
-This is a default JDBCConnectionHandler used by JDBCAppender
-*/
-class DefaultConnectionHandler implements JDBCConnectionHandler
-{
- Connection con = null;
-
- public Connection getConnection()
- {
- return con;
- }
-
- public Connection getConnection(String _url, String _username, String _password)
- {
- try
- {
- if(con != null && !con.isClosed()) con.close();
- con = DriverManager.getConnection(_url, _username, _password);
- con.setAutoCommit(false);
- }
- catch(Exception e){}
-
- return con;
- }
-}
-
-
-
-
-
-
diff --git a/contribs/ThomasFenner/JDBCConnectionHandler.java b/contribs/ThomasFenner/JDBCConnectionHandler.java
deleted file mode 100644
index 535007c..0000000
--- a/contribs/ThomasFenner/JDBCConnectionHandler.java
+++ /dev/null
@@ -1,26 +0,0 @@
-
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
-*/
-
-package com.klopotek.utils.log;
-
-import java.sql.*;
-
-
-/**
-This interface has to be implemented for your own database-connection-handling and its used in class JDBCLogger.
-
-<p><b>Author : </b><A HREF="mailto:t.fenner@klopotek.de">Thomas Fenner</A></p>
-
-@since 1.0
-*/
-public interface JDBCConnectionHandler
-{
- /**Get a connection*/
- Connection getConnection();
- /**Get a defined connection*/
- Connection getConnection(String _url, String _username, String _password);
-}
-
-
diff --git a/contribs/ThomasFenner/JDBCIDHandler.java b/contribs/ThomasFenner/JDBCIDHandler.java
deleted file mode 100644
index 2135f57..0000000
--- a/contribs/ThomasFenner/JDBCIDHandler.java
+++ /dev/null
@@ -1,23 +0,0 @@
-
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
-*/
-
-package com.klopotek.utils.log;
-
-
-/**
-This interface has to be implemented to provide ID-columns with unique IDs and its used in class JDBCLogger.
-
-<p><b>Author : </b><A HREF="mailto:t.fenner@klopotek.de">Thomas Fenner</A></p>
-
-@since 1.0
-*/
-public interface JDBCIDHandler
-{
- /**Get a unique ID*/
- Object getID();
-}
-
-
-
diff --git a/contribs/ThomasFenner/JDBCLogger.java b/contribs/ThomasFenner/JDBCLogger.java
deleted file mode 100644
index ef8bc93..0000000
--- a/contribs/ThomasFenner/JDBCLogger.java
+++ /dev/null
@@ -1,456 +0,0 @@
-
-/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
-*/
-
-package com.klopotek.utils.log;
-
-import java.sql.*;
-import java.util.*;
-import org.apache.log4j.*;
-import org.apache.log4j.helpers.*;
-import org.apache.log4j.spi.*;
-
-
-/**
-This class encapsulate the logic which is necessary to log into a table.
-Used by JDBCAppender
-
-<p><b>Author : </b><A HREF="mailto:t.fenner@klopotek.de">Thomas Fenner</A></p>
-
-@since 1.0
-*/
-public class JDBCLogger
-{
- //All columns of the log-table
- private ArrayList logcols = null;
- //Only columns which will be provided by logging
- private String column_list = null;
- //Number of all columns
- private int num = 0;
- //Status for successful execution of method configure()
- private boolean isconfigured = false;
- //Status for ready to do logging with method append()
- private boolean ready = false;
- //This message will be filled with a error-string when method ready() failes, and can be got by calling getMsg()
- private String errormsg = "";
-
- private Connection con = null;
- private Statement stmt = null;
- private ResultSet rs = null;
- private String table = null;
-
- //Variables for static SQL-statement logging
- private String sql = null;
- private String new_sql = null;
- private String new_sql_part1 = null;
- private String new_sql_part2 = null;
- private static final String msg_wildcard = "@MSG@";
- private int msg_wildcard_pos = 0;
-
- /**
- Writes a message into the database table.
- Throws an exception, if an database-error occurs !
- */
- public void append(String _msg) throws Exception
- {
- if(!ready) if(!ready()) throw new Exception("JDBCLogger::append(), Not ready to append !");
-
- if(sql != null)
- {
- appendSQL(_msg);
- return;
- }
-
- LogColumn logcol;
-
- rs.moveToInsertRow();
-
- for(int i=0; i<num; i++)
- {
- logcol = (LogColumn)logcols.get(i);
-
- if(logcol.logtype == LogType.MSG)
- {
- rs.updateObject(logcol.name, _msg);
- }
- else if(logcol.logtype == LogType.ID)
- {
- rs.updateObject(logcol.name, logcol.idhandler.getID());
- }
- else if(logcol.logtype == LogType.STATIC)
- {
- rs.updateObject(logcol.name, logcol.value);
- }
- else if(logcol.logtype == LogType.TIMESTAMP)
- {
- rs.updateObject(logcol.name, new Timestamp((new java.util.Date()).getTime()));
- }
- }
-
- rs.insertRow();
- }
-
- /**
- Writes a message into the database using a given sql-statement.
- Throws an exception, if an database-error occurs !
- */
- public void appendSQL(String _msg) throws Exception
- {
- if(!ready) if(!ready()) throw new Exception("JDBCLogger::appendSQL(), Not ready to append !");
-
- if(sql == null) throw new Exception("JDBCLogger::appendSQL(), No SQL-Statement configured !");
-
- if(msg_wildcard_pos > 0)
- {
- new_sql = new_sql_part1 + _msg + new_sql_part2;
- }
- else new_sql = sql;
-
- try
- {
- stmt.executeUpdate(new_sql);
- }
- catch(Exception e)
- {
- errormsg = new_sql;
- throw e;
- }
- }
-
-
- /**
- Configures this class, by reading in the structure of the log-table
- Throws an exception, if an database-error occurs !
- */
- public void configureTable(String _table) throws Exception
- {
- if(isconfigured) return;
-
- //Fill logcols with META-informations of the table-columns
- stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
- rs = stmt.executeQuery("SELECT * FROM " + _table + " WHERE 1 = 2");
-
- LogColumn logcol;
-
- ResultSetMetaData rsmd = rs.getMetaData();
-
- num = rsmd.getColumnCount();
-
- logcols = new ArrayList(num);
-
- for(int i=1; i<=num; i++)
- {
- logcol = new LogColumn();
- logcol.name = rsmd.getColumnName(i).toUpperCase();
- logcol.type = rsmd.getColumnTypeName(i);
- logcol.nullable = (rsmd.isNullable(i) == rsmd.columnNullable);
- logcol.isWritable = rsmd.isWritable(i);
- if(!logcol.isWritable) logcol.ignore = true;
- logcols.add(logcol);
- }
-
- table = _table;
-
- isconfigured = true;
- }
-
- /**
- Configures this class, by storing and parsing the given sql-statement.
- Throws an exception, if somethings wrong !
- */
- public void configureSQL(String _sql) throws Exception
- {
- if(isconfigured) return;
-
- if(!isConnected()) throw new Exception("JDBCLogger::configureSQL(), Not connected to database !");
-
- if(_sql == null || _sql.trim().equals("")) throw new Exception("JDBCLogger::configureSQL(), Invalid SQL-Statement !");
-
- sql = _sql.trim();
-
- stmt = con.createStatement();
-
- msg_wildcard_pos = sql.indexOf(msg_wildcard);
-
- if(msg_wildcard_pos > 0)
- {
- new_sql_part1 = sql.substring(0, msg_wildcard_pos-1) + "'";
- //between the message...
- new_sql_part2 = "'" + sql.substring(msg_wildcard_pos+msg_wildcard.length());
- }
-
- isconfigured = true;
- }
-
- /**
- Sets a connection. Throws an exception, if the connection is not open !
- */
- public void setConnection(Connection _con) throws Exception
- {
- con = _con;
-
- if(!isConnected()) throw new Exception("JDBCLogger::setConnection(), Given connection isnt connected to database !");
- }
-
-
- /**
- Sets a columns logtype (LogTypes) and value, which depends on that logtype.
- Throws an exception, if the given arguments arent correct !
- */
- public void setLogType(String _name, int _logtype, Object _value) throws Exception
- {
- if(!isconfigured) throw new Exception("JDBCLogger::setLogType(), Not configured !");
-
- //setLogType() makes only sense for further configuration of configureTable()
- if(sql != null) return;
-
- _name = _name.toUpperCase();
-
- if(_name == null || !(_name.trim().length() > 0)) throw new Exception("JDBCLogger::setLogType(), Missing argument name !");
- if(!LogType.isLogType(_logtype)) throw new Exception("JDBCLogger::setLogType(), Invalid logtype '" + _logtype + "' !");
... 114737 lines suppressed ...