Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2009-11-08 06:50:45 +0000
committerGreg Wilkins2009-11-08 06:50:45 +0000
commite7f6b3e846eb119d4ada90693f73550c0b9f54c4 (patch)
tree59233204020b303b026bfd520ef63543331b2d2c
parent4755af0996d17093223a178aca9a598cd4d8c26c (diff)
downloadorg.eclipse.jetty.project-e7f6b3e846eb119d4ada90693f73550c0b9f54c4.tar.gz
org.eclipse.jetty.project-e7f6b3e846eb119d4ada90693f73550c0b9f54c4.tar.xz
org.eclipse.jetty.project-e7f6b3e846eb119d4ada90693f73550c0b9f54c4.zip
moved back to sandbox
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1034 7e9141cc-0065-0410-87d8-b60c137991c4
-rw-r--r--jetty-centralized-logging/.gitignore9
-rw-r--r--jetty-centralized-logging/docs/jetty_centralized_logging.pngbin120410 -> 0 bytes
-rw-r--r--jetty-centralized-logging/docs/jetty_centralized_logging.svg853
-rw-r--r--jetty-centralized-logging/pom.xml148
-rw-r--r--jetty-centralized-logging/src/main/config/etc/jetty-centralized-logging.properties8
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/Appender.java37
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralLogger.java246
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralLoggerConfig.java424
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralLoggerFactory.java60
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralMDC.java201
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralMDCAdapter.java56
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/ConsoleAppender.java118
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/DefaultFormatter.java47
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/Formatter.java8
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/JavaUtilLoggingRouting.java163
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/PropertyExpansion.java45
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/RollingFileAppender.java249
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/Severity.java27
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/ThreadLocalMap.java35
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/io/LogIO.java119
-rw-r--r--jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/io/RolloverFileOutputStream.java330
-rw-r--r--jetty-centralized-logging/src/main/java/org/slf4j/impl/StaticLoggerBinder.java187
-rw-r--r--jetty-centralized-logging/src/main/java/org/slf4j/impl/StaticMDCBinder.java42
-rw-r--r--jetty-centralized-logging/src/main/java/org/slf4j/impl/StaticMarkerBinder.java44
-rw-r--r--jetty-centralized-logging/src/test/artifacts/.gitignore9
-rw-r--r--jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/MavenTestingUtils.java178
-rw-r--r--jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/PathAssert.java40
-rw-r--r--jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/CentralMDCAdapterTest.java87
-rw-r--r--jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/ConfiguredLoggerTest.java283
-rw-r--r--jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/SeverityTest.java28
-rw-r--r--jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/TestAppender.java174
31 files changed, 0 insertions, 4255 deletions
diff --git a/jetty-centralized-logging/.gitignore b/jetty-centralized-logging/.gitignore
deleted file mode 100644
index 9c65b190a8..0000000000
--- a/jetty-centralized-logging/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-target/
-.classpath
-.project
-.settings
-*.swp
-*.patch
-*.diff
-*.log
-cobertura.ser
diff --git a/jetty-centralized-logging/docs/jetty_centralized_logging.png b/jetty-centralized-logging/docs/jetty_centralized_logging.png
deleted file mode 100644
index aa7111c1fe..0000000000
--- a/jetty-centralized-logging/docs/jetty_centralized_logging.png
+++ /dev/null
Binary files differ
diff --git a/jetty-centralized-logging/docs/jetty_centralized_logging.svg b/jetty-centralized-logging/docs/jetty_centralized_logging.svg
deleted file mode 100644
index 31b08862b8..0000000000
--- a/jetty-centralized-logging/docs/jetty_centralized_logging.svg
+++ /dev/null
@@ -1,853 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="976"
- height="776"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.46"
- sodipodi:docname="jetty_centralized_logging.svg"
- inkscape:output_extension="org.inkscape.output.svg.inkscape"
- version="1.0"
- inkscape:export-filename="/home/joakim/code/webtide/jetty7-git/sandbox/jetty-centralized-logging/docs/jetty_centralized_logging.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90">
- <defs
- id="defs4">
- <marker
- inkscape:stockid="Arrow2Lstart"
- orient="auto"
- refY="0"
- refX="0"
- id="Arrow2Lstart"
- style="overflow:visible">
- <path
- id="path3260"
- style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
- d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.97309,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z"
- transform="matrix(1.1,0,0,1.1,1.1,0)" />
- </marker>
- <marker
- inkscape:stockid="Arrow2Lend"
- orient="auto"
- refY="0"
- refX="0"
- id="Arrow2Lend"
- style="overflow:visible">
- <path
- id="path3263"
- style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
- d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.97309,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z"
- transform="matrix(-1.1,0,0,-1.1,-1.1,0)" />
- </marker>
- <marker
- inkscape:stockid="Arrow1Lend"
- orient="auto"
- refY="0"
- refX="0"
- id="Arrow1Lend"
- style="overflow:visible">
- <path
- id="path3245"
- d="M 0,0 L 5,-5 L -12.5,0 L 5,5 L 0,0 z"
- style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
- transform="matrix(-0.8,0,0,-0.8,-10,0)" />
- </marker>
- <inkscape:perspective
- sodipodi:type="inkscape:persp3d"
- inkscape:vp_x="0 : 526.18109 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_z="744.09448 : 526.18109 : 1"
- inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
- id="perspective10" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.98994949"
- inkscape:cx="457.39199"
- inkscape:cy="414.74052"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="true"
- inkscape:window-width="1920"
- inkscape:window-height="1151"
- inkscape:window-x="0"
- inkscape:window-y="0"
- showguides="true"
- inkscape:guide-bbox="true"
- inkscape:snap-bbox="true"
- inkscape:object-nodes="true"
- inkscape:bbox-paths="true"
- inkscape:bbox-nodes="true">
- <inkscape:grid
- type="xygrid"
- id="grid3199"
- visible="true"
- enabled="true"
- spacingx="5px"
- spacingy="5px"
- dotted="false" />
- </sodipodi:namedview>
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(0.5,10.5)">
- <rect
- style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect8520"
- width="975"
- height="775"
- x="0"
- y="-10" />
- <rect
- style="fill:#fadcb5;fill-opacity:1;stroke:#000000;stroke-width:1.00000012;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect8424"
- width="148.95634"
- height="59.432926"
- x="566.04364"
- y="605" />
- <rect
- y="446.35019"
- x="566.04364"
- height="138.59357"
- width="148.95634"
- id="rect8400"
- style="fill:#fdefdc;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <rect
- style="fill:#b2d8fa;fill-opacity:1;stroke:#000000;stroke-width:0.99999994;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect8207"
- width="149"
- height="119.2994"
- x="75.5"
- y="190.50002" />
- <rect
- style="fill:#65b0f4;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect3193"
- width="148.95634"
- height="48.956337"
- x="75.521828"
- y="90.521828" />
- <text
- xml:space="preserve"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="109.91553"
- y="120.71484"
- id="text3195"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan3197"
- x="109.91553"
- y="120.71484">Webapp</tspan></text>
- <g
- id="g8225"
- transform="translate(4.3651352,5.780426)">
- <rect
- y="194.21957"
- x="80.634865"
- height="48.974144"
- width="59.500004"
- id="rect3207"
- style="fill:#65b0f4;fill-opacity:1;stroke:#000000;stroke-width:1.00000012;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <text
- xml:space="preserve"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="92.064064"
- y="223.91661"
- id="text3203"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan3205"
- x="92.064064"
- y="223.91661">Log</tspan></text>
- </g>
- <text
- xml:space="preserve"
- style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="155"
- y="220"
- id="text3225"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- x="155"
- y="220"
- id="tspan3229">log4j.jar</tspan></text>
- <path
- style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow2Lstart);marker-mid:none;marker-end:none;stroke-opacity:1"
- d="M 225,235 C 324.93709,225.87435 322.50253,126.37925 225,115"
- id="path3233"
- sodipodi:nodetypes="cc" />
- <text
- sodipodi:linespacing="100%"
- id="text8195"
- y="175"
- x="240"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="175"
- x="240"
- sodipodi:role="line"
- id="tspan8199">provides</tspan></text>
- <path
- sodipodi:nodetypes="cc"
- id="path8203"
- d="M 110.56289,198.03968 L 110.56289,139.98412"
- style="fill:#1616f0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow2Lstart);marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <text
- xml:space="preserve"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="115"
- y="170"
- id="text8221"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan8223"
- x="115"
- y="170">Emit Log</tspan></text>
- <text
- sodipodi:linespacing="100%"
- id="text8230"
- y="275"
- x="85"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="275"
- x="85"
- id="tspan8232"
- sodipodi:role="line">Logger Configuration</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="85"
- y="295"
- id="text8234"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan8236"
- x="85"
- y="295">Log Appender</tspan></text>
- <path
- style="fill:#1616f0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow2Lstart);marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 111.57304,328.38173 L 111.57304,249.97416"
- id="path8238"
- sodipodi:nodetypes="cc" />
- <rect
- y="330"
- x="75"
- height="48.974144"
- width="149.5"
- id="rect8242"
- style="fill:#65b0f4;fill-opacity:1;stroke:#000000;stroke-width:1.00000012;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <text
- xml:space="preserve"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="111.89453"
- y="360.2019"
- id="text8244"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan8246"
- x="111.89453"
- y="360.2019">Log File</tspan></text>
- <g
- id="g8341">
- <rect
- style="fill:#fab5b5;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect8251"
- width="148.95634"
- height="68.956329"
- x="75.5"
- y="400.54364" />
- <text
- xml:space="preserve"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="93.044579"
- y="432.27179"
- id="text8253"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan8255"
- x="93.044579"
- y="432.27179">Webapp</tspan><tspan
- id="tspan8257"
- sodipodi:role="line"
- x="93.044579"
- y="454.27179">Classloader</tspan></text>
- </g>
- <g
- id="g8336">
- <rect
- y="490.32645"
- x="75.543655"
- height="49.173546"
- width="148.95634"
- id="rect8259"
- style="fill:#fab5b5;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <text
- sodipodi:linespacing="100%"
- id="text8261"
- y="520.23596"
- x="95.021828"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="520.23596"
- x="95.021828"
- sodipodi:role="line"
- id="tspan8265">Jetty Server</tspan></text>
- </g>
- <rect
- y="190.50003"
- x="401"
- height="118.99996"
- width="149"
- id="rect8269"
- style="fill:#b2d8fa;fill-opacity:1;stroke:#000000;stroke-width:0.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <rect
- y="90.521835"
- x="401.02182"
- height="48.956337"
- width="148.95634"
- id="rect8271"
- style="fill:#65b0f4;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <text
- sodipodi:linespacing="100%"
- id="text8273"
- y="120.71484"
- x="475.38721"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:100%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="120.71484"
- x="475.38721"
- id="tspan8275"
- sodipodi:role="line">Webapp A</tspan></text>
- <g
- transform="translate(329.86514,5.7804336)"
- id="g8277">
- <rect
- style="fill:#65b0f4;fill-opacity:1;stroke:#000000;stroke-width:1.00000012;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect8279"
- width="59.500004"
- height="48.974144"
- x="80.634865"
- y="194.21957" />
- <text
- sodipodi:linespacing="100%"
- id="text8281"
- y="223.91661"
- x="92.064064"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="223.91661"
- x="92.064064"
- id="tspan8283"
- sodipodi:role="line">Log</tspan></text>
- </g>
- <text
- sodipodi:linespacing="100%"
- id="text8285"
- y="220"
- x="480.5"
- style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- id="tspan8287"
- y="220"
- x="480.5"
- sodipodi:role="line">log4j</tspan></text>
- <path
- sodipodi:nodetypes="cc"
- id="path8289"
- d="M 550,215 C 650,227.14286 640,310 640,365"
- style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow2Lstart);marker-mid:none;marker-end:none;stroke-opacity:1" />
- <text
- xml:space="preserve"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="578.81055"
- y="291.63672"
- id="text8291"
- sodipodi:linespacing="100%"><tspan
- id="tspan8293"
- sodipodi:role="line"
- x="578.81055"
- y="291.63672">provides</tspan></text>
- <path
- style="fill:#1616f0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow2Lstart);marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 436.06289,198.03969 L 436.06289,139.98413"
- id="path8295"
- sodipodi:nodetypes="cc" />
- <text
- sodipodi:linespacing="100%"
- id="text8297"
- y="170"
- x="440.5"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="170"
- x="440.5"
- id="tspan8299"
- sodipodi:role="line">Emit Log</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="578.1712"
- y="465"
- id="text8301"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan8303"
- x="578.1712"
- y="465">Log Routing Classes</tspan></text>
- <rect
- style="fill:#fadcb5;fill-opacity:1;stroke:#000000;stroke-width:1.00000012;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect8311"
- width="149.5"
- height="48.974144"
- x="565.5"
- y="680" />
- <text
- sodipodi:linespacing="100%"
- id="text8313"
- y="710.2019"
- x="602.39453"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="710.2019"
- x="602.39453"
- id="tspan8315"
- sodipodi:role="line">Log File</tspan></text>
- <g
- id="g8432"
- transform="translate(-4.3670654e-2,0)">
- <rect
- y="365.5"
- x="400.54367"
- height="68.956329"
- width="148.95634"
- id="rect8317"
- style="fill:#fab5b5;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <text
- sodipodi:linespacing="100%"
- id="text8319"
- y="397.22815"
- x="474.56531"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:100%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="397.22815"
- x="474.56531"
- id="tspan8321"
- sodipodi:role="line">Webapp</tspan><tspan
- y="419.22815"
- x="474.56531"
- sodipodi:role="line"
- id="tspan8323">Classloader</tspan></text>
- </g>
- <g
- id="g8331"
- transform="translate(-4.3670654e-2,-35.04364)">
- <rect
- style="fill:#fab5b5;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect8325"
- width="148.95634"
- height="49.173546"
- x="401.04367"
- y="490.32645" />
- <text
- xml:space="preserve"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="420.52182"
- y="520.23596"
- id="text8327"
- sodipodi:linespacing="100%"><tspan
- id="tspan8329"
- sodipodi:role="line"
- x="420.52182"
- y="520.23596">Jetty Server</tspan></text>
- </g>
- <path
- sodipodi:nodetypes="cc"
- id="path8364"
- d="M 550,202.14286 C 649.93709,193.01721 647.50253,126.37925 550,115"
- style="opacity:0.33333333;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow2Lstart);marker-mid:none;marker-end:none;stroke-opacity:1" />
- <text
- xml:space="preserve"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#ff1919;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans Bold"
- x="613.06055"
- y="150.63672"
- id="text8366"
- sodipodi:linespacing="100%"><tspan
- id="tspan8368"
- sodipodi:role="line"
- x="613.06055"
- y="150.63672">DISABLED</tspan></text>
- <text
- sodipodi:linespacing="100%"
- id="text8370"
- y="190"
- x="600"
- style="font-size:32px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#ff1919;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans Bold"
- xml:space="preserve"><tspan
- y="190"
- x="600"
- sodipodi:role="line"
- id="tspan8372">X</tspan></text>
- <g
- id="g8386"
- transform="translate(5.5,0.5)">
- <rect
- y="365"
- x="560"
- height="69.5"
- width="149"
- id="rect8374"
- style="fill:#fadcb5;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <text
- sodipodi:linespacing="100%"
- id="text8376"
- y="394.46484"
- x="634.76318"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:100%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="394.46484"
- x="634.76318"
- id="tspan8378"
- sodipodi:role="line">Centralized</tspan><tspan
- id="tspan8380"
- y="416.46484"
- x="634.76318"
- sodipodi:role="line">Logging</tspan></text>
- </g>
- <text
- sodipodi:linespacing="100%"
- id="text8402"
- y="630.44061"
- x="640.70197"
- style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:100%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="630.44061"
- x="640.70197"
- id="tspan8404"
- sodipodi:role="line">Global slf4J</tspan><tspan
- y="648.44061"
- x="640.70197"
- sodipodi:role="line"
- id="tspan8426">Configuration</tspan></text>
- <rect
- rx="14.324922"
- ry="14.324921"
- y="475.5"
- x="571.04364"
- height="28.649841"
- width="138.45636"
- id="rect8406"
- style="fill:#fadcb5;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <text
- sodipodi:linespacing="100%"
- id="text8408"
- y="494.14984"
- x="585"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="494.14984"
- x="585"
- sodipodi:role="line"
- id="tspan8410">slf4j-log4j.jar</tspan></text>
- <rect
- style="fill:#fadcb5;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect8412"
- width="138.45636"
- height="28.649841"
- x="571.54364"
- y="510"
- ry="14.324921"
- rx="14.324922" />
- <text
- xml:space="preserve"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="585.5"
- y="528.64984"
- id="text8414"
- sodipodi:linespacing="100%"><tspan
- id="tspan8416"
- sodipodi:role="line"
- x="585.5"
- y="528.64984">slf4j-clogging.jar</tspan></text>
- <rect
- rx="14.324922"
- ry="14.324921"
- y="545"
- x="571.54364"
- height="28.649841"
- width="138.45636"
- id="rect8418"
- style="fill:#fadcb5;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <text
- sodipodi:linespacing="100%"
- id="text8420"
- y="563.64984"
- x="585.5"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="563.64984"
- x="585.5"
- sodipodi:role="line"
- id="tspan8422">slf4j-julogging.jar</tspan></text>
- <path
- sodipodi:nodetypes="ccccc"
- id="path8309"
- d="M 580,680 L 580,605 C 540,600 545,490 575,480 C 550,470 550,380 590,365 C 535,345 445.35714,313.92857 440,250"
- style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow2Lstart);marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <text
- sodipodi:linespacing="100%"
- id="text8428"
- y="334.86328"
- x="523.81055"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="334.86328"
- x="523.81055"
- sodipodi:role="line"
- id="tspan8430">route</tspan></text>
- <rect
- style="fill:#b2d8fa;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect8438"
- width="149"
- height="119.0218"
- x="730.5"
- y="190.4782" />
- <rect
- style="fill:#65b0f4;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect8440"
- width="148.95634"
- height="48.956337"
- x="730.52185"
- y="90.5" />
- <text
- xml:space="preserve"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:100%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="804.88721"
- y="120.69299"
- id="text8442"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan8444"
- x="804.88721"
- y="120.69299">Webapp B</tspan></text>
- <g
- id="g8446"
- transform="translate(724.86513,5.780426)">
- <rect
- y="194.21957"
- x="80.634865"
- height="48.974144"
- width="59.500004"
- id="rect8448"
- style="fill:#65b0f4;fill-opacity:1;stroke:#000000;stroke-width:1.00000012;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <text
- xml:space="preserve"
- style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="92.064064"
- y="223.91661"
- id="text8450"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan8452"
- x="92.064064"
- y="223.91661">Log</tspan></text>
- </g>
- <text
- xml:space="preserve"
- style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="745.59766"
- y="218.67578"
- id="text8454"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- x="745.59766"
- y="218.67578"
- id="tspan8456">j.u.log</tspan></text>
- <path
- sodipodi:nodetypes="cc"
- id="path8458"
- d="M 839.30406,198.51189 L 839.30406,140.45633"
- style="fill:#1616f0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow2Lstart);marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- <text
- xml:space="preserve"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="778.63965"
- y="170.31543"
- id="text8460"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan8462"
- x="778.63965"
- y="170.31543">Emit Log</tspan></text>
- <path
- style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow2Lstart);marker-mid:none;marker-end:none;stroke-opacity:1"
- d="M 730,215 C 630,227.14286 640,310 640,365"
- id="path8464"
- sodipodi:nodetypes="cc" />
- <text
- sodipodi:linespacing="100%"
- id="text8466"
- y="290"
- x="650"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="290"
- x="650"
- sodipodi:role="line"
- id="tspan8468">provides</tspan></text>
- <path
- style="opacity:0.33333333;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow2Lstart);marker-mid:none;marker-end:none;stroke-opacity:1"
- d="M 729.54267,202.64286 C 629.60558,193.51721 632.04014,126.87925 729.54267,115.5"
- id="path8470"
- sodipodi:nodetypes="cc" />
- <text
- xml:space="preserve"
- style="font-size:32px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#ff1919;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans Bold"
- x="655"
- y="190"
- id="text8476"
- sodipodi:linespacing="100%"><tspan
- id="tspan8478"
- sodipodi:role="line"
- x="655"
- y="190">X</tspan></text>
- <path
- style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow2Lstart);marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 700,680 L 700,605 C 740,600 740,565 710,555 C 735,545 730,380 690,365 C 745,345 834.64286,313.92857 840,250"
- id="path8480"
- sodipodi:nodetypes="ccccc" />
- <text
- xml:space="preserve"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="720"
- y="335"
- id="text8482"
- sodipodi:linespacing="100%"><tspan
- id="tspan8484"
- sodipodi:role="line"
- x="720"
- y="335">route</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;opacity:0.49099103;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="408.63965"
- y="271.63672"
- id="text8486"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan8488"
- x="408.63965"
- y="271.63672">Logger Configuration</tspan></text>
- <text
- sodipodi:linespacing="100%"
- id="text8490"
- y="291.63672"
- x="408.63965"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;opacity:0.49099103;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="291.63672"
- x="408.63965"
- id="tspan8492"
- sodipodi:role="line">Log Appender</tspan></text>
- <text
- sodipodi:linespacing="100%"
- id="text8494"
- y="486.4751"
- x="274.09787"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#ff1919;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans Bold"
- xml:space="preserve"
- transform="matrix(0.8770636,-0.4803743,0.4803743,0.8770636,0,0)"><tspan
- y="486.4751"
- x="274.09787"
- sodipodi:role="line"
- id="tspan8496">DISABLED</tspan></text>
- <text
- sodipodi:linespacing="100%"
- id="text8498"
- y="271.63672"
- x="738.63965"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;opacity:0.49099103;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- xml:space="preserve"><tspan
- y="271.63672"
- x="738.63965"
- id="tspan8500"
- sodipodi:role="line">Logger Configuration</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;opacity:0.49099103;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
- x="738.63965"
- y="291.63672"
- id="text8502"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan8504"
- x="738.63965"
- y="291.63672">Log Appender</tspan></text>
- <text
- transform="matrix(0.8770636,-0.4803743,0.4803743,0.8770636,0,0)"
- xml:space="preserve"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#ff1919;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Droid Sans;-inkscape-font-specification:Droid Sans Bold"
- x="518.89191"
- y="620.5506"
- id="text8506"
- sodipodi:linespacing="100%"><tspan
- id="tspan8508"
- sodipodi:role="line"
- x="518.89191"
- y="620.5506">DISABLED</tspan></text>
- <path
- style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 350,15 L 350,740"
- id="path8510"
- sodipodi:nodetypes="cc" />
- <text
- xml:space="preserve"
- style="font-size:24px;font-style:oblique;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold Oblique"
- x="53.538086"
- y="51.832302"
- id="text8512"
- sodipodi:linespacing="100%"><tspan
- sodipodi:role="line"
- id="tspan8514"
- x="53.538086"
- y="51.832302">Traditional Logging</tspan></text>
- <text
- sodipodi:linespacing="100%"
- id="text8516"
- y="50.822147"
- x="500"
- style="font-size:24px;font-style:oblique;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold Oblique"
- xml:space="preserve"><tspan
- y="50.822147"
- x="500"
- id="tspan8518"
- sodipodi:role="line">Centralized Logging</tspan></text>
- </g>
-</svg>
diff --git a/jetty-centralized-logging/pom.xml b/jetty-centralized-logging/pom.xml
deleted file mode 100644
index 208b99c046..0000000000
--- a/jetty-centralized-logging/pom.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-// ========================================================================
-// Copyright (c) Webtide LLC
-//
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-project</artifactId>
- <version>7.0.1-SNAPSHOT</version>
- </parent>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-centralized-logging</artifactId>
- <name>Jetty :: Centralized Logging</name>
- <packaging>jar</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>config.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.5.6</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <version>1.5.6</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>log4j-over-slf4j</artifactId>
- <version>1.5.6</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-project-info-reports-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jxr-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>cobertura-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </reporting>
-
- <profiles>
- <profile>
- <id>copy-fresh-webapps</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-testing-wars</id>
- <phase>validate</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.eclipse.jetty.tests</groupId>
- <artifactId>dummy-webapp-logging-commons</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </artifactItem>
- <artifactItem>
- <groupId>org.eclipse.jetty.tests</groupId>
- <artifactId>dummy-webapp-logging-java</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </artifactItem>
- <artifactItem>
- <groupId>org.eclipse.jetty.tests</groupId>
- <artifactId>dummy-webapp-logging-log4j</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </artifactItem>
- <artifactItem>
- <groupId>org.eclipse.jetty.tests</groupId>
- <artifactId>dummy-webapp-logging-slf4j</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${basedir}/src/test/resources/webapps</outputDirectory>
- <overWriteIfNewer>true</overWriteIfNewer>
- <stripVersion>true</stripVersion>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/jetty-centralized-logging/src/main/config/etc/jetty-centralized-logging.properties b/jetty-centralized-logging/src/main/config/etc/jetty-centralized-logging.properties
deleted file mode 100644
index 0e9f94d0c1..0000000000
--- a/jetty-centralized-logging/src/main/config/etc/jetty-centralized-logging.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-root.level=INFO
-root.appenders=roll
-
-appender.roll.class=org.eclipse.jetty.logging.impl.RollingFileAppender
-appender.roll.filename=${jetty.home}/logs/central.log
-appender.roll.append=true
-appender.roll.retainDays=120
-
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/Appender.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/Appender.java
deleted file mode 100644
index f99ddac4d5..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/Appender.java
+++ /dev/null
@@ -1,37 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import java.io.IOException;
-import java.util.Date;
-
-/**
- * Appender for log content.
- */
-public interface Appender
-{
- void setId(String id);
-
- String getId();
-
- void append(Date date, Severity severity, String name, String message, Throwable t) throws IOException;
-
- void setProperty(String key, String value) throws Exception;
-
- void open() throws IOException;
-
- void close() throws IOException;
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralLogger.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralLogger.java
deleted file mode 100644
index 0d5585ebc7..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralLogger.java
+++ /dev/null
@@ -1,246 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import java.io.IOException;
-import java.util.Date;
-
-import org.slf4j.helpers.MarkerIgnoringBase;
-import org.slf4j.helpers.MessageFormatter;
-
-/**
- * Centralized Logger implementation.
- */
-public class CentralLogger extends MarkerIgnoringBase
-{
- private static final long serialVersionUID = 385001265755850685L;
- private Severity level = Severity.INFO;
- private String name;
- private Appender appenders[];
-
- protected CentralLogger(String name, Appender appenders[], Severity severity)
- {
- this.name = name;
- this.appenders = appenders;
- this.level = severity;
- }
-
- private void log(Severity severity, String message, Throwable t)
- {
- if (!level.isEnabled(severity))
- {
- // Don't log level
- return;
- }
-
- Date now = new Date();
-
- for (Appender appender : appenders)
- {
- try
- {
- appender.append(now,severity,name,message,t);
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
- }
-
- private void logFormatted(Severity severity, String format, Object arg)
- {
- if (!level.isEnabled(severity))
- {
- // Don't log level
- return;
- }
- String msg = MessageFormatter.format(format,arg);
- log(severity,msg,null);
- }
-
- private void logFormatted(Severity severity, String format, Object arg1, Object arg2)
- {
- if (!level.isEnabled(severity))
- {
- // Don't log level
- return;
- }
- String msg = MessageFormatter.format(format,arg1,arg2);
- log(severity,msg,null);
- }
-
- private void logFormatted(Severity severity, String format, Object[] argArray)
- {
- if (!level.isEnabled(severity))
- {
- // Don't log level
- return;
- }
- String msg = MessageFormatter.arrayFormat(format,argArray);
- log(severity,msg,null);
- }
-
- public void debug(String msg)
- {
- log(Severity.DEBUG,msg,null);
- }
-
- public void debug(String format, Object arg)
- {
- logFormatted(Severity.DEBUG,format,arg);
- }
-
- public void debug(String format, Object arg1, Object arg2)
- {
- logFormatted(Severity.DEBUG,format,arg1,arg2);
- }
-
- public void debug(String format, Object[] argArray)
- {
- logFormatted(Severity.DEBUG,format,argArray);
- }
-
- public void debug(String msg, Throwable t)
- {
- log(Severity.DEBUG,msg,t);
- }
-
- public void error(String msg)
- {
- log(Severity.ERROR,msg,null);
- }
-
- public void error(String format, Object arg)
- {
- logFormatted(Severity.ERROR,format,arg);
- }
-
- public void error(String format, Object arg1, Object arg2)
- {
- logFormatted(Severity.ERROR,format,arg1,arg2);
- }
-
- public void error(String format, Object[] argArray)
- {
- logFormatted(Severity.ERROR,format,argArray);
- }
-
- public void error(String msg, Throwable t)
- {
- log(Severity.ERROR,msg,t);
- }
-
- public void info(String msg)
- {
- log(Severity.INFO,msg,null);
- }
-
- public void info(String format, Object arg)
- {
- logFormatted(Severity.INFO,format,arg);
- }
-
- public void info(String format, Object arg1, Object arg2)
- {
- logFormatted(Severity.INFO,format,arg1,arg2);
- }
-
- public void info(String format, Object[] argArray)
- {
- logFormatted(Severity.INFO,format,argArray);
- }
-
- public void info(String msg, Throwable t)
- {
- log(Severity.INFO,msg,t);
- }
-
- public boolean isDebugEnabled()
- {
- return level.isEnabled(Severity.DEBUG);
- }
-
- public boolean isErrorEnabled()
- {
- return level.isEnabled(Severity.ERROR);
- }
-
- public boolean isInfoEnabled()
- {
- return level.isEnabled(Severity.INFO);
- }
-
- public boolean isTraceEnabled()
- {
- return level.isEnabled(Severity.TRACE);
- }
-
- public boolean isWarnEnabled()
- {
- return level.isEnabled(Severity.WARN);
- }
-
- public void trace(String msg)
- {
- log(Severity.TRACE,msg,null);
- }
-
- public void trace(String format, Object arg)
- {
- logFormatted(Severity.TRACE,format,arg);
- }
-
- public void trace(String format, Object arg1, Object arg2)
- {
- logFormatted(Severity.TRACE,format,arg1,arg2);
- }
-
- public void trace(String format, Object[] argArray)
- {
- logFormatted(Severity.TRACE,format,argArray);
- }
-
- public void trace(String msg, Throwable t)
- {
- log(Severity.TRACE,msg,t);
- }
-
- public void warn(String msg)
- {
- log(Severity.WARN,msg,null);
- }
-
- public void warn(String format, Object arg)
- {
- logFormatted(Severity.WARN,format,arg);
- }
-
- public void warn(String format, Object arg1, Object arg2)
- {
- logFormatted(Severity.WARN,format,arg1,arg2);
- }
-
- public void warn(String format, Object[] argArray)
- {
- logFormatted(Severity.WARN,format,argArray);
- }
-
- public void warn(String msg, Throwable t)
- {
- log(Severity.WARN,msg,t);
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralLoggerConfig.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralLoggerConfig.java
deleted file mode 100644
index cac0b32cfb..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralLoggerConfig.java
+++ /dev/null
@@ -1,424 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.slf4j.Logger;
-
-/**
- * Represents the CentralLoggerConfig
- */
-public class CentralLoggerConfig
-{
- private static String between(String line, String start, String end)
- {
- if (line.startsWith(start) && line.endsWith(end))
- {
- return line.substring(start.length(),line.length() - end.length());
- }
- return null;
- }
-
- private static void configureAppender(Properties props, String id, Appender appender)
- {
- appender.setId(id);
-
- // Collect configuration fields for appender id
- Pattern appenderIdRegex = Pattern.compile("^appender\\." + id + "\\.([^\\.]*)$");
- Matcher match;
-
- @SuppressWarnings("unchecked")
- Enumeration<String> enNames = (Enumeration<String>)props.propertyNames();
- while (enNames.hasMoreElements())
- {
- String name = enNames.nextElement();
- match = appenderIdRegex.matcher(name);
- if (match.matches())
- {
- String fieldName = match.group(1);
- if (fieldName.equals("class"))
- {
- continue; // Not meant to be set.
- }
-
- String value = props.getProperty(name);
-
- try
- {
- appender.setProperty(fieldName,value);
- }
- catch (Exception e)
- {
- System.err.printf("Unable to set property %s on appender %s to %s%n",fieldName,appender.getClass().getName(),value);
- e.printStackTrace(System.err);
- }
- }
- }
- }
-
- private static void dumpDetails(PrintStream out, String prefix, CentralLoggerConfig cl)
- {
- out.printf("%sName: %s%n",prefix,cl.name);
- out.printf("%sLevel: %s%n",prefix,cl.level.name());
- out.printf("%sAppenders: ",prefix);
- for (Iterator<Appender> it = cl.getAppenders().iterator(); it.hasNext();)
- {
- Appender ap = it.next();
- // out.printf("(%s) %s",ap.getClass().getSimpleName(),ap);
- out.print(ap);
- if (it.hasNext())
- {
- out.print(", ");
- }
- }
- out.println();
- if (cl.children != null)
- {
- out.printf("%sChildren.count: %d%n",prefix,cl.children.size());
- String childPrefix = prefix + " ";
- for (Map.Entry<String, CentralLoggerConfig> entry : cl.children.entrySet())
- {
- out.printf("%sChild[%s]%n",prefix,entry.getKey());
- dumpDetails(out,childPrefix,entry.getValue());
- }
- }
- else
- {
- out.printf("%sChildren: <null>%n",prefix);
- }
- }
-
- private static Set<String> getAppenderIds(Properties props, String key)
- {
- Set<String> ids = new TreeSet<String>();
-
- String value = props.getProperty(key);
- if (value == null)
- {
- return ids;
- }
-
- String parts[] = value.split(",");
- for (int i = 0, n = parts.length; i < n; i++)
- {
- ids.add(parts[i].trim());
- }
-
- return ids;
- }
-
- private static List<Appender> getAppenders(Properties props, String key, Map<String, Appender> declaredAppenders)
- {
- Set<String> ids = getAppenderIds(props,key);
- List<Appender> appenders = new ArrayList<Appender>();
- for (String id : ids)
- {
- if (declaredAppenders.containsKey(id))
- {
- appenders.add(declaredAppenders.get(id));
- }
- else
- {
- System.err.println("No such Appender: " + id);
- }
- }
-
- return appenders;
- }
-
- private static Map<String, Appender> getDeclaredAppenders(Properties props)
- {
- Set<String> ids = new TreeSet<String>();
-
- // Collect IDs
- Pattern appenderIdRegex = Pattern.compile("appender\\.([^\\.]*).class");
- Matcher match;
-
- @SuppressWarnings("unchecked")
- Enumeration<String> enNames = (Enumeration<String>)props.propertyNames();
- while (enNames.hasMoreElements())
- {
- String name = enNames.nextElement();
- match = appenderIdRegex.matcher(name);
- if (match.matches())
- {
- ids.add(match.group(1));
- }
- }
-
- Map<String, Appender> appenders = new HashMap<String, Appender>();
-
- if (ids.isEmpty())
- {
- return appenders;
- }
-
- // Instantiate > Configure > Open the Appenders
- for (String id : ids)
- {
- String clazzName = props.getProperty("appender." + id + ".class");
- if (clazzName == null)
- {
- continue; // skip
- }
-
- try
- {
- // Instantiate Appender
- Class<?> clazzAppender = Class.forName(clazzName);
- Appender appender = (Appender)clazzAppender.newInstance();
-
- // Configure Appender
- configureAppender(props,id,appender);
-
- // Open Appender
- appender.open();
-
- appenders.put(id,appender);
- }
- catch (ClassNotFoundException e)
- {
- System.err.println("Unable to find class: " + clazzName);
- e.printStackTrace(System.err);
- }
- catch (InstantiationException e)
- {
- System.err.println("Unable to Instantiate: " + clazzName);
- e.printStackTrace(System.err);
- }
- catch (IllegalAccessException e)
- {
- System.err.println("Unable to Access: " + clazzName);
- e.printStackTrace(System.err);
- }
- catch (IOException e)
- {
- System.err.println("Unable to open Appender: " + clazzName);
- e.printStackTrace(System.err);
- }
- }
-
- return appenders;
- }
-
- public static CentralLoggerConfig load(InputStream stream) throws IOException
- {
- Properties props = new Properties();
- props.load(stream);
- return load(props);
- }
-
- public static CentralLoggerConfig load(Properties props) throws IOException
- {
- CentralLoggerConfig root = new CentralLoggerConfig(Logger.ROOT_LOGGER_NAME);
-
- // Default for root
- root.level = Severity.INFO;
-
- // Collect all possible appenders, by id.
- Map<String, Appender> declaredAppenders = getDeclaredAppenders(props);
-
- root.appenders = getAppenders(props,"root.appenders",declaredAppenders);
- if (root.appenders.isEmpty())
- {
- // Default (if not specified for root)
- root.appenders.add(new ConsoleAppender());
- }
-
- // Set logger & level of ROOT
- root.logger = new CentralLogger(root.name,root.appenders.toArray(new Appender[] {}),root.level);
- root.level = Severity.valueOf(props.getProperty("root.level"));
-
- // Collect other configured loggers
- Set<String> ids = new TreeSet<String>(); // Use TreeSet to get sort order that we need.
-
- @SuppressWarnings("unchecked")
- Enumeration<String> enNames = (Enumeration<String>)props.propertyNames();
- while (enNames.hasMoreElements())
- {
- String name = enNames.nextElement();
- String id = between(name,"logger.",".level");
- if (id == null)
- {
- id = between(name,"logger.",".appenders");
- if (id == null)
- {
- continue; // not something we care about
- }
- }
-
- ids.add(id);
- }
-
- // Set loggers & levels of OTHER nodes
- for (String id : ids)
- {
- CentralLoggerConfig childlog = root.getConfiguredLogger(id);
- childlog.level = Severity.valueOf(props.getProperty("logger." + id + ".level","INFO"));
- Set<String> appenderIds = getAppenderIds(props,"logger." + id + ".appenders");
- for (String appenderId : appenderIds)
- {
- if (appenderId.startsWith("-"))
- {
- // Remove an appender
- childlog.removeAppenderById(appenderId.substring(1));
- }
- else
- {
- // Add an appender
- if (declaredAppenders.containsKey(appenderId))
- {
- childlog.addAppender(declaredAppenders.get(appenderId));
- }
- else
- {
- System.err.println("No such Appender: " + appenderId);
- }
- }
- }
- }
-
- return root;
- }
-
- private String name;
- private List<Appender> appenders = new ArrayList<Appender>();
- private Severity level;
- private CentralLogger logger;
- private Map<String, CentralLoggerConfig> children;
-
- private CentralLoggerConfig(CentralLoggerConfig copyLogger, String name)
- {
- if (copyLogger.name.equals(CentralLogger.ROOT_LOGGER_NAME))
- {
- this.name = name;
- }
- else
- {
- this.name = copyLogger.name + "." + name;
- }
-
- this.appenders.addAll(copyLogger.appenders);
- this.level = copyLogger.level;
- this.logger = new CentralLogger(this.name,appenders.toArray(new Appender[] {}),level);
- }
-
- private CentralLoggerConfig(String name)
- {
- this.name = name;
- }
-
- private void addAppender(Appender appender)
- {
- getAppenders().add(appender);
- }
-
- private void removeAppenderById(String id)
- {
- ListIterator<Appender> it = appenders.listIterator();
- while (it.hasNext())
- {
- Appender appender = it.next();
- if (id.equals(appender.getId()))
- {
- it.remove();
- }
- }
- }
-
- public void dumpTree(PrintStream out)
- {
- dumpDetails(out,"",this);
- }
-
- public Appender findAppender(Class<? extends Appender> clazz)
- {
- for (Appender appender : appenders)
- {
- if (clazz.isAssignableFrom(appender.getClass()))
- {
- return appender;
- }
- }
- return null;
- }
-
- public List<Appender> getAppenders()
- {
- return appenders;
- }
-
- private CentralLoggerConfig getChildLogger(String name)
- {
- CentralLoggerConfig child = getChildren().get(name);
- if (child == null)
- {
- child = new CentralLoggerConfig(this,name);
- this.children.put(name,child);
- }
- return child;
- }
-
- public Map<String, CentralLoggerConfig> getChildren()
- {
- if (children == null)
- {
- children = new HashMap<String, CentralLoggerConfig>();
- }
- return children;
- }
-
- public CentralLoggerConfig getConfiguredLogger(String name)
- {
- String parts[] = name.split("\\.");
- CentralLoggerConfig ret = this;
- for (String part : parts)
- {
- ret = ret.getChildLogger(part);
- }
- return ret;
- }
-
- public Severity getLevel()
- {
- return level;
- }
-
- public CentralLogger getLogger()
- {
- return logger;
- }
-
- public String getName()
- {
- return name;
- }
-} \ No newline at end of file
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralLoggerFactory.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralLoggerFactory.java
deleted file mode 100644
index 3099f72817..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralLoggerFactory.java
+++ /dev/null
@@ -1,60 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.slf4j.ILoggerFactory;
-import org.slf4j.Logger;
-
-/**
- * The Logger Factory for CentralLoggers.
- */
-public class CentralLoggerFactory implements ILoggerFactory
-{
- private CentralLoggerConfig root;
- private Map<String, CentralLogger> loggers;
-
- public CentralLoggerFactory(CentralLoggerConfig root)
- {
- this.root = root;
- this.loggers = new HashMap<String, CentralLogger>();
- JavaUtilLoggingRouting.init();
- }
-
- public void setRoot(CentralLoggerConfig root)
- {
- this.root = root;
- this.loggers.clear();
- }
-
- public Logger getLogger(String name)
- {
- CentralLogger ret = null;
- synchronized (this)
- {
- ret = loggers.get(name);
- if (ret == null)
- {
- CentralLoggerConfig clogger = root.getConfiguredLogger(name);
- ret = clogger.getLogger();
- loggers.put(name,ret);
- }
- }
- return ret;
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralMDC.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralMDC.java
deleted file mode 100644
index d1d84b9cb8..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralMDC.java
+++ /dev/null
@@ -1,201 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class CentralMDC
-{
- private final static CentralMDC mdc = new CentralMDC();
- private ThreadLocalMap local;
-
- private CentralMDC()
- {
- local = new ThreadLocalMap();
- }
-
- public static void put(String key, String value)
- {
- if (mdc == null)
- {
- return;
- }
- mdc.internalPut(key,value);
- }
-
- private void internalPut(String key, String value)
- {
- if (local == null)
- {
- return;
- }
-
- HashMap<String, String> map = local.get();
- if (map == null)
- {
- map = new HashMap<String, String>();
- local.set(map);
- }
- map.put(key,value);
- }
-
- public static String get(String key)
- {
- if (mdc == null)
- {
- return null;
- }
-
- return mdc.internalGet(key);
- }
-
- private String internalGet(String key)
- {
- if (local == null)
- {
- return null;
- }
-
- if (key == null)
- {
- return null;
- }
-
- HashMap<String, String> map = local.get();
- if (map == null)
- {
- return null;
- }
- return map.get(key);
- }
-
- public static void remove(String key)
- {
- if (mdc == null)
- {
- return;
- }
-
- mdc.internalRemove(key);
- }
-
- private void internalRemove(String key)
- {
- if (local == null)
- {
- return;
- }
-
- if (key == null)
- {
- return;
- }
-
- HashMap<String, String> map = local.get();
- if (map == null)
- {
- return;
- }
-
- map.remove(key);
- }
-
- public static void clear()
- {
- if (mdc == null)
- {
- return;
- }
-
- mdc.internalClear();
- }
-
- private void internalClear()
- {
- if (local == null)
- {
- return;
- }
-
- HashMap<String, String> map = local.get();
- if (map == null)
- {
- return;
- }
-
- map.clear();
- }
-
- public static Map<String, String> getContextMap()
- {
- if (mdc == null)
- {
- return null;
- }
-
- return mdc.internalGetContextMap();
- }
-
- private Map<String, String> internalGetContextMap()
- {
- if (local == null)
- {
- return null;
- }
-
- HashMap<String, String> map = local.get();
- if (map == null)
- {
- return null;
- }
-
- Map<String, String> copy = new HashMap<String, String>();
- copy.putAll(map);
-
- return copy;
- }
-
- public static void setContextMap(Map<String, String> contextMap)
- {
- if (mdc == null)
- {
- return;
- }
-
- mdc.internalSetContextMap(contextMap);
- }
-
- private void internalSetContextMap(Map<String, String> contextMap)
- {
- if (local == null)
- {
- return;
- }
-
- HashMap<String, String> map = local.get();
- if (map == null)
- {
- map = new HashMap<String, String>();
- local.set(map);
- }
- else
- {
- map.clear();
- }
- map.putAll(contextMap);
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralMDCAdapter.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralMDCAdapter.java
deleted file mode 100644
index 956692e765..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/CentralMDCAdapter.java
+++ /dev/null
@@ -1,56 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import java.util.Map;
-
-import org.slf4j.spi.MDCAdapter;
-
-public class CentralMDCAdapter implements MDCAdapter
-{
-
- public void clear()
- {
- CentralMDC.clear();
- }
-
- public String get(String key)
- {
- return CentralMDC.get(key);
- }
-
- @SuppressWarnings("unchecked")
- public Map getCopyOfContextMap()
- {
- return CentralMDC.getContextMap();
- }
-
- public void put(String key, String value)
- {
- CentralMDC.put(key,value);
- }
-
- public void remove(String key)
- {
- CentralMDC.remove(key);
- }
-
- @SuppressWarnings("unchecked")
- public void setContextMap(Map contextMap)
- {
- CentralMDC.setContextMap(contextMap);
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/ConsoleAppender.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/ConsoleAppender.java
deleted file mode 100644
index 1f0fac6414..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/ConsoleAppender.java
+++ /dev/null
@@ -1,118 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import java.io.IOException;
-import java.util.Date;
-
-/**
- * Standard Appender to the STDOUT Console
- */
-public class ConsoleAppender implements Appender
-{
- private Formatter formatter;
- private String id;
-
- public void append(Date date, Severity severity, String name, String message, Throwable t)
- {
- System.out.println(getFormatter().format(date,severity,name,message));
- if (t != null)
- {
- t.printStackTrace(System.out);
- }
- System.out.flush();
- }
-
- public void close() throws IOException
- {
- /* nothing to do here */
- }
-
- public Formatter getFormatter()
- {
- if (formatter == null)
- {
- formatter = new DefaultFormatter();
- }
- return formatter;
- }
-
- public String getId()
- {
- return id;
- }
-
- public void open() throws IOException
- {
- /* nothing to do here */
- }
-
- public void setFormatter(Formatter formatter)
- {
- this.formatter = formatter;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- public void setProperty(String key, String value) throws Exception
- {
- if ("formatter".equals(key))
- {
- setFormatter(value);
- return;
- }
- }
-
- private void setFormatter(String classname)
- {
- try
- {
- Class<?> clazz = Class.forName(classname);
- if (Formatter.class.isAssignableFrom(clazz))
- {
- setFormatter((Formatter)clazz.newInstance());
- }
- else
- {
- System.err.println("Does not implement " + Formatter.class.getName() + " : " + classname);
- }
- }
- catch (ClassNotFoundException e)
- {
- System.err.println("Cannot find formatter: " + classname);
- e.printStackTrace(System.err);
- }
- catch (InstantiationException e)
- {
- System.err.println("Cannot instantiate formatter: " + classname);
- e.printStackTrace(System.err);
- }
- catch (IllegalAccessException e)
- {
- System.err.println("Cannot instantiate formatter: " + classname);
- e.printStackTrace(System.err);
- }
- }
-
- @Override
- public String toString()
- {
- return "ConsoleAppender[" + id + "]";
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/DefaultFormatter.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/DefaultFormatter.java
deleted file mode 100644
index 4426ef2c36..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/DefaultFormatter.java
+++ /dev/null
@@ -1,47 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Default log output formatter.
- */
-public class DefaultFormatter implements Formatter
-{
- private String dateFormat = "yyyy-MM-dd HH:mm:ss.SSS";
-
- public String format(Date date, Severity severity, String name, String message)
- {
- StringBuffer buf = new StringBuffer();
- buf.append(new SimpleDateFormat(dateFormat).format(date));
- buf.append(':').append(severity.name()).append(':');
- buf.append(name);
- buf.append(':').append(message);
- return buf.toString();
- }
-
- public String getDateFormat()
- {
- return dateFormat;
- }
-
- public void setDateFormat(String dateFormat)
- {
- this.dateFormat = dateFormat;
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/Formatter.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/Formatter.java
deleted file mode 100644
index 8f82c44a76..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/Formatter.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.eclipse.jetty.logging.impl;
-
-import java.util.Date;
-
-public interface Formatter
-{
- String format(Date date, Severity severity, String name, String message);
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/JavaUtilLoggingRouting.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/JavaUtilLoggingRouting.java
deleted file mode 100644
index 062f686884..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/JavaUtilLoggingRouting.java
+++ /dev/null
@@ -1,163 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Setup Routing in {@link java.util.logging.LogManager} to Centralized Logger.
- */
-public class JavaUtilLoggingRouting
-{
- public static void init()
- {
- // Get root logger.
- java.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger("");
-
- // Remove all existing Handlers.
- for (java.util.logging.Handler handler : rootLogger.getHandlers())
- {
- rootLogger.removeHandler(handler);
- }
-
- // Add our only handler.
- rootLogger.addHandler(new java.util.logging.Handler()
- {
- @Override
- public void close() throws SecurityException
- {
- /* do nothing */
- }
-
- @Override
- public void flush()
- {
- /* do nothing */
- }
-
- @Override
- public void publish(java.util.logging.LogRecord record)
- {
- org.slf4j.Logger slf4jLogger = getCentralLogger(record);
-
- int javaLevel = record.getLevel().intValue();
-
- // TRACE?
- if (javaLevel <= java.util.logging.Level.FINEST.intValue())
- {
- if (slf4jLogger.isTraceEnabled())
- {
- String message = formatMessage(record);
- slf4jLogger.trace(message,record.getThrown());
- }
- return;
- }
-
- // DEBUG?
- if (javaLevel <= java.util.logging.Level.FINE.intValue())
- {
- if (slf4jLogger.isDebugEnabled())
- {
- String message = formatMessage(record);
- slf4jLogger.debug(message,record.getThrown());
- }
- return;
- }
-
- // INFO?
- if (javaLevel <= java.util.logging.Level.INFO.intValue())
- {
- if (slf4jLogger.isInfoEnabled())
- {
- String message = formatMessage(record);
- slf4jLogger.info(message,record.getThrown());
- }
- return;
- }
-
- // WARN?
- if (javaLevel <= java.util.logging.Level.WARNING.intValue())
- {
- if (slf4jLogger.isWarnEnabled())
- {
- String message = formatMessage(record);
- slf4jLogger.warn(message,record.getThrown());
- }
- return;
- }
-
- // All others are ERROR
- if (slf4jLogger.isErrorEnabled())
- {
- String message = formatMessage(record);
- slf4jLogger.error(message,record.getThrown());
- }
- }
-
- private String formatMessage(java.util.logging.LogRecord record)
- {
- // Cand be raw freeform message, or resource bundle key, or null
- String raw = record.getMessage();
-
- // Null? (easy)
- if (raw == null)
- {
- return null;
- }
-
- // Try using resource bundle
- ResourceBundle bundle = record.getResourceBundle();
- if (bundle != null)
- {
- try
- {
- raw = bundle.getString(raw);
- }
- catch (MissingResourceException e)
- {
- /* ignore */
- }
- }
-
- // Now blend in any (optional) parameters
- // Normally we would do this in the slf4j interface,
- // but that lacks the ability to do a formatted message
- // and a throwable at the same time.
- if (record.getParameters() != null)
- {
- raw = MessageFormat.format(raw,record.getParameters());
- }
-
- return raw;
- }
-
- private org.slf4j.Logger getCentralLogger(java.util.logging.LogRecord record)
- {
- String name = record.getLoggerName();
- if (name == null)
- {
- name = "anonymous";
- }
- return org.slf4j.LoggerFactory.getLogger(name);
- }
- });
-
- // Tweak levels.
- rootLogger.setLevel(java.util.logging.Level.ALL);
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/PropertyExpansion.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/PropertyExpansion.java
deleted file mode 100644
index d23b3d79f3..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/PropertyExpansion.java
+++ /dev/null
@@ -1,45 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-/**
- * Basic System Property string expansion "${user.home}"
- */
-public class PropertyExpansion
-{
- public static String expand(String s)
- {
- int i1 = 0;
- int i2 = 0;
-
- i1 = 0;
- i2 = 0;
- while (s != null)
- {
- i1 = s.indexOf("${",i2);
- if (i1 < 0)
- break;
- i2 = s.indexOf("}",i1 + 2);
- if (i2 < 0)
- break;
- String name = s.substring(i1 + 2,i2);
- String property = System.getProperty(name,"${" + name + "}");
- s = s.substring(0,i1) + property + s.substring(i2 + 1);
- }
-
- return s;
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/RollingFileAppender.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/RollingFileAppender.java
deleted file mode 100644
index 27e75b60d3..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/RollingFileAppender.java
+++ /dev/null
@@ -1,249 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.Date;
-import java.util.TimeZone;
-
-import org.eclipse.jetty.logging.impl.io.RolloverFileOutputStream;
-
-/**
- * Rolling File Appender
- */
-public class RollingFileAppender implements Appender
-{
- private RolloverFileOutputStream fileout;
- private PrintStream out;
- private String filename;
- private File file;
- private boolean append = true;
- private int retainDays = 31;
- private TimeZone zone = TimeZone.getDefault();
- private String dateFormat = "yyyy_MM_dd";
- private String backupFormat = "HHmmssSSS";
- private String id;
- private Formatter formatter;
-
- public void append(Date date, Severity severity, String name, String message, Throwable t) throws IOException
- {
- out.println(getFormatter().format(date,severity,name,message));
- if (t != null)
- {
- t.printStackTrace(out);
- }
- out.flush();
- }
-
- public void close() throws IOException
- {
- fileout.close();
- out.close();
- }
-
- public String getBackupFormat()
- {
- return backupFormat;
- }
-
- public String getDateFormat()
- {
- return dateFormat;
- }
-
- public File getFile()
- {
- return file;
- }
-
- public String getFilename()
- {
- return filename;
- }
-
- public Formatter getFormatter()
- {
- if (formatter == null)
- {
- formatter = new DefaultFormatter();
- }
- return formatter;
- }
-
- public String getId()
- {
- return id;
- }
-
- public int getRetainDays()
- {
- return retainDays;
- }
-
- public TimeZone getZone()
- {
- return zone;
- }
-
- public boolean isAppend()
- {
- return append;
- }
-
- public void open() throws IOException
- {
- file = new File(PropertyExpansion.expand(filename));
-
- File logDir = file.getParentFile();
- if (!logDir.exists())
- {
- throw new FileNotFoundException("Logging directory does not exist: " + logDir);
- }
-
- if (!logDir.isDirectory())
- {
- throw new FileNotFoundException("Logging path exist, but is not a directory: " + logDir);
- }
-
- fileout = new RolloverFileOutputStream(file.getAbsolutePath(),append,retainDays,zone,dateFormat,backupFormat);
- out = new PrintStream(fileout);
- }
-
- public void setAppend(boolean append)
- {
- this.append = append;
- }
-
- public void setBackupFormat(String backupFormat)
- {
- this.backupFormat = backupFormat;
- }
-
- public void setDateFormat(String dateFormat)
- {
- this.dateFormat = dateFormat;
- }
-
- public void setFilename(String filename)
- {
- this.filename = filename;
- }
-
- public void setFormatter(Formatter formatter)
- {
- this.formatter = formatter;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- public void setProperty(String key, String value) throws Exception
- {
- if ("filename".equals(key))
- {
- setFilename(value);
- return;
- }
-
- if ("append".equals(key))
- {
- setAppend(Boolean.parseBoolean(value));
- return;
- }
-
- if ("retainDays".equals(key))
- {
- setRetainDays(Integer.parseInt(value));
- return;
- }
-
- if ("zone".equals(key))
- {
- setZone(TimeZone.getTimeZone(value));
- return;
- }
-
- if ("dateFormat".equals(key))
- {
- setDateFormat(value);
- return;
- }
-
- if ("backupFormat".equals(key))
- {
- setBackupFormat(value);
- return;
- }
-
- if ("formatter".equals(key))
- {
- setFormatter(value);
- return;
- }
- }
-
- private void setFormatter(String classname)
- {
- try
- {
- Class<?> clazz = Class.forName(classname);
- if (Formatter.class.isAssignableFrom(clazz))
- {
- setFormatter((Formatter)clazz.newInstance());
- }
- else
- {
- System.err.println("Does not implement " + Formatter.class.getName() + " : " + classname);
- }
- }
- catch (ClassNotFoundException e)
- {
- System.err.println("Cannot find formatter: " + classname);
- e.printStackTrace(System.err);
- }
- catch (InstantiationException e)
- {
- System.err.println("Cannot instantiate formatter: " + classname);
- e.printStackTrace(System.err);
- }
- catch (IllegalAccessException e)
- {
- System.err.println("Cannot instantiate formatter: " + classname);
- e.printStackTrace(System.err);
- }
- }
-
- public void setRetainDays(int retainDays)
- {
- this.retainDays = retainDays;
- }
-
- public void setZone(TimeZone zone)
- {
- this.zone = zone;
- }
-
- @Override
- public String toString()
- {
- return "RollingFileAppender[" + id + "|" + filename + "]";
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/Severity.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/Severity.java
deleted file mode 100644
index f36f6f568c..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/Severity.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-
-package org.eclipse.jetty.logging.impl;
-
-public enum Severity
-{
- TRACE, DEBUG, INFO, WARN, ERROR;
-
- public boolean isEnabled(Severity severity)
- {
- return (severity.ordinal() >= ordinal());
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/ThreadLocalMap.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/ThreadLocalMap.java
deleted file mode 100644
index 0f40a44dec..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/ThreadLocalMap.java
+++ /dev/null
@@ -1,35 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import java.util.HashMap;
-
-final public class ThreadLocalMap extends InheritableThreadLocal<HashMap<String, String>>
-{
- @Override
- @SuppressWarnings("unchecked")
- protected HashMap<String, String> childValue(HashMap<String, String> parentValue)
- {
- if (parentValue != null)
- {
- return (HashMap<String, String>)parentValue.clone();
- }
- else
- {
- return null;
- }
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/io/LogIO.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/io/LogIO.java
deleted file mode 100644
index a7cd2bcbb1..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/io/LogIO.java
+++ /dev/null
@@ -1,119 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl.io;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.Reader;
-import java.io.StringWriter;
-import java.io.Writer;
-
-/**
- * Simplified IO for logging reasons only.
- */
-public class LogIO
-{
- public static void close(InputStream stream)
- {
- try
- {
- if (stream != null)
- stream.close();
- }
- catch (IOException ignore)
- {
- /* ignore */
- }
- }
-
- public static void close(OutputStream stream)
- {
- try
- {
- if (stream != null)
- stream.close();
- }
- catch (IOException ignore)
- {
- /* ignore */
- }
- }
-
- public static void close(Reader reader)
- {
- try
- {
- if (reader != null)
- reader.close();
- }
- catch (IOException ignore)
- {
- /* ignore */
- }
- }
-
- public static void close(Writer writer)
- {
- try
- {
- if (writer != null)
- writer.close();
- }
- catch (IOException ignore)
- {
- /* ignore */
- }
- }
-
- public static void copy(Reader in, Writer out) throws IOException
- {
- final int bufferSize = 8096;
- char buffer[] = new char[bufferSize];
- int len = bufferSize;
-
- if (out instanceof PrintWriter)
- {
- PrintWriter pout = (PrintWriter)out;
- while (!pout.checkError())
- {
- len = in.read(buffer,0,bufferSize);
- if (len == -1)
- break;
- out.write(buffer,0,len);
- }
- }
- else
- {
- while (true)
- {
- len = in.read(buffer,0,bufferSize);
- if (len == -1)
- break;
- out.write(buffer,0,len);
- }
- }
- }
-
- public static String toString(Reader in) throws IOException
- {
- StringWriter writer = new StringWriter();
- copy(in,writer);
- return writer.toString();
- }
-
-}
diff --git a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/io/RolloverFileOutputStream.java b/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/io/RolloverFileOutputStream.java
deleted file mode 100644
index d54d248641..0000000000
--- a/jetty-centralized-logging/src/main/java/org/eclipse/jetty/logging/impl/io/RolloverFileOutputStream.java
+++ /dev/null
@@ -1,330 +0,0 @@
-// ========================================================================
-// Copyright (c) 2006-2009 Mort Bay Consulting Pty. Ltd.
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-// The Apache License v2.0 is available at
-// http://www.opensource.org/licenses/apache2.0.php
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-
-package org.eclipse.jetty.logging.impl.io;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.TimeZone;
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * Log specific RolloverFileOutputStream
- *
- * This output stream puts content in a file that is rolled over every 24 hours. The filename must include the string
- * "yyyy_mm_dd", which is replaced with the actual date when creating and rolling over the file.
- *
- * Old files are retained for a number of days before being deleted.
- */
-public class RolloverFileOutputStream extends FilterOutputStream
-{
- private static Timer __rollover;
-
- final static String YYYY_MM_DD="yyyy_mm_dd";
- final static String ROLLOVER_FILE_DATE_FORMAT = "yyyy_MM_dd";
- final static String ROLLOVER_FILE_BACKUP_FORMAT = "HHmmssSSS";
- final static int ROLLOVER_FILE_RETAIN_DAYS = 31;
-
- private RollTask _rollTask;
- private SimpleDateFormat _fileBackupFormat;
- private SimpleDateFormat _fileDateFormat;
-
- private String _filename;
- private File _file;
- private boolean _append;
- private int _retainDays;
-
- /* ------------------------------------------------------------ */
- /**
- * @param filename The filename must include the string "yyyy_mm_dd",
- * which is replaced with the actual date when creating and rolling over the file.
- * @throws IOException
- */
- public RolloverFileOutputStream(String filename)
- throws IOException
- {
- this(filename,true,ROLLOVER_FILE_RETAIN_DAYS);
- }
-
- /* ------------------------------------------------------------ */
- /**
- * @param filename The filename must include the string "yyyy_mm_dd",
- * which is replaced with the actual date when creating and rolling over the file.
- * @param append If true, existing files will be appended to.
- * @throws IOException
- */
- public RolloverFileOutputStream(String filename, boolean append)
- throws IOException
- {
- this(filename,append,ROLLOVER_FILE_RETAIN_DAYS);
- }
-
- /* ------------------------------------------------------------ */
- /**
- * @param filename The filename must include the string "yyyy_mm_dd",
- * which is replaced with the actual date when creating and rolling over the file.
- * @param append If true, existing files will be appended to.
- * @param retainDays The number of days to retain files before deleting them. 0 to retain forever.
- * @throws IOException
- */
- public RolloverFileOutputStream(String filename,
- boolean append,
- int retainDays)
- throws IOException
- {
- this(filename,append,retainDays,TimeZone.getDefault());
- }
-
- /* ------------------------------------------------------------ */
- /**
- * @param filename The filename must include the string "yyyy_mm_dd",
- * which is replaced with the actual date when creating and rolling over the file.
- * @param append If true, existing files will be appended to.
- * @param retainDays The number of days to retain files before deleting them. 0 to retain forever.
- * @throws IOException
- */
- public RolloverFileOutputStream(String filename,
- boolean append,
- int retainDays,
- TimeZone zone)
- throws IOException
- {
-
- this(filename,append,retainDays,zone,null,null);
- }
-
- /* ------------------------------------------------------------ */
- /**
- * @param filename The filename must include the string "yyyy_mm_dd",
- * which is replaced with the actual date when creating and rolling over the file.
- * @param append If true, existing files will be appended to.
- * @param retainDays The number of days to retain files before deleting them. 0 to retain forever.
- * @param dateFormat The format for the date file substitution. The default is "yyyy_MM_dd".
- * @param backupFormat The format for the file extension of backup files. The default is "HHmmssSSS".
- * @throws IOException
- */
- public RolloverFileOutputStream(String filename,
- boolean append,
- int retainDays,
- TimeZone zone,
- String dateFormat,
- String backupFormat)
- throws IOException
- {
- super(null);
-
- if (dateFormat==null)
- dateFormat=ROLLOVER_FILE_DATE_FORMAT;
- _fileDateFormat = new SimpleDateFormat(dateFormat);
-
- if (backupFormat==null)
- backupFormat=ROLLOVER_FILE_BACKUP_FORMAT;
- _fileBackupFormat = new SimpleDateFormat(backupFormat);
-
- _fileBackupFormat.setTimeZone(zone);
- _fileDateFormat.setTimeZone(zone);
-
- if (filename!=null)
- {
- filename=filename.trim();
- if (filename.length()==0)
- filename=null;
- }
- if (filename==null)
- throw new IllegalArgumentException("Invalid filename");
-
- _filename=filename;
- _append=append;
- _retainDays=retainDays;
- setFile();
-
- synchronized(RolloverFileOutputStream.class)
- {
- if (__rollover==null)
- __rollover=new Timer(RolloverFileOutputStream.class.getName(),true);
-
- _rollTask=new RollTask();
-
- Calendar now = Calendar.getInstance();
- now.setTimeZone(zone);
-
- GregorianCalendar midnight =
- new GregorianCalendar(now.get(Calendar.YEAR),
- now.get(Calendar.MONTH),
- now.get(Calendar.DAY_OF_MONTH),
- 23,0);
- midnight.setTimeZone(zone);
- midnight.add(Calendar.HOUR,1);
- __rollover.scheduleAtFixedRate(_rollTask,midnight.getTime(),1000L*60*60*24);
- }
- }
-
- /* ------------------------------------------------------------ */
- public String getFilename()
- {
- return _filename;
- }
-
- /* ------------------------------------------------------------ */
- public String getDatedFilename()
- {
- if (_file==null)
- return null;
- return _file.toString();
- }
-
- /* ------------------------------------------------------------ */
- public int getRetainDays()
- {
- return _retainDays;
- }
-
- /* ------------------------------------------------------------ */
- private synchronized void setFile()
- throws IOException
- {
- // Check directory
- File file = new File(_filename);
- _filename=file.getCanonicalPath();
- file=new File(_filename);
- File dir= new File(file.getParent());
- if (!dir.isDirectory() || !dir.canWrite())
- throw new IOException("Cannot write log directory "+dir);
-
- Date now=new Date();
-
- // Is this a rollover file?
- String filename=file.getName();
- int i=filename.toLowerCase().indexOf(YYYY_MM_DD);
- if (i>=0)
- {
- file=new File(dir,
- filename.substring(0,i)+
- _fileDateFormat.format(now)+
- filename.substring(i+YYYY_MM_DD.length()));
- }
-
- if (file.exists()&&!file.canWrite())
- throw new IOException("Cannot write log file "+file);
-
- // Do we need to change the output stream?
- if (out==null || !file.equals(_file))
- {
- // Yep
- _file=file;
- if (!_append && file.exists())
- file.renameTo(new File(file.toString()+"."+_fileBackupFormat.format(now)));
- OutputStream oldOut=out;
- out=new FileOutputStream(file.toString(),_append);
- if (oldOut!=null)
- oldOut.close();
- //if(log.isDebugEnabled())log.debug("Opened "+_file);
- }
- }
-
- /* ------------------------------------------------------------ */
- private void removeOldFiles()
- {
- if (_retainDays>0)
- {
- long now = System.currentTimeMillis();
-
- File file= new File(_filename);
- File dir = new File(file.getParent());
- String fn=file.getName();
- int s=fn.toLowerCase().indexOf(YYYY_MM_DD);
- if (s<0)
- return;
- String prefix=fn.substring(0,s);
- String suffix=fn.substring(s+YYYY_MM_DD.length());
-
- String[] logList=dir.list();
- for (int i=0;i<logList.length;i++)
- {
- fn = logList[i];
- if(fn.startsWith(prefix)&&fn.indexOf(suffix,prefix.length())>=0)
- {
- File f = new File(dir,fn);
- long date = f.lastModified();
- if ( ((now-date)/(1000*60*60*24))>_retainDays)
- f.delete();
- }
- }
- }
- }
-
- /* ------------------------------------------------------------ */
- @Override
- public void write (byte[] buf)
- throws IOException
- {
- out.write (buf);
- }
-
- /* ------------------------------------------------------------ */
- @Override
- public void write (byte[] buf, int off, int len)
- throws IOException
- {
- out.write (buf, off, len);
- }
-
- /* ------------------------------------------------------------ */
- /**
- */
- @Override
- public void close()
- throws IOException
- {
- synchronized(RolloverFileOutputStream.class)
- {
- try{super.close();}
- finally
- {
- out=null;
- _file=null;
- }
-
- _rollTask.cancel();
- }
- }
-
- /* ------------------------------------------------------------ */
- /* ------------------------------------------------------------ */
- /* ------------------------------------------------------------ */
- private class RollTask extends TimerTask
- {
- @Override
- public void run()
- {
- try
- {
- RolloverFileOutputStream.this.setFile();
- RolloverFileOutputStream.this.removeOldFiles();
-
- }
- catch(IOException e)
- {
- e.printStackTrace();
- }
- }
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/jetty-centralized-logging/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
deleted file mode 100644
index ce958fa6d3..0000000000
--- a/jetty-centralized-logging/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ /dev/null
@@ -1,187 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.slf4j.impl;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Properties;
-
-import org.eclipse.jetty.logging.impl.CentralLoggerConfig;
-import org.eclipse.jetty.logging.impl.CentralLoggerFactory;
-import org.eclipse.jetty.logging.impl.ConsoleAppender;
-import org.slf4j.ILoggerFactory;
-import org.slf4j.spi.LoggerFactoryBinder;
-
-/**
- * Standard entry point for Slf4J, used to configure the desired {@link ILoggerFactory}.
- */
-public class StaticLoggerBinder implements LoggerFactoryBinder
-{
- private static final String SYSPROP_CONFIG_KEY = "org.eclipse.jetty.logging.config.file";
-
- /**
- * Required by {@link org.slf4j.LoggerFactory}
- */
- private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder();
-
- /**
- * Required by {@link org.slf4j.LoggerFactory}
- */
- public static final StaticLoggerBinder getSingleton()
- {
- return SINGLETON;
- }
-
- /**
- * Required by {@link org.slf4j.LoggerFactory}, based on information from slf4j, this field should not be declared
- * final (it can cause problems with optimizations occurring within the java compiler)
- */
- public static/* final */String REQUESTED_API_VERSION = "1.5.6";
-
- private static final String loggerFactoryClassName = CentralLoggerFactory.class.getName();
- private CentralLoggerFactory loggerFactory;
- private CentralLoggerConfig root;
-
- public CentralLoggerConfig getRoot()
- {
- if(root == null) {
- try
- {
- Properties props = getConfigurationProperties();
- root = CentralLoggerConfig.load(props);
- }
- catch (IOException e)
- {
- e.printStackTrace(System.err);
- }
- }
- return root;
- }
-
- private Properties getConfigurationProperties()
- {
- String propertyFilename = System.getProperty(SYSPROP_CONFIG_KEY);
- if (propertyFilename != null)
- {
- System.out.printf("Found centralized-logging system property %s=%s%n",SYSPROP_CONFIG_KEY,propertyFilename);
- File file = new File(propertyFilename);
- if (file.exists() && file.isFile())
- {
- System.out.println("Loading centralized-logging configuration from file: " + file.getAbsolutePath());
- Properties props = new Properties();
- FileInputStream stream = null;
- try
- {
- stream = new FileInputStream(file);
- props.load(stream);
- return props;
- }
- catch (IOException e)
- {
- e.printStackTrace(System.err);
- }
- finally
- {
- closeStream(stream);
- }
- }
- else
- {
- System.out.println("Cannot find file: " + file.getAbsolutePath());
- }
- }
-
- URL resourceUrl = this.getClass().getResource("centralized-logging.properties");
- if (resourceUrl != null)
- {
- System.out.println("Loading centralized-logging configuration from resource URL: " + resourceUrl.toExternalForm());
- InputStream stream = null;
- try
- {
- stream = resourceUrl.openStream();
- Properties props = new Properties();
- props.load(stream);
- return props;
- }
- catch (IOException e)
- {
- e.printStackTrace(System.err);
- }
- finally
- {
- closeStream(stream);
- }
- }
-
- System.out.println("Using default centralized-logging configuration");
- return getDefaultProperties();
- }
-
- private void closeStream(InputStream stream)
- {
- if (stream != null)
- {
- try
- {
- stream.close();
- }
- catch (Throwable ignore)
- {
- /* ignore */
- }
- }
- }
-
- private Properties getDefaultProperties()
- {
- Properties props = new Properties();
- props.setProperty("root.level","DEBUG");
- props.setProperty("root.appenders","console");
- props.setProperty("appender.console.class",ConsoleAppender.class.getName());
- return props;
- }
-
- public void setRoot(CentralLoggerConfig root)
- {
- this.root = root;
- if (loggerFactory == null)
- {
- loggerFactory = new CentralLoggerFactory(root);
- }
- else
- {
- loggerFactory.setRoot(root);
- }
- }
-
- public ILoggerFactory getLoggerFactory()
- {
- if (loggerFactory == null)
- {
- loggerFactory = new CentralLoggerFactory(getRoot());
- }
-
- return loggerFactory;
- }
-
- public String getLoggerFactoryClassStr()
- {
- return loggerFactoryClassName;
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/slf4j/impl/StaticMDCBinder.java b/jetty-centralized-logging/src/main/java/org/slf4j/impl/StaticMDCBinder.java
deleted file mode 100644
index b214d9bbda..0000000000
--- a/jetty-centralized-logging/src/main/java/org/slf4j/impl/StaticMDCBinder.java
+++ /dev/null
@@ -1,42 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.slf4j.impl;
-
-import org.eclipse.jetty.logging.impl.CentralMDCAdapter;
-import org.slf4j.spi.MDCAdapter;
-
-/**
- * Standard entry point for Slf4J, used to configure the desired {@link MDCAdapter}.
- */
-public class StaticMDCBinder
-{
- public static final StaticMDCBinder SINGLETON = new StaticMDCBinder();
-
- private StaticMDCBinder()
- {
- /* prevent external instantiation */
- }
-
- public MDCAdapter getMDCA()
- {
- return new CentralMDCAdapter();
- }
-
- public String getMDCAdapterClassStr()
- {
- return CentralMDCAdapter.class.getName();
- }
-}
diff --git a/jetty-centralized-logging/src/main/java/org/slf4j/impl/StaticMarkerBinder.java b/jetty-centralized-logging/src/main/java/org/slf4j/impl/StaticMarkerBinder.java
deleted file mode 100644
index 4a621632fd..0000000000
--- a/jetty-centralized-logging/src/main/java/org/slf4j/impl/StaticMarkerBinder.java
+++ /dev/null
@@ -1,44 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.slf4j.impl;
-
-import org.slf4j.IMarkerFactory;
-import org.slf4j.MarkerFactory;
-import org.slf4j.helpers.BasicMarkerFactory;
-import org.slf4j.spi.MarkerFactoryBinder;
-
-/**
- * Standard entry point for Slf4J, used to configure the desired {@link IMarkerFactory}.
- */
-public class StaticMarkerBinder implements MarkerFactoryBinder
-{
- /**
- * Required by {@link MarkerFactory}
- */
- public static final StaticMarkerBinder SINGLETON = new StaticMarkerBinder();
-
- private final IMarkerFactory markerFactory = new BasicMarkerFactory();
-
- public IMarkerFactory getMarkerFactory()
- {
- return markerFactory;
- }
-
- public String getMarkerFactoryClassStr()
- {
- return markerFactory.getClass().getName();
- }
-}
diff --git a/jetty-centralized-logging/src/test/artifacts/.gitignore b/jetty-centralized-logging/src/test/artifacts/.gitignore
deleted file mode 100644
index 9c65b190a8..0000000000
--- a/jetty-centralized-logging/src/test/artifacts/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-target/
-.classpath
-.project
-.settings
-*.swp
-*.patch
-*.diff
-*.log
-cobertura.ser
diff --git a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/MavenTestingUtils.java b/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/MavenTestingUtils.java
deleted file mode 100644
index e3abc6d614..0000000000
--- a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/MavenTestingUtils.java
+++ /dev/null
@@ -1,178 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jetty.logging.impl.io.LogIO;
-
-/**
- * Common utility methods for working with JUnit tests cases in a maven friendly way.
- */
-public class MavenTestingUtils
-{
- private static File basedir;
- private static File testResourcesDir;
- private static File targetDir;
-
- public static File getBasedir()
- {
- if (basedir == null)
- {
- String cwd = System.getProperty("basedir");
-
- if (cwd == null)
- {
- cwd = System.getProperty("user.dir");
- }
-
- basedir = new File(cwd);
- }
-
- return basedir;
- }
-
- /**
- * Get the directory to the /target directory for this project.
- *
- * @return the directory path to the target directory.
- */
- public static File getTargetDir()
- {
- if (targetDir == null)
- {
- targetDir = new File(basedir,"target");
- PathAssert.assertDirExists("Target Dir",targetDir);
- }
- return targetDir;
- }
-
- /**
- * Create a {@link File} object for a path in the /target directory.
- *
- * @param path
- * the path desired, no validation of existence is performed.
- * @return the File to the path.
- */
- public static File getTargetFile(String path)
- {
- return new File(getTargetDir(),path.replace("/",File.separator));
- }
-
- public static File getTargetTestingDir()
- {
- File dir = new File(getTargetDir(),"testing");
- if (!dir.exists())
- {
- dir.mkdirs();
- }
- return dir;
- }
-
- public static File getTargetTestingDir(TestCase test)
- {
- File dir = new File(getTargetDir(),"test-" + test.getName());
- if (!dir.exists())
- {
- dir.mkdirs();
- }
- return dir;
- }
-
- /**
- * Get a dir from the src/test/resource directory.
- *
- * @param name
- * the name of the path to get (it must exist as a dir)
- * @return the dir in src/test/resource
- */
- public static File getTestResourceDir(String name)
- {
- File dir = new File(getTestResourcesDir(),name);
- PathAssert.assertDirExists("Test Resource Dir",dir);
- return dir;
- }
-
- /**
- * Get a file from the src/test/resource directory.
- *
- * @param name
- * the name of the path to get (it must exist as a file)
- * @return the file in src/test/resource
- */
- public static File getTestResourceFile(String name)
- {
- File file = new File(getTestResourcesDir(),name);
- PathAssert.assertFileExists("Test Resource File",file);
- return file;
- }
-
- /**
- * Get a path resource (File or Dir) from the src/test/resource directory.
- *
- * @param name
- * the name of the path to get (it must exist)
- * @return the path in src/test/resource
- */
- public static File getTestResourcePath(String name)
- {
- File path = new File(getTestResourcesDir(),name);
- PathAssert.assertExists("Test Resource Path",path);
- return path;
- }
-
- /**
- * Get the directory to the src/test/resource directory
- *
- * @return the directory {@link File} to the src/test/resources directory
- */
- public static File getTestResourcesDir()
- {
- if (testResourcesDir == null)
- {
- testResourcesDir = new File(basedir,"src/test/resources".replace("/",File.separator));
- PathAssert.assertDirExists("Test Resources Dir",testResourcesDir);
- }
- return testResourcesDir;
- }
-
- /**
- * Read the contents of a file into a String and return it.
- *
- * @param file
- * the file to read.
- * @return the contents of the file.
- * @throws IOException
- * if unable to read the file.
- */
- public static String readToString(File file) throws IOException
- {
- FileReader reader = null;
- try
- {
- reader = new FileReader(file);
- return LogIO.toString(reader);
- }
- finally
- {
- LogIO.close(reader);
- }
- }
-}
diff --git a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/PathAssert.java b/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/PathAssert.java
deleted file mode 100644
index b40778fdf2..0000000000
--- a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/PathAssert.java
+++ /dev/null
@@ -1,40 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging;
-
-import java.io.File;
-
-import junit.framework.Assert;
-
-public class PathAssert
-{
- public static void assertDirExists(String msg, File path)
- {
- assertExists(msg,path);
- Assert.assertTrue(msg + " path should be a Dir : " + path.getAbsolutePath(),path.isDirectory());
- }
-
- public static void assertFileExists(String msg, File path)
- {
- assertExists(msg,path);
- Assert.assertTrue(msg + " path should be a File : " + path.getAbsolutePath(),path.isFile());
- }
-
- public static void assertExists(String msg, File path)
- {
- Assert.assertTrue(msg + " path should exist: " + path.getAbsolutePath(),path.exists());
- }
-}
diff --git a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/CentralMDCAdapterTest.java b/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/CentralMDCAdapterTest.java
deleted file mode 100644
index d031cf5547..0000000000
--- a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/CentralMDCAdapterTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.eclipse.jetty.logging.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jetty.logging.impl.TestAppender.LogEvent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
-import org.slf4j.impl.StaticLoggerBinder;
-
-public class CentralMDCAdapterTest extends TestCase
-{
- public void testMDCInfo() throws Exception
- {
- // Setup Logger Config
- Properties props = new Properties();
- props.setProperty("root.level","DEBUG");
- props.setProperty("root.appenders","test");
- props.setProperty("appender.test.class",TestAppender.class.getName());
-
- CentralLoggerConfig root = CentralLoggerConfig.load(props);
- StaticLoggerBinder.getSingleton().setRoot(root);
-
- // Generate a few logging events.
- Logger logroot = LoggerFactory.getLogger("test.root");
- logroot.info("The Phoenix and the Turtle");
- logroot.info("Let the bird of loudest lay");
-
- MDC.put("mood","sad");
- MDC.put("animal","bird");
- Logger logtree = LoggerFactory.getLogger("test.root.tree");
- logtree.info("On the sole Arabian tree,");
- logtree.info("Herald sad and trumpet be,");
-
- MDC.put("mood","soaring");
- Logger logwings = LoggerFactory.getLogger("test.root.wings");
- logwings.info("To whose sound chaste wings obey.");
- logwings.info("But thou shrieking harbinger,");
- logwings.info("Foul precurrer of the fiend,");
-
- MDC.remove("animal");
- Logger logend = LoggerFactory.getLogger("test.root.end");
- logend.info("Augur of the fever's end,");
-
- MDC.clear();
- logend.info("To this troop come thou not near.");
-
- // Assert Events
- TestAppender testappender = (TestAppender)root.findAppender(TestAppender.class);
- List<LogEvent> captured = testappender.getEvents();
-
- List<String> expectedMessages = new ArrayList<String>();
- expectedMessages.add("The Phoenix and the Turtle");
- expectedMessages.add("Let the bird of loudest lay");
- expectedMessages.add("On the sole Arabian tree,");
- expectedMessages.add("Herald sad and trumpet be,");
- expectedMessages.add("To whose sound chaste wings obey.");
- expectedMessages.add("But thou shrieking harbinger,");
- expectedMessages.add("Foul precurrer of the fiend,");
- expectedMessages.add("Augur of the fever's end,");
- expectedMessages.add("To this troop come thou not near.");
-
- assertEquals("Captured Messages size",expectedMessages.size(),captured.size());
-
- List<String> expectedMdc = new ArrayList<String>();
- expectedMdc.add("");
- expectedMdc.add("");
- expectedMdc.add("animal=bird, mood=sad");
- expectedMdc.add("animal=bird, mood=sad");
- expectedMdc.add("animal=bird, mood=soaring");
- expectedMdc.add("animal=bird, mood=soaring");
- expectedMdc.add("animal=bird, mood=soaring");
- expectedMdc.add("mood=soaring");
- expectedMdc.add("");
-
- assertEquals("Captured MDC events size",expectedMdc.size(),captured.size());
-
- for(int i=0, n=expectedMessages.size(); i<n; i++) {
- assertEquals("Message[" + i + "]", expectedMessages.get(i), captured.get(i).message);
- assertEquals("MDC[" + i + "]", expectedMdc.get(i), captured.get(i).mdc);
- }
- }
-}
diff --git a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/ConfiguredLoggerTest.java b/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/ConfiguredLoggerTest.java
deleted file mode 100644
index 77650ffde2..0000000000
--- a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/ConfiguredLoggerTest.java
+++ /dev/null
@@ -1,283 +0,0 @@
-package org.eclipse.jetty.logging.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Properties;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jetty.logging.MavenTestingUtils;
-import org.slf4j.Logger;
-
-public class ConfiguredLoggerTest extends TestCase
-{
- private void assertAppenders(CentralLoggerConfig logger, Class<?>... clazzes)
- {
- assertNotNull("Appenders should not be null",logger.getAppenders());
- assertTrue("Should have appenders",logger.getAppenders().size() >= 1);
-
- List<String> expectedAppenders = new ArrayList<String>();
- List<String> actualAppenders = new ArrayList<String>();
-
- for (Class<?> clazz : clazzes)
- {
- expectedAppenders.add(clazz.getName());
- }
-
- for (Appender appender : logger.getAppenders())
- {
- actualAppenders.add(appender.getClass().getName());
- }
-
- // Sort
- Collections.sort(expectedAppenders);
- Collections.sort(actualAppenders);
-
- // Same Size?
- if (expectedAppenders.size() != actualAppenders.size())
- {
- System.out.println("/* Actual */");
- for (String name : actualAppenders)
- {
- System.out.println(name);
- }
- System.out.println("/* Expected */");
- for (String name : expectedAppenders)
- {
- System.out.println(name);
- }
- assertEquals("Appender count",expectedAppenders.size(),actualAppenders.size());
- }
-
- // Same Content?
- for (int i = 0, n = expectedAppenders.size(); i < n; i++)
- {
- assertEquals("Appender[" + i + "]",expectedAppenders.get(i),actualAppenders.get(i));
- }
- }
-
- private void assertAppendersById(CentralLoggerConfig logger, String... ids)
- {
- assertNotNull("Appenders should not be null",logger.getAppenders());
- assertTrue("Should have appenders",logger.getAppenders().size() >= 1);
-
- List<String> expectedAppenders = new ArrayList<String>();
- List<String> actualAppenders = new ArrayList<String>();
-
- for (String id : ids)
- {
- expectedAppenders.add(id);
- }
-
- for (Appender appender : logger.getAppenders())
- {
- actualAppenders.add(appender.getId());
- }
-
- // Sort
- Collections.sort(expectedAppenders);
- Collections.sort(actualAppenders);
-
- boolean same = true;
-
- // Same Size?
- if (expectedAppenders.size() != actualAppenders.size())
- {
- same = false;
- }
-
- // Same Content?
- for (int i = 0, n = expectedAppenders.size(); i < n; i++)
- {
- if (!expectedAppenders.get(i).equals(actualAppenders.get(i)))
- {
- same = false;
- break;
- }
- }
-
- if (!same)
- {
- System.out.println("/* Actual */");
- for (String id : actualAppenders)
- {
- System.out.println(id);
- }
- System.out.println("/* Expected */");
- for (String id : expectedAppenders)
- {
- System.out.println(id);
- }
- fail("Not the same appender id list.");
- }
-
- }
-
- private void assertSeverityLevel(CentralLoggerConfig logger, Severity severity)
- {
- assertEquals("Severity",severity,logger.getLevel());
- }
-
- public void testRootDebug() throws Exception
- {
- Properties props = new Properties();
- props.setProperty("root.level","DEBUG");
-
- CentralLoggerConfig root = CentralLoggerConfig.load(props);
- assertNotNull("Root Logger should not be null",root);
- assertSeverityLevel(root,Severity.DEBUG);
- assertAppenders(root,ConsoleAppender.class);
- }
-
- public void testRootTrace() throws Exception
- {
- Properties props = new Properties();
- props.setProperty("root.level","TRACE");
-
- CentralLoggerConfig root = CentralLoggerConfig.load(props);
- assertNotNull("Root Logger should not be null",root);
- assertSeverityLevel(root,Severity.TRACE);
- assertAppenders(root,ConsoleAppender.class);
- }
-
- public void testRootWarn() throws Exception
- {
- Properties props = new Properties();
- props.setProperty("root.level","WARN");
-
- CentralLoggerConfig root = CentralLoggerConfig.load(props);
- assertNotNull("Root Logger should not be null",root);
- assertSeverityLevel(root,Severity.WARN);
- assertAppenders(root,ConsoleAppender.class);
- }
-
- public void testSimpleConfig() throws Exception
- {
- Properties props = new Properties();
- props.setProperty("root.level","DEBUG");
-
- CentralLoggerConfig root = CentralLoggerConfig.load(props);
- assertNotNull("Root Logger should not be null",root);
- assertSeverityLevel(root,Severity.DEBUG);
- assertAppenders(root,ConsoleAppender.class);
- }
-
- public void testTestAppender() throws Exception
- {
- Properties props = new Properties();
- props.setProperty("root.level","DEBUG");
- props.setProperty("root.appenders","test");
- props.setProperty("appender.test.class",TestAppender.class.getName());
-
- CentralLoggerConfig root = CentralLoggerConfig.load(props);
- assertNotNull("Root Logger should not be null",root);
- assertSeverityLevel(root,Severity.DEBUG);
- assertAppenders(root,TestAppender.class);
- }
-
- public void testRollingFileAppender() throws Exception
- {
- Properties props = new Properties();
-
- File testLoggingDir = new File(MavenTestingUtils.getTargetTestingDir(this),"logs");
- testLoggingDir.mkdirs();
-
- System.setProperty("test.dir",testLoggingDir.getAbsolutePath());
-
- props.setProperty("root.level","DEBUG");
- props.setProperty("root.appenders","roll");
- props.setProperty("appender.roll.class",RollingFileAppender.class.getName());
- props.setProperty("appender.roll.filename","${test.dir}/rolling.log");
- props.setProperty("appender.roll.append","true");
- props.setProperty("appender.roll.retainDays","120");
- props.setProperty("appender.roll.zone","GMT");
- props.setProperty("appender.roll.dateFormat","yyyy-MM-dd");
- props.setProperty("appender.roll.backupFormat","HH-mm-ss.SSS");
- props.setProperty("appender.roll.formatter",DefaultFormatter.class.getName());
-
- CentralLoggerConfig root = CentralLoggerConfig.load(props);
- assertNotNull("Root Logger should not be null",root);
- assertSeverityLevel(root,Severity.DEBUG);
- assertAppenders(root,RollingFileAppender.class);
-
- File logFile = new File(testLoggingDir,"rolling.log");
-
- RollingFileAppender actualAppender = (RollingFileAppender)root.getAppenders().get(0);
- assertEquals("RollingFileAppender.filename",logFile.getAbsolutePath(),actualAppender.getFile().getAbsolutePath());
- assertEquals("RollingFileAppender.append",true,actualAppender.isAppend());
- assertEquals("RollingFileAppender.retainDays",120,actualAppender.getRetainDays());
- assertEquals("RollingFileAppender.zone","GMT",actualAppender.getZone().getID());
- assertEquals("RollingFileAppender.dateFormat","yyyy-MM-dd",actualAppender.getDateFormat());
- assertEquals("RollingFileAppender.backupFormat","HH-mm-ss.SSS",actualAppender.getBackupFormat());
- }
-
- public void testGetConfiguredLogger() throws IOException
- {
- Properties props = new Properties();
- props.setProperty("root.level","DEBUG");
- props.setProperty("root.appenders","console");
- props.setProperty("logger.org.eclipse.jetty.logging.level","WARN");
- props.setProperty("logger.org.eclipse.jetty.logging.appenders","test");
- props.setProperty("appender.test.class",TestAppender.class.getName());
- props.setProperty("appender.console.class",ConsoleAppender.class.getName());
-
- CentralLoggerConfig root = CentralLoggerConfig.load(props);
- assertNotNull("Root Logger should not be null",root);
- assertEquals("Root Logger.name",Logger.ROOT_LOGGER_NAME,root.getName());
- assertSeverityLevel(root,Severity.DEBUG);
- assertAppenders(root,ConsoleAppender.class);
-
- CentralLoggerConfig jettyLogger = root.getConfiguredLogger("org.eclipse.jetty");
- assertNotNull("Jetty Logger should not be null",jettyLogger);
- assertEquals("Jetty Logger.name","org.eclipse.jetty",jettyLogger.getName());
- assertSeverityLevel(jettyLogger,Severity.DEBUG);
- assertAppenders(jettyLogger,ConsoleAppender.class);
-
- CentralLoggerConfig implLogger = root.getConfiguredLogger("org.eclipse.jetty.logging.impl");
- assertNotNull("Jetty Logging Impl Logger should not be null",implLogger);
- assertEquals("Jetty Logging Impl Logger.name","org.eclipse.jetty.logging.impl",implLogger.getName());
- assertSeverityLevel(implLogger,Severity.WARN);
- assertAppenders(implLogger,ConsoleAppender.class,TestAppender.class);
- }
-
- public void testGetConfiguredLoggerNegativeAppender() throws IOException
- {
- File testLoggingDir = new File(MavenTestingUtils.getTargetTestingDir(this),"logs");
- testLoggingDir.mkdirs();
-
- System.setProperty("test.dir",testLoggingDir.getAbsolutePath());
-
- Properties props = new Properties();
- props.setProperty("root.level","DEBUG");
- props.setProperty("root.appenders","console,rollLog");
- props.setProperty("logger.AUDIT.level","INFO");
- props.setProperty("logger.AUDIT.appenders","-rollLog,auditLog");
-
- props.setProperty("appender.console.class",ConsoleAppender.class.getName());
- props.setProperty("appender.rollLog.class",RollingFileAppender.class.getName());
- props.setProperty("appender.rollLog.filename","${test.dir}/rolling.log");
- props.setProperty("appender.auditLog.class",RollingFileAppender.class.getName());
- props.setProperty("appender.auditLog.filename","${test.dir}/audit.log");
-
- CentralLoggerConfig root = CentralLoggerConfig.load(props);
- assertNotNull("Root Logger should not be null",root);
- assertEquals("Root Logger.name",Logger.ROOT_LOGGER_NAME,root.getName());
- assertSeverityLevel(root,Severity.DEBUG);
- assertAppendersById(root,"console","rollLog");
-
- CentralLoggerConfig jettyLogger = root.getConfiguredLogger("AUDIT");
- assertNotNull("Jetty Logger should not be null",jettyLogger);
- assertEquals("Jetty Logger.name","AUDIT",jettyLogger.getName());
- assertSeverityLevel(jettyLogger,Severity.INFO);
- assertAppendersById(jettyLogger,"console","auditLog");
-
- CentralLoggerConfig implLogger = root.getConfiguredLogger("AUDIT.some.thing.else");
- assertNotNull("Jetty Logging Impl Logger should not be null",implLogger);
- assertEquals("Jetty Logging Impl Logger.name","AUDIT.some.thing.else",implLogger.getName());
- assertSeverityLevel(implLogger,Severity.INFO);
- assertAppendersById(implLogger,"console","auditLog");
- }
-}
diff --git a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/SeverityTest.java b/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/SeverityTest.java
deleted file mode 100644
index dcf1563e27..0000000000
--- a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/SeverityTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import junit.framework.TestCase;
-
-public class SeverityTest extends TestCase
-{
- public void testIsEnabled()
- {
- assertTrue("DEBUG.isEnabled(INFO)",Severity.DEBUG.isEnabled(Severity.INFO));
- assertTrue("DEBUG.isEnabled(DEBUG)",Severity.DEBUG.isEnabled(Severity.DEBUG));
- assertFalse("DEBUG.isEnabled(TRACE)",Severity.DEBUG.isEnabled(Severity.TRACE));
- }
-}
diff --git a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/TestAppender.java b/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/TestAppender.java
deleted file mode 100644
index 33ca040a71..0000000000
--- a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/TestAppender.java
+++ /dev/null
@@ -1,174 +0,0 @@
-// ========================================================================
-// Copyright (c) Webtide LLC
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.apache.org/licenses/LICENSE-2.0.txt
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-package org.eclipse.jetty.logging.impl;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.slf4j.MDC;
-
-/**
- * Test Appender, records the logging events.
- */
-public class TestAppender implements Appender
-{
- public static class LogEvent
- {
- Date date;
- Severity severity;
- String name;
- String message;
- Throwable t;
- String mdc;
-
- @SuppressWarnings("unchecked")
- public LogEvent(Date date, Severity severity, String name, String message, Throwable t)
- {
- super();
- this.date = date;
- this.severity = severity;
- this.name = name;
- this.message = message;
- this.t = t;
- this.mdc = "";
-
- Map<String, String> mdcMap = MDC.getCopyOfContextMap();
- if (mdcMap != null)
- {
- Set<String> keys = new TreeSet<String>();
- keys.addAll(mdcMap.keySet());
- boolean delim = false;
- for (String key : keys)
- {
- if (delim)
- {
- mdc += ", ";
- }
- mdc += key + "=" + mdcMap.get(key);
- delim = true;
- }
- }
- }
-
- public LogEvent(Severity severity, String name, String message)
- {
- this(null,severity,name,message,null);
- }
-
- @Override
- public String toString()
- {
- StringBuffer buf = new StringBuffer();
- buf.append(severity.name()).append("|");
- buf.append(name).append("|");
- buf.append(message);
- return buf.toString();
- }
- }
-
- private List<LogEvent> events = new ArrayList<LogEvent>();
- private String id;
-
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- public void append(Date date, Severity severity, String name, String message, Throwable t)
- {
- if (name.equals("org.eclipse.jetty.util.log")) // standard jetty logger
- {
- if (t != null)
- {
- // Still interested in seeing throwables
- t.printStackTrace(System.err);
- }
- return; // skip storing it.
- }
- events.add(new LogEvent(date,severity,name,message,t));
- }
-
- public void close() throws IOException
- {
- /* nothing to do here */
- }
-
- public boolean contains(LogEvent expectedEvent)
- {
- // System.out.println("Looking for: " + expectedEvent);
- for (LogEvent event : events)
- {
- // System.out.println("Event: " + event);
- if (!event.name.equals(expectedEvent.name))
- {
- continue; // not a match. skip.
- }
- if (!event.severity.equals(expectedEvent.severity))
- {
- continue; // not a match. skip.
- }
- if (event.message.equals(expectedEvent.message))
- {
- return true;
- }
- }
- return false;
- }
-
- public List<LogEvent> getEvents()
- {
- return events;
- }
-
- public void open() throws IOException
- {
- /* nothing to do here */
- }
-
- public void reset()
- {
- events.clear();
- }
-
- public void setProperty(String key, String value) throws Exception
- {
- /* nothing to do here */
- }
-
- public void dump()
- {
- System.out.printf("Captured %s event(s)%n",events.size());
- for (LogEvent event : events)
- {
- System.out.println(event);
- }
- }
-
- public void setFormatter(Formatter formatter)
- {
- /* nothing to do here */
- }
-}

Back to the top