From c1dc03a44087cec86041d1bd00f1b2d42ca8c52b Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Sat, 7 Mar 2020 18:53:49 +0100 Subject: [PATCH 01/16] Issue #4443 - Track backport of ALPN APIs to Java 8 For Jetty 9.2.x, supporting the backport of the JDK ALPN APIs of JDK 8u252 would have required a number of backports from Jetty 9.4.x. Rather than doing all that work for an EOL Jetty branch, we instead excluded the modules/tests that required ALPN, so that the Jetty 9.2.x branch can still be built with 8u252 or later, but it will lack some of the artifacts. Users needing those artifacts are encouraged to move to Jetty 9.4.x or later. Signed-off-by: Simone Bordet --- .../alpn/client/ALPNClientConnection.java | 3 +++ .../alpn/server/ALPNServerConnection.java | 3 +++ .../jetty/client/HttpClientStreamTest.java | 3 +++ jetty-osgi/test-jetty-osgi/pom.xml | 11 +++----- jetty-spdy/pom.xml | 12 ++++----- jetty-start/pom.xml | 6 +++++ .../org/eclipse/jetty/start/LicenseTest.java | 4 +++ .../org/eclipse/jetty/start/MainTest.java | 2 ++ .../eclipse/jetty/start/SpdyTestGroup.java | 26 +++++++++++++++++++ .../org/eclipse/jetty/start/TestUseCases.java | 2 ++ 10 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 jetty-start/src/test/java/org/eclipse/jetty/start/SpdyTestGroup.java diff --git a/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnection.java b/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnection.java index b7781d7111d..7116b29192f 100644 --- a/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnection.java +++ b/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnection.java @@ -41,6 +41,9 @@ public class ALPNClientConnection extends NegotiatingClientConnection implements { super(endPoint, executor, sslEngine, connectionFactory, context); this.protocol = protocol; + // Client-side ALPN support is only available via Jetty ALPN API, so JDK 8u252 is not supported. + // Support for JDK 8u252 requires a TLS handshake listener so that when the TLS handshake is + // finished completed() can be called, but SslHandshakeListener is not backported to 9.2.x. ALPN.put(sslEngine, this); } diff --git a/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnection.java b/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnection.java index a472f32cbbd..767e3cfd2e5 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnection.java +++ b/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnection.java @@ -36,6 +36,9 @@ public class ALPNServerConnection extends NegotiatingServerConnection implements public ALPNServerConnection(Connector connector, EndPoint endPoint, SSLEngine engine, List protocols, String defaultProtocol) { super(connector, endPoint, engine, protocols, defaultProtocol); + // Server-side ALPN support is only available via Jetty ALPN API, so JDK 8u252 is not supported. + // Support for JDK 8u252 requires a TLS handshake listener so that when the TLS handshake is + // finished setProtocol() can be called, but SslHandshakeListener is not backported to 9.2.x. ALPN.put(engine, this); } diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientStreamTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientStreamTest.java index 45ab3756d93..feb30169dcc 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientStreamTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientStreamTest.java @@ -1027,6 +1027,9 @@ public class HttpClientStreamTest extends AbstractHttpClientServerTest public void testUploadWithConnectFailureClosesStream() throws Exception { start(new EmptyServerHandler()); + client.stop(); + client.setConnectTimeout(1000); + client.start(); final CountDownLatch closeLatch = new CountDownLatch(1); InputStream stream = new ByteArrayInputStream("test".getBytes(StandardCharsets.UTF_8)) diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml index dc8b432019c..06f17635843 100644 --- a/jetty-osgi/test-jetty-osgi/pom.xml +++ b/jetty-osgi/test-jetty-osgi/pom.xml @@ -302,12 +302,6 @@ ${project.version} test - - org.mortbay.jetty.alpn - alpn-boot - ${alpn.version} - test - org.eclipse.jetty.osgi jetty-osgi-alpn @@ -389,11 +383,14 @@ maven-surefire-plugin - + -Dmortbay-alpn-boot=${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.version}/alpn-boot-${alpn.version}.jar ${settings.localRepository} + + **/TestJettyOSGiBootSpdy.java + diff --git a/jetty-spdy/pom.xml b/jetty-spdy/pom.xml index 66cacfe3310..11941f1dbd3 100644 --- a/jetty-spdy/pom.xml +++ b/jetty-spdy/pom.xml @@ -21,19 +21,19 @@ spdy-http-server spdy-http-client-transport spdy-example-webapp - spdy-alpn-tests npn - - 1.7 - - + + + + alpn + + spdy-alpn-tests diff --git a/jetty-start/pom.xml b/jetty-start/pom.xml index 4264051ac0c..a3b0d271fa3 100644 --- a/jetty-start/pom.xml +++ b/jetty-start/pom.xml @@ -11,6 +11,12 @@ http://www.eclipse.org/jetty + + maven-surefire-plugin + + org.eclipse.jetty.start.SpdyTestGroup + + maven-jar-plugin diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/LicenseTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/LicenseTest.java index d114edf910a..63f2afd8713 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/LicenseTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/LicenseTest.java @@ -31,6 +31,7 @@ import org.eclipse.jetty.toolchain.test.OS; import org.eclipse.jetty.toolchain.test.TestingDir; import org.junit.Rule; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertThat; @@ -101,6 +102,7 @@ public class LicenseTest } @Test + @Category(SpdyTestGroup.class) public void testAdd_SPDY_Licensed() throws Exception { File basePath = testdir.getEmptyDir(); @@ -117,6 +119,7 @@ public class LicenseTest } @Test + @Category(SpdyTestGroup.class) public void testAdd_HttpSpdy_Then_Deploy() throws Exception { File basePath = testdir.getEmptyDir(); @@ -143,6 +146,7 @@ public class LicenseTest } @Test + @Category(SpdyTestGroup.class) public void testCreate_SPDY_Licensed() throws Exception { File basePath = testdir.getEmptyDir(); diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java index b9dff3bf10d..7f54a488445 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java @@ -30,6 +30,7 @@ import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertEquals; @@ -156,6 +157,7 @@ public class MainTest } @Test + @Category(SpdyTestGroup.class) public void testWithSpdy() throws Exception { List cmdLineArgs = new ArrayList<>(); diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/SpdyTestGroup.java b/jetty-start/src/test/java/org/eclipse/jetty/start/SpdyTestGroup.java new file mode 100644 index 00000000000..feed71fc6b8 --- /dev/null +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/SpdyTestGroup.java @@ -0,0 +1,26 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// ------------------------------------------------------------------------ +// 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.start; + +/** + * Marker interface to group SPDY tests. + */ +public interface SpdyTestGroup +{ +} diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java b/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java index 5cf31bc5894..551fe39da51 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java @@ -24,6 +24,7 @@ import java.util.List; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.junit.Test; +import org.junit.experimental.categories.Category; /** * Various Home + Base use cases @@ -104,6 +105,7 @@ public class TestUseCases } @Test + @Category(SpdyTestGroup.class) public void testWithSpdy() throws Exception { assertUseCase("home","base.enable.spdy","assert-enable-spdy.txt","java.version=1.7.0_60"); From 36c7fe8d4286647a183cc92092245c8ca1a3af83 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Sat, 7 Mar 2020 18:57:45 +0100 Subject: [PATCH 02/16] Updated URLs for Maven Central and GitHub. From http://central.maven.org to https://repo1.maven.org From http://raw.githubusercontent.com/.../master/... to https://github.com/.../raw/jetty-9.2.x/... Signed-off-by: Simone Bordet --- aggregates/jetty-all/pom.xml | 2 +- aggregates/jetty-websocket-all/pom.xml | 2 +- .../jetty/embedded/ExampleServerXml.java | 2 +- .../eclipse/jetty/embedded/FileServerXml.java | 2 +- .../modules/protonego-impl/alpn-1.7.0_40.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_45.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_51.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_55.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_60.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_65.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_67.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_71.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_72.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_75.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_76.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_79.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_80.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_05.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_101.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_102.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_11.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_111.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_112.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_121.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_131.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_141.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_144.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_151.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_152.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_161.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_162.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_171.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_172.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_181.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_191.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_192.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_20.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_201.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_202.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_211.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_212.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_221.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_222.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_231.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_232.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_241.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_242.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_25.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_31.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_40.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_45.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_51.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_60.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_65.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_66.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_71.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_72.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_73.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_74.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_77.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_91.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_92.mod | 2 +- .../config/modules/protonego-impl/alpn.mod | 2 +- jetty-cdi/src/main/config/modules/cdi.mod | 2 +- .../src/main/resources/modules/jamon.mod | 4 ++-- .../src/main/resources/modules/jminix.mod | 20 ++++++++--------- .../src/main/resources/modules/jolokia.mod | 2 +- jetty-server/src/main/config/modules/ssl.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_04.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_05.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_06.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_07.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_09.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_10.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_11.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_13.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_15.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_17.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_21.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_25.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_40.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_45.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_51.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_55.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_60.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_65.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_67.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_71.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_72.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_75.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_76.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_79.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_80.mod | 2 +- .../config/modules/protonego-impl/npn.mod | 2 +- .../jetty/spdy/server/NPNModuleTest.java | 22 +++++++++---------- .../test/resources/assert-home-with-spdy.txt | 4 ++-- .../test/resources/dist-home/modules/cdi.mod | 2 +- .../resources/dist-home/modules/jamon.mod | 4 ++-- .../resources/dist-home/modules/jminix.mod | 20 ++++++++--------- .../resources/dist-home/modules/jolokia.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_40.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_45.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_51.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_55.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_60.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_65.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_67.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_71.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_72.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_75.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_76.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_79.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_80.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_05.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_101.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_102.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_11.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_111.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_112.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_121.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_131.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_141.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_144.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_151.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_152.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_161.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_162.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_171.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_172.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_181.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_191.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_192.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_20.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_201.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_202.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_211.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_212.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_221.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_222.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_231.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_232.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_241.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_242.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_25.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_31.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_40.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_45.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_51.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_60.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_65.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_66.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_71.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_72.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_73.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_74.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_77.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_91.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_92.mod | 2 +- .../dist-home/modules/protonego-impl/alpn.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_04.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_05.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_06.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_07.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_09.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_10.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_11.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_13.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_15.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_17.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_21.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_25.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_40.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_45.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_51.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_55.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_60.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_65.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_67.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_71.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_72.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_75.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_76.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_79.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_80.mod | 2 +- .../dist-home/modules/protonego-impl/npn.mod | 2 +- .../test/resources/dist-home/modules/ssl.mod | 2 +- .../resources/usecases/assert-enable-spdy.txt | 4 ++-- .../resources/usecases/assert-logging.txt | 6 ++--- .../usecases/base.logging/modules/logging.mod | 6 ++--- .../modules/protonego-impl/alpn-1.7.0_40.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_45.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_51.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_55.mod | 2 +- .../modules/protonego-impl/alpn-1.7.0_60.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0.mod | 2 +- .../modules/protonego-impl/alpn-1.8.0_05.mod | 2 +- .../home/modules/protonego-impl/alpn.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_04.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_05.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_06.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_07.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_09.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_10.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_11.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_13.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_15.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_17.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_21.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_25.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_40.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_45.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_51.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_55.mod | 2 +- .../modules/protonego-impl/npn-1.7.0_60.mod | 2 +- .../home/modules/protonego-impl/npn.mod | 2 +- .../resources/usecases/home/modules/ssl.mod | 2 +- 218 files changed, 254 insertions(+), 254 deletions(-) diff --git a/aggregates/jetty-all/pom.xml b/aggregates/jetty-all/pom.xml index 563506d5ac3..f83fafa040b 100644 --- a/aggregates/jetty-all/pom.xml +++ b/aggregates/jetty-all/pom.xml @@ -71,7 +71,7 @@ http://eclipse.org/jetty ${user.name} org.eclipse.jetty - http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/NOTICE.txt + https://github.com/eclipse/jetty.project/raw/jetty-9.2.x/NOTICE.txt Jetty diff --git a/aggregates/jetty-websocket-all/pom.xml b/aggregates/jetty-websocket-all/pom.xml index 9631dd37e79..e34ca76d520 100644 --- a/aggregates/jetty-websocket-all/pom.xml +++ b/aggregates/jetty-websocket-all/pom.xml @@ -70,7 +70,7 @@ http://eclipse.org/jetty ${user.name} org.eclipse.jetty - https://raw.githubusercontent.com/eclipse/jetty.project/master/NOTICE.txt + https://github.com/eclipse/jetty.project/raw/jetty-9.2.x/NOTICE.txt Jetty diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ExampleServerXml.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ExampleServerXml.java index 939785e4e36..4a4ac7b7736 100644 --- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ExampleServerXml.java +++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ExampleServerXml.java @@ -24,7 +24,7 @@ import org.eclipse.jetty.xml.XmlConfiguration; /** * Configures and Starts a Jetty server from an XML declaration. *

- * See exampleserver.xml + * See exampleserver.xml *

*/ public class ExampleServerXml diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/FileServerXml.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/FileServerXml.java index d79a6a7e4e5..3a746646c72 100644 --- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/FileServerXml.java +++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/FileServerXml.java @@ -29,7 +29,7 @@ import org.eclipse.jetty.xml.XmlConfiguration; * via an {@link XmlConfiguration} config file that does the identical work. *

*

- * See fileserver.xml + * See fileserver.xml *

*/ public class FileServerXml diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_40.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_40.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_40.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_40.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_45.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_45.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_45.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_45.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_51.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_51.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_51.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_51.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_55.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_55.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_55.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_55.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_60.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_60.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_60.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_60.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_65.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_65.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_65.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_65.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_67.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_67.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_67.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_67.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_71.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_71.mod index e9b4e2a0c16..02ed38118da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_71.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_71.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.2.v20141202/alpn-boot-7.1.2.v20141202.jar|lib/alpn/alpn-boot-7.1.2.v20141202.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.2.v20141202/alpn-boot-7.1.2.v20141202.jar|lib/alpn/alpn-boot-7.1.2.v20141202.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.2.v20141202.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_72.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_72.mod index e9b4e2a0c16..02ed38118da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_72.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_72.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.2.v20141202/alpn-boot-7.1.2.v20141202.jar|lib/alpn/alpn-boot-7.1.2.v20141202.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.2.v20141202/alpn-boot-7.1.2.v20141202.jar|lib/alpn/alpn-boot-7.1.2.v20141202.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.2.v20141202.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_75.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_75.mod index ac315d6df7d..6ebeeea7be5 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_75.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_75.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_76.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_76.mod index ac315d6df7d..6ebeeea7be5 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_76.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_76.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_79.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_79.mod index ac315d6df7d..6ebeeea7be5 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_79.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_79.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_80.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_80.mod index ac315d6df7d..6ebeeea7be5 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_80.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.7.0_80.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0.mod index a81732c4533..a157f9cec9f 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_05.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_05.mod index a81732c4533..a157f9cec9f 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_05.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_05.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_101.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_101.mod index a7f656bbda4..ab5c8a32497 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_101.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_101.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.9.v20160720.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_102.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_102.mod index a7f656bbda4..ab5c8a32497 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_102.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_102.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.9.v20160720.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_11.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_11.mod index a81732c4533..a157f9cec9f 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_11.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_11.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_111.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_111.mod index a7f656bbda4..ab5c8a32497 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_111.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_111.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.9.v20160720.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_112.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_112.mod index a09db390188..e87a7a2e973 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_112.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_112.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.10.v20161026/alpn-boot-8.1.10.v20161026.jar|lib/alpn/alpn-boot-8.1.10.v20161026.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.10.v20161026/alpn-boot-8.1.10.v20161026.jar|lib/alpn/alpn-boot-8.1.10.v20161026.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.10.v20161026.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_121.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_121.mod index fdd3868701d..af7474ef764 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_121.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_121.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_131.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_131.mod index fdd3868701d..af7474ef764 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_131.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_131.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_141.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_141.mod index fdd3868701d..af7474ef764 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_141.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_141.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_144.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_144.mod index fdd3868701d..af7474ef764 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_144.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_144.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_151.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_151.mod index fdd3868701d..af7474ef764 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_151.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_151.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_152.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_152.mod index fdd3868701d..af7474ef764 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_152.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_152.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_161.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_161.mod index 8b0de785937..1457b701b12 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_161.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_161.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_162.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_162.mod index 8b0de785937..1457b701b12 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_162.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_162.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_171.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_171.mod index 8b0de785937..1457b701b12 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_171.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_171.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_172.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_172.mod index 8b0de785937..1457b701b12 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_172.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_172.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_181.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_181.mod index 8b0de785937..1457b701b12 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_181.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_181.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_191.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_191.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_191.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_191.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_192.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_192.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_192.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_192.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_20.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_20.mod index a81732c4533..a157f9cec9f 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_20.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_20.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_201.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_201.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_201.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_201.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_202.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_202.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_202.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_202.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_211.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_211.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_211.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_211.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_212.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_212.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_212.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_212.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_221.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_221.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_221.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_221.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_222.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_222.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_222.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_222.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_231.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_231.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_231.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_231.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_232.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_232.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_232.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_232.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_241.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_241.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_241.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_241.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_242.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_242.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_242.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_242.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_25.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_25.mod index 8d13261ff61..89cc283b105 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_25.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_25.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.2.v20141202/alpn-boot-8.1.2.v20141202.jar|lib/alpn/alpn-boot-8.1.2.v20141202.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.2.v20141202/alpn-boot-8.1.2.v20141202.jar|lib/alpn/alpn-boot-8.1.2.v20141202.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.2.v20141202.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_31.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_31.mod index 41149793194..1cc25aab83e 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_31.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_31.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_40.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_40.mod index 41149793194..1cc25aab83e 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_40.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_40.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_45.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_45.mod index 41149793194..1cc25aab83e 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_45.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_45.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_51.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_51.mod index ddc18d7d7ca..6e210913c55 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_51.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_51.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.4.v20150727/alpn-boot-8.1.4.v20150727.jar|lib/alpn/alpn-boot-8.1.4.v20150727.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.4.v20150727/alpn-boot-8.1.4.v20150727.jar|lib/alpn/alpn-boot-8.1.4.v20150727.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.4.v20150727.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_60.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_60.mod index 9d207d9a65c..4fd8821ec8a 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_60.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_60.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.5.v20150921/alpn-boot-8.1.5.v20150921.jar|lib/alpn/alpn-boot-8.1.5.v20150921.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.5.v20150921/alpn-boot-8.1.5.v20150921.jar|lib/alpn/alpn-boot-8.1.5.v20150921.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.5.v20150921.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_65.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_65.mod index 03b32d0774d..64eaf218fa6 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_65.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_65.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.6.v20151105/alpn-boot-8.1.6.v20151105.jar|lib/alpn/alpn-boot-8.1.6.v20151105.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.6.v20151105/alpn-boot-8.1.6.v20151105.jar|lib/alpn/alpn-boot-8.1.6.v20151105.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.6.v20151105.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_66.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_66.mod index 03b32d0774d..64eaf218fa6 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_66.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_66.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.6.v20151105/alpn-boot-8.1.6.v20151105.jar|lib/alpn/alpn-boot-8.1.6.v20151105.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.6.v20151105/alpn-boot-8.1.6.v20151105.jar|lib/alpn/alpn-boot-8.1.6.v20151105.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.6.v20151105.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_71.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_71.mod index 3628757cbfd..ccaf6b46475 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_71.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_71.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_72.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_72.mod index 3628757cbfd..ccaf6b46475 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_72.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_72.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_73.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_73.mod index 3628757cbfd..ccaf6b46475 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_73.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_73.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_74.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_74.mod index 3628757cbfd..ccaf6b46475 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_74.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_74.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_77.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_77.mod index 3628757cbfd..ccaf6b46475 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_77.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_77.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_91.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_91.mod index 3628757cbfd..ccaf6b46475 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_91.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_91.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_92.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_92.mod index 1be27521261..cdfe567f6fa 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_92.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn-1.8.0_92.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.8.v20160420/alpn-boot-8.1.8.v20160420.jar|lib/alpn/alpn-boot-8.1.8.v20160420.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.8.v20160420/alpn-boot-8.1.8.v20160420.jar|lib/alpn/alpn-boot-8.1.8.v20160420.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.8.v20160420.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn.mod index d3e411867d1..d14c5f16f9d 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/protonego-impl/alpn.mod @@ -15,7 +15,7 @@ # Java versions. # # All versions of alpn-boot can be found at -# http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/ +# https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/ [name] protonego-impl diff --git a/jetty-cdi/src/main/config/modules/cdi.mod b/jetty-cdi/src/main/config/modules/cdi.mod index 68dea58b627..115efab1300 100644 --- a/jetty-cdi/src/main/config/modules/cdi.mod +++ b/jetty-cdi/src/main/config/modules/cdi.mod @@ -11,7 +11,7 @@ jsp [files] lib/weld/ -http://central.maven.org/maven2/org/jboss/weld/servlet/weld-servlet/2.2.5.Final/weld-servlet-2.2.5.Final.jar|lib/weld/weld-servlet-2.2.5.Final.jar +https://repo1.maven.org/maven2/org/jboss/weld/servlet/weld-servlet/2.2.5.Final/weld-servlet-2.2.5.Final.jar|lib/weld/weld-servlet-2.2.5.Final.jar [lib] lib/weld/weld-servlet-2.2.5.Final.jar diff --git a/jetty-distribution/src/main/resources/modules/jamon.mod b/jetty-distribution/src/main/resources/modules/jamon.mod index 2aeb2adcb8e..57774cc9760 100644 --- a/jetty-distribution/src/main/resources/modules/jamon.mod +++ b/jetty-distribution/src/main/resources/modules/jamon.mod @@ -13,8 +13,8 @@ etc/jamon.xml [files] lib/jamon/ -http://central.maven.org/maven2/com/jamonapi/jamon/2.79/jamon-2.79.jar|lib/jamon/jamon-2.79.jar -http://central.maven.org/maven2/com/jamonapi/jamon_war/2.79/jamon_war-2.79.war|lib/jamon/jamon.war +https://repo1.maven.org/maven2/com/jamonapi/jamon/2.79/jamon-2.79.jar|lib/jamon/jamon-2.79.jar +https://repo1.maven.org/maven2/com/jamonapi/jamon_war/2.79/jamon_war-2.79.war|lib/jamon/jamon.war [lib] lib/jamon/**.jar diff --git a/jetty-distribution/src/main/resources/modules/jminix.mod b/jetty-distribution/src/main/resources/modules/jminix.mod index b35d7024cd6..595f3e9d45a 100644 --- a/jetty-distribution/src/main/resources/modules/jminix.mod +++ b/jetty-distribution/src/main/resources/modules/jminix.mod @@ -11,21 +11,21 @@ etc/jminix.xml [files] lib/jminix/ -http://central.maven.org/maven2/org/jminix/jminix/1.1.0/jminix-1.1.0.jar|lib/jminix/jminix-1.1.0.jar +https://repo1.maven.org/maven2/org/jminix/jminix/1.1.0/jminix-1.1.0.jar|lib/jminix/jminix-1.1.0.jar http://maven.restlet.com/org/restlet/org.restlet/1.1.5/org.restlet-1.1.5.jar|lib/jminix/org.restlet-1.1.5.jar http://maven.restlet.com/org/restlet/org.restlet.ext.velocity/1.1.5/org.restlet.ext.velocity-1.1.5.jar|lib/jminix/org.restlet.ext.velocity-1.1.5.jar -http://central.maven.org/maven2/org/apache/velocity/velocity/1.5/velocity-1.5.jar|lib/jminix/velocity-1.5.jar -http://central.maven.org/maven2/oro/oro/2.0.8/oro-2.0.8.jar|lib/jminix/oro-2.0.8.jar +https://repo1.maven.org/maven2/org/apache/velocity/velocity/1.5/velocity-1.5.jar|lib/jminix/velocity-1.5.jar +https://repo1.maven.org/maven2/oro/oro/2.0.8/oro-2.0.8.jar|lib/jminix/oro-2.0.8.jar http://maven.restlet.com/com/noelios/restlet/com.noelios.restlet/1.1.5/com.noelios.restlet-1.1.5.jar|lib/jminix/com.noelios.restlet-1.1.5.jar http://maven.restlet.com/com/noelios/restlet/com.noelios.restlet.ext.servlet/1.1.5/com.noelios.restlet.ext.servlet-1.1.5.jar|lib/jminix/com.noelios.restlet.ext.servlet-1.1.5.jar -http://central.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar|lib/jminix/commons-logging-1.1.1.jar +https://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar|lib/jminix/commons-logging-1.1.1.jar http://repo2.maven.org/maven2/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3-jdk15.jar|lib/jminix/json-lib-2.2.3-jdk15.jar -http://central.maven.org/maven2/commons-lang/commons-lang/2.4/commons-lang-2.4.jar|lib/jminix/commons-lang-2.4.jar -http://central.maven.org/maven2/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar|lib/jminix/commons-beanutils-1.7.0.jar -http://central.maven.org/maven2/commons-collections/commons-collections/3.2/commons-collections-3.2.jar|lib/jminix/commons-collections-3.2.jar -http://central.maven.org/maven2/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar|lib/jminix/ezmorph-1.0.6.jar -http://central.maven.org/maven2/org/jgroups/jgroups/2.12.1.3.Final/jgroups-2.12.1.3.Final.jar|lib/jminix/jgroups-2.12.1.3.Final.jar -http://central.maven.org/maven2/org/jasypt/jasypt/1.8/jasypt-1.8.jar|lib/jminix/jasypt-1.8.jar +https://repo1.maven.org/maven2/commons-lang/commons-lang/2.4/commons-lang-2.4.jar|lib/jminix/commons-lang-2.4.jar +https://repo1.maven.org/maven2/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar|lib/jminix/commons-beanutils-1.7.0.jar +https://repo1.maven.org/maven2/commons-collections/commons-collections/3.2/commons-collections-3.2.jar|lib/jminix/commons-collections-3.2.jar +https://repo1.maven.org/maven2/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar|lib/jminix/ezmorph-1.0.6.jar +https://repo1.maven.org/maven2/org/jgroups/jgroups/2.12.1.3.Final/jgroups-2.12.1.3.Final.jar|lib/jminix/jgroups-2.12.1.3.Final.jar +https://repo1.maven.org/maven2/org/jasypt/jasypt/1.8/jasypt-1.8.jar|lib/jminix/jasypt-1.8.jar [lib] lib/jminix/**.jar diff --git a/jetty-distribution/src/main/resources/modules/jolokia.mod b/jetty-distribution/src/main/resources/modules/jolokia.mod index 876c2fcd47c..5c1b38dc755 100644 --- a/jetty-distribution/src/main/resources/modules/jolokia.mod +++ b/jetty-distribution/src/main/resources/modules/jolokia.mod @@ -11,7 +11,7 @@ jmx etc/jolokia.xml [files] -http://repo1.maven.org/maven2/org/jolokia/jolokia-war/1.2.2/jolokia-war-1.2.2.war|lib/jolokia/jolokia.war +https://repo1.maven.org/maven2/org/jolokia/jolokia-war/1.2.2/jolokia-war-1.2.2.war|lib/jolokia/jolokia.war [license] Jolokia is released under the Apache License 2.0 diff --git a/jetty-server/src/main/config/modules/ssl.mod b/jetty-server/src/main/config/modules/ssl.mod index a2fdfd1444f..227b22a4ca9 100644 --- a/jetty-server/src/main/config/modules/ssl.mod +++ b/jetty-server/src/main/config/modules/ssl.mod @@ -9,7 +9,7 @@ server etc/jetty-ssl.xml [files] -https://raw.githubusercontent.com/eclipse/jetty.project/master/jetty-server/src/test/config/etc/keystore?id=${jetty.tag.version}|etc/keystore +https://github.com/eclipse/jetty.project/raw/jetty-9.2.x/jetty-server/src/main/config/etc/keystore|etc/keystore [ini-template] ### SSL Keystore Configuration diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_04.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_04.mod index 007570b6757..36521de8378 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_04.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_04.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_05.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_05.mod index 007570b6757..36521de8378 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_05.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_05.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_06.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_06.mod index 868a7a77fcb..b80120ef24d 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_06.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_06.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_07.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_07.mod index 868a7a77fcb..b80120ef24d 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_07.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_07.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_09.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_09.mod index 20c1db27bd5..d358a28ec50 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_09.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_09.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_10.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_10.mod index 20c1db27bd5..d358a28ec50 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_10.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_10.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_11.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_11.mod index 20c1db27bd5..d358a28ec50 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_11.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_11.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_13.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_13.mod index 1645a52dba0..853c63a9f21 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_13.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_13.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar|lib/npn/npn-boot-1.1.4.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar|lib/npn/npn-boot-1.1.4.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.4.v20130313.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_15.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_15.mod index 73bc09007eb..56cbf46076c 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_15.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_15.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_17.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_17.mod index 73bc09007eb..56cbf46076c 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_17.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_17.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_21.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_21.mod index 73bc09007eb..56cbf46076c 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_21.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_21.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_25.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_25.mod index 73bc09007eb..56cbf46076c 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_25.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_25.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_40.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_40.mod index 465e6f034b6..19ba6ff4837 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_40.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_40.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_45.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_45.mod index 465e6f034b6..19ba6ff4837 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_45.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_45.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_51.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_51.mod index 465e6f034b6..19ba6ff4837 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_51.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_51.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_55.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_55.mod index 5f8704d68a8..e2625aca585 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_55.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_55.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_60.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_60.mod index 5f8704d68a8..e2625aca585 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_60.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_60.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_65.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_65.mod index 5f8704d68a8..e2625aca585 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_65.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_65.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_67.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_67.mod index 5f8704d68a8..e2625aca585 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_67.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_67.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_71.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_71.mod index 851aca8727c..854b2c718d4 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_71.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_71.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.9.v20141016/npn-boot-1.1.9.v20141016.jar|lib/npn/npn-boot-1.1.9.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.9.v20141016/npn-boot-1.1.9.v20141016.jar|lib/npn/npn-boot-1.1.9.v20141016.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.9.v20141016.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_72.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_72.mod index 851aca8727c..854b2c718d4 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_72.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_72.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.9.v20141016/npn-boot-1.1.9.v20141016.jar|lib/npn/npn-boot-1.1.9.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.9.v20141016/npn-boot-1.1.9.v20141016.jar|lib/npn/npn-boot-1.1.9.v20141016.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.9.v20141016.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_75.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_75.mod index a5fac1140cd..1708ffd1326 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_75.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_75.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar|lib/npn/npn-boot-1.1.10.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar|lib/npn/npn-boot-1.1.10.v20150130.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.10.v20150130.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_76.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_76.mod index a5fac1140cd..1708ffd1326 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_76.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_76.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar|lib/npn/npn-boot-1.1.10.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar|lib/npn/npn-boot-1.1.10.v20150130.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.10.v20150130.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_79.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_79.mod index a5fac1140cd..1708ffd1326 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_79.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_79.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar|lib/npn/npn-boot-1.1.10.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar|lib/npn/npn-boot-1.1.10.v20150130.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.10.v20150130.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_80.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_80.mod index 2cce5fab7c8..a1d26caf21c 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_80.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn-1.7.0_80.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.11.v20150415/npn-boot-1.1.11.v20150415.jar|lib/npn/npn-boot-1.1.11.v20150415.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.11.v20150415/npn-boot-1.1.11.v20150415.jar|lib/npn/npn-boot-1.1.11.v20150415.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.11.v20150415.jar diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn.mod index 1a2c71d7213..539fa828c6f 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/protonego-impl/npn.mod @@ -14,7 +14,7 @@ # Java versions. # # All versions of npn-boot can be found at -# http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/ +# https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/ [name] diff --git a/jetty-spdy/spdy-npn-tests/src/test/java/org/eclipse/jetty/spdy/server/NPNModuleTest.java b/jetty-spdy/spdy-npn-tests/src/test/java/org/eclipse/jetty/spdy/server/NPNModuleTest.java index d391bc2d1df..96148b08618 100644 --- a/jetty-spdy/spdy-npn-tests/src/test/java/org/eclipse/jetty/spdy/server/NPNModuleTest.java +++ b/jetty-spdy/spdy-npn-tests/src/test/java/org/eclipse/jetty/spdy/server/NPNModuleTest.java @@ -59,17 +59,17 @@ public class NPNModuleTest static { /** The main() method in this test case can be run to validate this list independently */ - KNOWN_GOOD_NPN_URLS.add("http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.11.v20150415/npn-boot-1.1.11.v20150415.jar"); - KNOWN_GOOD_NPN_URLS.add("http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar"); - KNOWN_GOOD_NPN_URLS.add("http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.9.v20141016/npn-boot-1.1.9.v20141016.jar"); - KNOWN_GOOD_NPN_URLS.add("http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar"); - KNOWN_GOOD_NPN_URLS.add("http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar"); - KNOWN_GOOD_NPN_URLS.add("http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar"); - KNOWN_GOOD_NPN_URLS.add("http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar"); - KNOWN_GOOD_NPN_URLS.add("http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar"); - KNOWN_GOOD_NPN_URLS.add("http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.2.v20130305/npn-boot-1.1.2.v20130305.jar"); - KNOWN_GOOD_NPN_URLS.add("http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar"); - KNOWN_GOOD_NPN_URLS.add("http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar"); + KNOWN_GOOD_NPN_URLS.add("https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.11.v20150415/npn-boot-1.1.11.v20150415.jar"); + KNOWN_GOOD_NPN_URLS.add("https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar"); + KNOWN_GOOD_NPN_URLS.add("https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.9.v20141016/npn-boot-1.1.9.v20141016.jar"); + KNOWN_GOOD_NPN_URLS.add("https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar"); + KNOWN_GOOD_NPN_URLS.add("https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar"); + KNOWN_GOOD_NPN_URLS.add("https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar"); + KNOWN_GOOD_NPN_URLS.add("https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar"); + KNOWN_GOOD_NPN_URLS.add("https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar"); + KNOWN_GOOD_NPN_URLS.add("https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.2.v20130305/npn-boot-1.1.2.v20130305.jar"); + KNOWN_GOOD_NPN_URLS.add("https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar"); + KNOWN_GOOD_NPN_URLS.add("https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar"); } @Parameters(name = "{index}: mod:{0}") diff --git a/jetty-start/src/test/resources/assert-home-with-spdy.txt b/jetty-start/src/test/resources/assert-home-with-spdy.txt index aa5aea97899..614573c9e6c 100644 --- a/jetty-start/src/test/resources/assert-home-with-spdy.txt +++ b/jetty-start/src/test/resources/assert-home-with-spdy.txt @@ -62,8 +62,8 @@ JVM|-Xms1024m JVM|-Xmx1024m # Downloads -DOWNLOAD|http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar -DOWNLOAD|http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/jetty-server/src/main/config/etc/keystore|etc/keystore +DOWNLOAD|https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +DOWNLOAD|https://github.com/eclipse/jetty.project/raw/jetty-9.2.x/jetty-server/src/main/config/etc/keystore # Files FILE|lib/ diff --git a/jetty-start/src/test/resources/dist-home/modules/cdi.mod b/jetty-start/src/test/resources/dist-home/modules/cdi.mod index 68dea58b627..115efab1300 100644 --- a/jetty-start/src/test/resources/dist-home/modules/cdi.mod +++ b/jetty-start/src/test/resources/dist-home/modules/cdi.mod @@ -11,7 +11,7 @@ jsp [files] lib/weld/ -http://central.maven.org/maven2/org/jboss/weld/servlet/weld-servlet/2.2.5.Final/weld-servlet-2.2.5.Final.jar|lib/weld/weld-servlet-2.2.5.Final.jar +https://repo1.maven.org/maven2/org/jboss/weld/servlet/weld-servlet/2.2.5.Final/weld-servlet-2.2.5.Final.jar|lib/weld/weld-servlet-2.2.5.Final.jar [lib] lib/weld/weld-servlet-2.2.5.Final.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/jamon.mod b/jetty-start/src/test/resources/dist-home/modules/jamon.mod index 2aeb2adcb8e..57774cc9760 100644 --- a/jetty-start/src/test/resources/dist-home/modules/jamon.mod +++ b/jetty-start/src/test/resources/dist-home/modules/jamon.mod @@ -13,8 +13,8 @@ etc/jamon.xml [files] lib/jamon/ -http://central.maven.org/maven2/com/jamonapi/jamon/2.79/jamon-2.79.jar|lib/jamon/jamon-2.79.jar -http://central.maven.org/maven2/com/jamonapi/jamon_war/2.79/jamon_war-2.79.war|lib/jamon/jamon.war +https://repo1.maven.org/maven2/com/jamonapi/jamon/2.79/jamon-2.79.jar|lib/jamon/jamon-2.79.jar +https://repo1.maven.org/maven2/com/jamonapi/jamon_war/2.79/jamon_war-2.79.war|lib/jamon/jamon.war [lib] lib/jamon/**.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/jminix.mod b/jetty-start/src/test/resources/dist-home/modules/jminix.mod index b35d7024cd6..595f3e9d45a 100644 --- a/jetty-start/src/test/resources/dist-home/modules/jminix.mod +++ b/jetty-start/src/test/resources/dist-home/modules/jminix.mod @@ -11,21 +11,21 @@ etc/jminix.xml [files] lib/jminix/ -http://central.maven.org/maven2/org/jminix/jminix/1.1.0/jminix-1.1.0.jar|lib/jminix/jminix-1.1.0.jar +https://repo1.maven.org/maven2/org/jminix/jminix/1.1.0/jminix-1.1.0.jar|lib/jminix/jminix-1.1.0.jar http://maven.restlet.com/org/restlet/org.restlet/1.1.5/org.restlet-1.1.5.jar|lib/jminix/org.restlet-1.1.5.jar http://maven.restlet.com/org/restlet/org.restlet.ext.velocity/1.1.5/org.restlet.ext.velocity-1.1.5.jar|lib/jminix/org.restlet.ext.velocity-1.1.5.jar -http://central.maven.org/maven2/org/apache/velocity/velocity/1.5/velocity-1.5.jar|lib/jminix/velocity-1.5.jar -http://central.maven.org/maven2/oro/oro/2.0.8/oro-2.0.8.jar|lib/jminix/oro-2.0.8.jar +https://repo1.maven.org/maven2/org/apache/velocity/velocity/1.5/velocity-1.5.jar|lib/jminix/velocity-1.5.jar +https://repo1.maven.org/maven2/oro/oro/2.0.8/oro-2.0.8.jar|lib/jminix/oro-2.0.8.jar http://maven.restlet.com/com/noelios/restlet/com.noelios.restlet/1.1.5/com.noelios.restlet-1.1.5.jar|lib/jminix/com.noelios.restlet-1.1.5.jar http://maven.restlet.com/com/noelios/restlet/com.noelios.restlet.ext.servlet/1.1.5/com.noelios.restlet.ext.servlet-1.1.5.jar|lib/jminix/com.noelios.restlet.ext.servlet-1.1.5.jar -http://central.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar|lib/jminix/commons-logging-1.1.1.jar +https://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar|lib/jminix/commons-logging-1.1.1.jar http://repo2.maven.org/maven2/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3-jdk15.jar|lib/jminix/json-lib-2.2.3-jdk15.jar -http://central.maven.org/maven2/commons-lang/commons-lang/2.4/commons-lang-2.4.jar|lib/jminix/commons-lang-2.4.jar -http://central.maven.org/maven2/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar|lib/jminix/commons-beanutils-1.7.0.jar -http://central.maven.org/maven2/commons-collections/commons-collections/3.2/commons-collections-3.2.jar|lib/jminix/commons-collections-3.2.jar -http://central.maven.org/maven2/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar|lib/jminix/ezmorph-1.0.6.jar -http://central.maven.org/maven2/org/jgroups/jgroups/2.12.1.3.Final/jgroups-2.12.1.3.Final.jar|lib/jminix/jgroups-2.12.1.3.Final.jar -http://central.maven.org/maven2/org/jasypt/jasypt/1.8/jasypt-1.8.jar|lib/jminix/jasypt-1.8.jar +https://repo1.maven.org/maven2/commons-lang/commons-lang/2.4/commons-lang-2.4.jar|lib/jminix/commons-lang-2.4.jar +https://repo1.maven.org/maven2/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar|lib/jminix/commons-beanutils-1.7.0.jar +https://repo1.maven.org/maven2/commons-collections/commons-collections/3.2/commons-collections-3.2.jar|lib/jminix/commons-collections-3.2.jar +https://repo1.maven.org/maven2/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar|lib/jminix/ezmorph-1.0.6.jar +https://repo1.maven.org/maven2/org/jgroups/jgroups/2.12.1.3.Final/jgroups-2.12.1.3.Final.jar|lib/jminix/jgroups-2.12.1.3.Final.jar +https://repo1.maven.org/maven2/org/jasypt/jasypt/1.8/jasypt-1.8.jar|lib/jminix/jasypt-1.8.jar [lib] lib/jminix/**.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/jolokia.mod b/jetty-start/src/test/resources/dist-home/modules/jolokia.mod index 876c2fcd47c..5c1b38dc755 100644 --- a/jetty-start/src/test/resources/dist-home/modules/jolokia.mod +++ b/jetty-start/src/test/resources/dist-home/modules/jolokia.mod @@ -11,7 +11,7 @@ jmx etc/jolokia.xml [files] -http://repo1.maven.org/maven2/org/jolokia/jolokia-war/1.2.2/jolokia-war-1.2.2.war|lib/jolokia/jolokia.war +https://repo1.maven.org/maven2/org/jolokia/jolokia-war/1.2.2/jolokia-war-1.2.2.war|lib/jolokia/jolokia.war [license] Jolokia is released under the Apache License 2.0 diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_40.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_40.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_40.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_40.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_45.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_45.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_45.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_45.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_51.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_51.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_51.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_51.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_55.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_55.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_55.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_55.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_60.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_60.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_60.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_60.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_65.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_65.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_65.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_65.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_67.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_67.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_67.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_67.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_71.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_71.mod index e9b4e2a0c16..02ed38118da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_71.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_71.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.2.v20141202/alpn-boot-7.1.2.v20141202.jar|lib/alpn/alpn-boot-7.1.2.v20141202.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.2.v20141202/alpn-boot-7.1.2.v20141202.jar|lib/alpn/alpn-boot-7.1.2.v20141202.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.2.v20141202.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_72.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_72.mod index e9b4e2a0c16..02ed38118da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_72.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_72.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.2.v20141202/alpn-boot-7.1.2.v20141202.jar|lib/alpn/alpn-boot-7.1.2.v20141202.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.2.v20141202/alpn-boot-7.1.2.v20141202.jar|lib/alpn/alpn-boot-7.1.2.v20141202.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.2.v20141202.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_75.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_75.mod index ac315d6df7d..6ebeeea7be5 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_75.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_75.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.3.v20150130.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_76.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_76.mod index ac315d6df7d..6ebeeea7be5 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_76.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_76.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.3.v20150130.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_79.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_79.mod index ac315d6df7d..6ebeeea7be5 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_79.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_79.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.3.v20150130.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_80.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_80.mod index ac315d6df7d..6ebeeea7be5 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_80.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.7.0_80.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.3.v20150130/alpn-boot-7.1.3.v20150130.jar|lib/alpn/alpn-boot-7.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.3.v20150130.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0.mod index a81732c4533..a157f9cec9f 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_05.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_05.mod index a81732c4533..a157f9cec9f 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_05.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_05.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_101.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_101.mod index a7f656bbda4..ab5c8a32497 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_101.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_101.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.9.v20160720.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_102.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_102.mod index a7f656bbda4..ab5c8a32497 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_102.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_102.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.9.v20160720.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_11.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_11.mod index a81732c4533..a157f9cec9f 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_11.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_11.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_111.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_111.mod index a7f656bbda4..ab5c8a32497 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_111.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_111.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.9.v20160720/alpn-boot-8.1.9.v20160720.jar|lib/alpn/alpn-boot-8.1.9.v20160720.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.9.v20160720.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_112.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_112.mod index a09db390188..e87a7a2e973 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_112.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_112.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.10.v20161026/alpn-boot-8.1.10.v20161026.jar|lib/alpn/alpn-boot-8.1.10.v20161026.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.10.v20161026/alpn-boot-8.1.10.v20161026.jar|lib/alpn/alpn-boot-8.1.10.v20161026.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.10.v20161026.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_121.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_121.mod index fdd3868701d..af7474ef764 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_121.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_121.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_131.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_131.mod index fdd3868701d..af7474ef764 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_131.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_131.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_141.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_141.mod index fdd3868701d..af7474ef764 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_141.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_141.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_144.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_144.mod index fdd3868701d..af7474ef764 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_144.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_144.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_151.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_151.mod index fdd3868701d..af7474ef764 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_151.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_151.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_152.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_152.mod index fdd3868701d..af7474ef764 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_152.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_152.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_161.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_161.mod index 8b0de785937..1457b701b12 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_161.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_161.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_162.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_162.mod index 8b0de785937..1457b701b12 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_162.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_162.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_171.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_171.mod index 8b0de785937..1457b701b12 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_171.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_171.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_172.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_172.mod index 8b0de785937..1457b701b12 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_172.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_172.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_181.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_181.mod index 8b0de785937..1457b701b12 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_181.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_181.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.12.v20180117/alpn-boot-8.1.12.v20180117.jar|lib/alpn/alpn-boot-8.1.12.v20180117.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_191.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_191.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_191.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_191.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_192.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_192.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_192.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_192.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_20.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_20.mod index a81732c4533..a157f9cec9f 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_20.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_20.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_201.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_201.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_201.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_201.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_202.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_202.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_202.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_202.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_211.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_211.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_211.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_211.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_212.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_212.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_212.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_212.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_221.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_221.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_221.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_221.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_222.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_222.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_222.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_222.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_231.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_231.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_231.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_231.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_232.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_232.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_232.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_232.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_241.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_241.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_241.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_241.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_242.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_242.mod index d49c0780441..9bdd094f3da 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_242.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_242.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.13.v20181017/alpn-boot-8.1.13.v20181017.jar|lib/alpn/alpn-boot-8.1.13.v20181017.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_25.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_25.mod index 8d13261ff61..89cc283b105 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_25.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_25.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.2.v20141202/alpn-boot-8.1.2.v20141202.jar|lib/alpn/alpn-boot-8.1.2.v20141202.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.2.v20141202/alpn-boot-8.1.2.v20141202.jar|lib/alpn/alpn-boot-8.1.2.v20141202.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.2.v20141202.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_31.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_31.mod index 41149793194..1cc25aab83e 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_31.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_31.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.3.v20150130.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_40.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_40.mod index 41149793194..1cc25aab83e 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_40.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_40.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.3.v20150130.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_45.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_45.mod index 41149793194..1cc25aab83e 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_45.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_45.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.3.v20150130/alpn-boot-8.1.3.v20150130.jar|lib/alpn/alpn-boot-8.1.3.v20150130.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.3.v20150130.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_51.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_51.mod index ddc18d7d7ca..6e210913c55 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_51.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_51.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.4.v20150727/alpn-boot-8.1.4.v20150727.jar|lib/alpn/alpn-boot-8.1.4.v20150727.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.4.v20150727/alpn-boot-8.1.4.v20150727.jar|lib/alpn/alpn-boot-8.1.4.v20150727.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.4.v20150727.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_60.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_60.mod index 9d207d9a65c..4fd8821ec8a 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_60.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_60.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.5.v20150921/alpn-boot-8.1.5.v20150921.jar|lib/alpn/alpn-boot-8.1.5.v20150921.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.5.v20150921/alpn-boot-8.1.5.v20150921.jar|lib/alpn/alpn-boot-8.1.5.v20150921.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.5.v20150921.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_65.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_65.mod index 03b32d0774d..64eaf218fa6 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_65.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_65.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.6.v20151105/alpn-boot-8.1.6.v20151105.jar|lib/alpn/alpn-boot-8.1.6.v20151105.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.6.v20151105/alpn-boot-8.1.6.v20151105.jar|lib/alpn/alpn-boot-8.1.6.v20151105.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.6.v20151105.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_66.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_66.mod index 03b32d0774d..64eaf218fa6 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_66.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_66.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.6.v20151105/alpn-boot-8.1.6.v20151105.jar|lib/alpn/alpn-boot-8.1.6.v20151105.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.6.v20151105/alpn-boot-8.1.6.v20151105.jar|lib/alpn/alpn-boot-8.1.6.v20151105.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.6.v20151105.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_71.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_71.mod index 3628757cbfd..ccaf6b46475 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_71.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_71.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_72.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_72.mod index 3628757cbfd..ccaf6b46475 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_72.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_72.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_73.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_73.mod index 3628757cbfd..ccaf6b46475 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_73.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_73.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_74.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_74.mod index 3628757cbfd..ccaf6b46475 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_74.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_74.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_77.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_77.mod index 3628757cbfd..ccaf6b46475 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_77.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_77.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_91.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_91.mod index 3628757cbfd..ccaf6b46475 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_91.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_91.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.7.v20160121/alpn-boot-8.1.7.v20160121.jar|lib/alpn/alpn-boot-8.1.7.v20160121.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_92.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_92.mod index 1be27521261..cdfe567f6fa 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_92.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn-1.8.0_92.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.8.v20160420/alpn-boot-8.1.8.v20160420.jar|lib/alpn/alpn-boot-8.1.8.v20160420.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.8.v20160420/alpn-boot-8.1.8.v20160420.jar|lib/alpn/alpn-boot-8.1.8.v20160420.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.8.v20160420.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn.mod index d3e411867d1..d14c5f16f9d 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/alpn.mod @@ -15,7 +15,7 @@ # Java versions. # # All versions of alpn-boot can be found at -# http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/ +# https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/ [name] protonego-impl diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_04.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_04.mod index 007570b6757..36521de8378 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_04.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_04.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_05.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_05.mod index 007570b6757..36521de8378 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_05.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_05.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_06.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_06.mod index 868a7a77fcb..b80120ef24d 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_06.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_06.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_07.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_07.mod index 868a7a77fcb..b80120ef24d 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_07.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_07.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_09.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_09.mod index 20c1db27bd5..d358a28ec50 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_09.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_09.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_10.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_10.mod index 20c1db27bd5..d358a28ec50 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_10.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_10.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_11.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_11.mod index 20c1db27bd5..d358a28ec50 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_11.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_11.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_13.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_13.mod index 1645a52dba0..853c63a9f21 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_13.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_13.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar|lib/npn/npn-boot-1.1.4.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar|lib/npn/npn-boot-1.1.4.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.4.v20130313.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_15.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_15.mod index 73bc09007eb..56cbf46076c 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_15.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_15.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_17.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_17.mod index 73bc09007eb..56cbf46076c 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_17.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_17.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_21.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_21.mod index 73bc09007eb..56cbf46076c 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_21.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_21.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_25.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_25.mod index 73bc09007eb..56cbf46076c 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_25.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_25.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_40.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_40.mod index 465e6f034b6..19ba6ff4837 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_40.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_40.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_45.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_45.mod index 465e6f034b6..19ba6ff4837 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_45.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_45.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_51.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_51.mod index 465e6f034b6..19ba6ff4837 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_51.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_51.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_55.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_55.mod index 5f8704d68a8..e2625aca585 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_55.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_55.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_60.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_60.mod index 5f8704d68a8..e2625aca585 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_60.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_60.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_65.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_65.mod index 5f8704d68a8..e2625aca585 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_65.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_65.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_67.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_67.mod index 5f8704d68a8..e2625aca585 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_67.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_67.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_71.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_71.mod index 851aca8727c..854b2c718d4 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_71.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_71.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.9.v20141016/npn-boot-1.1.9.v20141016.jar|lib/npn/npn-boot-1.1.9.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.9.v20141016/npn-boot-1.1.9.v20141016.jar|lib/npn/npn-boot-1.1.9.v20141016.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.9.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_72.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_72.mod index 851aca8727c..854b2c718d4 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_72.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_72.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.9.v20141016/npn-boot-1.1.9.v20141016.jar|lib/npn/npn-boot-1.1.9.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.9.v20141016/npn-boot-1.1.9.v20141016.jar|lib/npn/npn-boot-1.1.9.v20141016.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.9.v20141016.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_75.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_75.mod index a5fac1140cd..1708ffd1326 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_75.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_75.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar|lib/npn/npn-boot-1.1.10.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar|lib/npn/npn-boot-1.1.10.v20150130.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.10.v20150130.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_76.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_76.mod index a5fac1140cd..1708ffd1326 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_76.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_76.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar|lib/npn/npn-boot-1.1.10.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar|lib/npn/npn-boot-1.1.10.v20150130.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.10.v20150130.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_79.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_79.mod index a5fac1140cd..1708ffd1326 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_79.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_79.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar|lib/npn/npn-boot-1.1.10.v20150130.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.10.v20150130/npn-boot-1.1.10.v20150130.jar|lib/npn/npn-boot-1.1.10.v20150130.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.10.v20150130.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_80.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_80.mod index 2cce5fab7c8..a1d26caf21c 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_80.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn-1.7.0_80.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.11.v20150415/npn-boot-1.1.11.v20150415.jar|lib/npn/npn-boot-1.1.11.v20150415.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.11.v20150415/npn-boot-1.1.11.v20150415.jar|lib/npn/npn-boot-1.1.11.v20150415.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.11.v20150415.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn.mod b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn.mod index 1a2c71d7213..539fa828c6f 100644 --- a/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn.mod +++ b/jetty-start/src/test/resources/dist-home/modules/protonego-impl/npn.mod @@ -14,7 +14,7 @@ # Java versions. # # All versions of npn-boot can be found at -# http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/ +# https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/ [name] diff --git a/jetty-start/src/test/resources/dist-home/modules/ssl.mod b/jetty-start/src/test/resources/dist-home/modules/ssl.mod index a2fdfd1444f..227b22a4ca9 100644 --- a/jetty-start/src/test/resources/dist-home/modules/ssl.mod +++ b/jetty-start/src/test/resources/dist-home/modules/ssl.mod @@ -9,7 +9,7 @@ server etc/jetty-ssl.xml [files] -https://raw.githubusercontent.com/eclipse/jetty.project/master/jetty-server/src/test/config/etc/keystore?id=${jetty.tag.version}|etc/keystore +https://github.com/eclipse/jetty.project/raw/jetty-9.2.x/jetty-server/src/main/config/etc/keystore|etc/keystore [ini-template] ### SSL Keystore Configuration diff --git a/jetty-start/src/test/resources/usecases/assert-enable-spdy.txt b/jetty-start/src/test/resources/usecases/assert-enable-spdy.txt index a69eeb6dda7..36675bd5123 100644 --- a/jetty-start/src/test/resources/usecases/assert-enable-spdy.txt +++ b/jetty-start/src/test/resources/usecases/assert-enable-spdy.txt @@ -37,8 +37,8 @@ PROP|spdy.port=8443 PROP|spdy.timeout=30000 # The Downloads -DOWNLOAD|http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar -DOWNLOAD|http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/jetty-server/src/main/config/etc/keystore|etc/keystore +DOWNLOAD|https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +DOWNLOAD|https://github.com/eclipse/jetty.project/raw/jetty-9.2.x/jetty-server/src/main/config/etc/keystore # The Bootlib BOOTLIB|-Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/usecases/assert-logging.txt b/jetty-start/src/test/resources/usecases/assert-logging.txt index c83dc2c7b96..483445b10eb 100644 --- a/jetty-start/src/test/resources/usecases/assert-logging.txt +++ b/jetty-start/src/test/resources/usecases/assert-logging.txt @@ -25,8 +25,8 @@ FILE|logs/ FILE|resources/ # Downloads -DOWNLOAD|http://central.maven.org/maven2/org/slf4j/slf4j-api/1.6.6/slf4j-api-1.6.6.jar|lib/logging/slf4j-api-1.6.6.jar -DOWNLOAD|http://repo1.maven.org/maven2/ch/qos/logback/logback-core/1.0.7/logback-core-1.0.7.jar|lib/logging/logback-core-1.0.7.jar -DOWNLOAD|http://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.0.7/logback-classic-1.0.7.jar|lib/logging/logback-classic-1.0.7.jar +DOWNLOAD|https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.6.6/slf4j-api-1.6.6.jar|lib/logging/slf4j-api-1.6.6.jar +DOWNLOAD|https://repo1.maven.org/maven2/ch/qos/logback/logback-core/1.0.7/logback-core-1.0.7.jar|lib/logging/logback-core-1.0.7.jar +DOWNLOAD|https://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.0.7/logback-classic-1.0.7.jar|lib/logging/logback-classic-1.0.7.jar DOWNLOAD|https://raw.githubusercontent.com/jetty-project/logging-modules/master/logback/logback.xml|resources/logback.xml DOWNLOAD|https://raw.githubusercontent.com/jetty-project/logging-modules/master/logback/jetty-logging.properties|resources/jetty-logging.properties diff --git a/jetty-start/src/test/resources/usecases/base.logging/modules/logging.mod b/jetty-start/src/test/resources/usecases/base.logging/modules/logging.mod index e2d24ce6454..0722898bb42 100644 --- a/jetty-start/src/test/resources/usecases/base.logging/modules/logging.mod +++ b/jetty-start/src/test/resources/usecases/base.logging/modules/logging.mod @@ -8,9 +8,9 @@ resources [files] logs/ resources/ -http://central.maven.org/maven2/org/slf4j/slf4j-api/1.6.6/slf4j-api-1.6.6.jar|lib/logging/slf4j-api-1.6.6.jar -http://repo1.maven.org/maven2/ch/qos/logback/logback-core/1.0.7/logback-core-1.0.7.jar|lib/logging/logback-core-1.0.7.jar -http://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.0.7/logback-classic-1.0.7.jar|lib/logging/logback-classic-1.0.7.jar +https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.6.6/slf4j-api-1.6.6.jar|lib/logging/slf4j-api-1.6.6.jar +https://repo1.maven.org/maven2/ch/qos/logback/logback-core/1.0.7/logback-core-1.0.7.jar|lib/logging/logback-core-1.0.7.jar +https://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.0.7/logback-classic-1.0.7.jar|lib/logging/logback-classic-1.0.7.jar https://raw.githubusercontent.com/jetty-project/logging-modules/master/logback/logback.xml|resources/logback.xml https://raw.githubusercontent.com/jetty-project/logging-modules/master/logback/jetty-logging.properties|resources/jetty-logging.properties diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_40.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_40.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_40.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_40.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_45.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_45.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_45.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_45.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_51.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_51.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_51.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_51.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_55.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_55.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_55.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_55.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_60.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_60.mod index 54d37310523..6bfed060e52 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_60.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.7.0_60.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.1.0.v20141016/alpn-boot-7.1.0.v20141016.jar|lib/alpn/alpn-boot-7.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-7.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.8.0.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.8.0.mod index a81732c4533..a157f9cec9f 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.8.0.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.8.0.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.8.0_05.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.8.0_05.mod index a81732c4533..a157f9cec9f 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.8.0_05.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn-1.8.0_05.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.0.v20141016/alpn-boot-8.1.0.v20141016.jar|lib/alpn/alpn-boot-8.1.0.v20141016.jar [exec] -Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn.mod index 0e399f05cb1..b8726e720b0 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/alpn.mod @@ -15,7 +15,7 @@ # Java versions. # # All versions of alpn-boot can be found at -# http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/ +# https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/ [name] protonego-impl diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_04.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_04.mod index 007570b6757..36521de8378 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_04.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_04.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_05.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_05.mod index 007570b6757..36521de8378 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_05.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_05.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_06.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_06.mod index 868a7a77fcb..b80120ef24d 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_06.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_06.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_07.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_07.mod index 868a7a77fcb..b80120ef24d 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_07.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_07.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_09.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_09.mod index 20c1db27bd5..d358a28ec50 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_09.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_09.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_10.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_10.mod index 20c1db27bd5..d358a28ec50 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_10.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_10.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_11.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_11.mod index 20c1db27bd5..d358a28ec50 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_11.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_11.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_13.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_13.mod index 1645a52dba0..853c63a9f21 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_13.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_13.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar|lib/npn/npn-boot-1.1.4.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar|lib/npn/npn-boot-1.1.4.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.4.v20130313.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_15.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_15.mod index 73bc09007eb..56cbf46076c 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_15.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_15.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_17.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_17.mod index 73bc09007eb..56cbf46076c 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_17.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_17.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_21.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_21.mod index 73bc09007eb..56cbf46076c 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_21.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_21.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_25.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_25.mod index 73bc09007eb..56cbf46076c 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_25.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_25.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_40.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_40.mod index 465e6f034b6..19ba6ff4837 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_40.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_40.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_45.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_45.mod index 465e6f034b6..19ba6ff4837 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_45.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_45.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_51.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_51.mod index 465e6f034b6..19ba6ff4837 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_51.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_51.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_55.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_55.mod index 5f8704d68a8..e2625aca585 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_55.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_55.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_60.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_60.mod index 5f8704d68a8..e2625aca585 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_60.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn-1.7.0_60.mod @@ -2,7 +2,7 @@ protonego-boot [files] -http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar +https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.8.v20141013/npn-boot-1.1.8.v20141013.jar|lib/npn/npn-boot-1.1.8.v20141013.jar [exec] -Xbootclasspath/p:lib/npn/npn-boot-1.1.8.v20141013.jar diff --git a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn.mod b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn.mod index 040aad10197..4686cb255a0 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/protonego-impl/npn.mod @@ -14,7 +14,7 @@ # Java versions. # # All versions of npn-boot can be found at -# http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/ +# https://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/ [name] diff --git a/jetty-start/src/test/resources/usecases/home/modules/ssl.mod b/jetty-start/src/test/resources/usecases/home/modules/ssl.mod index 449f58104fb..9fd6f2dcf8f 100644 --- a/jetty-start/src/test/resources/usecases/home/modules/ssl.mod +++ b/jetty-start/src/test/resources/usecases/home/modules/ssl.mod @@ -9,7 +9,7 @@ server etc/jetty-ssl.xml [files] -http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/jetty-server/src/main/config/etc/keystore|etc/keystore +https://github.com/eclipse/jetty.project/raw/jetty-9.2.x/jetty-server/src/main/config/etc/keystore|etc/keystore [ini-template] ## SSL Keystore Configuration From ac724a108d6407bd03626612fe99943df5a7053e Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Sat, 7 Mar 2020 19:48:53 +0100 Subject: [PATCH 03/16] Ignored ExternalSiteTest for reliability. Signed-off-by: Simone Bordet --- .../test/java/org/eclipse/jetty/client/ExternalSiteTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ExternalSiteTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ExternalSiteTest.java index 6f9ee2a203a..3e1e0d87733 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/ExternalSiteTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ExternalSiteTest.java @@ -32,9 +32,11 @@ import org.junit.After; import org.junit.Assert; import org.junit.Assume; import org.junit.Before; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; +@Ignore public class ExternalSiteTest { @Rule From 9182e304438401d0e36097a26d67bb78b9561b5d Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Sat, 7 Mar 2020 19:49:44 +0100 Subject: [PATCH 04/16] Fixed OSGi tests by overriding the Maven Central location used by pax-exam. Signed-off-by: Simone Bordet --- .../org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java index 1785dfb7269..a6762ddda46 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java @@ -84,7 +84,10 @@ public class TestJettyOSGiBootCore String mavenRepoPath = System.getProperty( "mavenRepoPath" ); if (!StringUtil.isBlank( mavenRepoPath)) + { res.add( systemProperty( "org.ops4j.pax.url.mvn.localRepository" ).value( mavenRepoPath ) ); + res.add(systemProperty("org.ops4j.pax.url.mvn.repositories").value("+https://repo1.maven.org/maven2@id=maven.central.repo")); + } res.add(mavenBundle().groupId( "org.ow2.asm" ).artifactId( "asm" ).versionAsInProject().start()); res.add(mavenBundle().groupId( "org.ow2.asm" ).artifactId( "asm-commons" ).versionAsInProject().start()); From 273b7298039e820f7bd89f30988d6f269ccb4475 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Sat, 7 Mar 2020 21:15:13 +0100 Subject: [PATCH 05/16] Updated build to JDK 8 otherwise TLS communication with Maven Central fails due to outdated TLS version/ciphers. Signed-off-by: Simone Bordet --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ad11acdc88a..999c6ba19fd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ #!groovy -def jdk = 'jdk7' +def jdk = 'jdk8' node("linux") { // System Dependent Locations From 1a165aadec5ce98678e1e45a467c3fb5719ae52c Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Sat, 7 Mar 2020 22:05:43 +0100 Subject: [PATCH 06/16] Using JDK 7 for javadocs. Signed-off-by: Simone Bordet --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 999c6ba19fd..d49aee6b2f7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ node("linux") { globalMavenSettingsConfig: settingsName, mavenOpts: mavenOpts, mavenLocalRepo: localRepo) { - sh "mvn -B clean install -Dtest=None" + sh "mvn -B clean install -DskipTests" } } } @@ -40,7 +40,7 @@ node("linux") { timeout(time: 15, unit: 'MINUTES') { withMaven( maven: mvnName, - jdk: "$jdk", + jdk: "jdk7", publisherStrategy: 'EXPLICIT', globalMavenSettingsConfig: settingsName, mavenOpts: mavenOpts, @@ -98,7 +98,7 @@ node("linux") { [parserName: 'JavaDoc'], [parserName: 'JavaC'] ]]) - } + } } } } From 797d25505b92268f74845ab880f40461ccd17019 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Mon, 9 Mar 2020 13:01:52 +1100 Subject: [PATCH 07/16] Issue #4645 - better error message for empty X-Forwarded-Port value Signed-off-by: Lachlan Roberts --- .../jetty/server/ForwardedRequestCustomizer.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java index 4d224dfe3cb..078abfbdc0c 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java @@ -639,19 +639,23 @@ public class ForwardedRequestCustomizer implements Customizer @SuppressWarnings("unused") public void handlePort(HttpField field) { + String port = getLeftMost(field.getValue()); + if (StringUtil.isEmpty(port)) + throw new IllegalArgumentException(field.getName() + " has empty value"); + if (!getForwardedPortAsAuthority()) { if (_for == null) - _for = new PortSetHostPort(_request.getRemoteHost(), Integer.parseInt(getLeftMost(field.getValue()))); + _for = new PortSetHostPort(_request.getRemoteHost(), Integer.parseInt(port)); else if (_for instanceof PossiblyPartialHostPort && _for.getPort() <= 0) - _for = new HostPort(HostPort.normalizeHost(_for.getHost()), Integer.parseInt(getLeftMost(field.getValue()))); + _for = new HostPort(HostPort.normalizeHost(_for.getHost()), Integer.parseInt(port)); } else { if (_host == null) - _host = new PortSetHostPort(_request.getServerName(), Integer.parseInt(getLeftMost(field.getValue()))); + _host = new PortSetHostPort(_request.getServerName(), Integer.parseInt(port)); else if (_host instanceof PossiblyPartialHostPort && _host.getPort() <= 0) - _host = new HostPort(HostPort.normalizeHost(_host.getHost()), Integer.parseInt(getLeftMost(field.getValue()))); + _host = new HostPort(HostPort.normalizeHost(_host.getHost()), Integer.parseInt(port)); } } From dbd89ce1c79ce38265cf6dac3d9307b94023866c Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Wed, 11 Mar 2020 18:31:25 +1100 Subject: [PATCH 08/16] Issue #4645 - validate port range & return 400 on bad forwarded headers Signed-off-by: Lachlan Roberts --- .../server/ForwardedRequestCustomizer.java | 76 ++++++++++++------- .../java/org/eclipse/jetty/util/HostPort.java | 29 +++++-- .../org/eclipse/jetty/util/HostPortTest.java | 5 +- 3 files changed, 74 insertions(+), 36 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java index 078abfbdc0c..ecb95790145 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java @@ -24,6 +24,7 @@ import java.lang.invoke.MethodType; import java.net.InetSocketAddress; import javax.servlet.ServletRequest; +import org.eclipse.jetty.http.BadMessageException; import org.eclipse.jetty.http.HostPortHttpField; import org.eclipse.jetty.http.HttpField; import org.eclipse.jetty.http.HttpFields; @@ -592,16 +593,23 @@ public class ForwardedRequestCustomizer implements Customizer @SuppressWarnings("unused") public void handleHost(HttpField field) { - if (getForwardedPortAsAuthority() && !StringUtil.isEmpty(getForwardedPortHeader())) + try { - if (_host == null) - _host = new PossiblyPartialHostPort(getLeftMost(field.getValue())); - else if (_host instanceof PortSetHostPort) - _host = new HostPort(HostPort.normalizeHost(getLeftMost(field.getValue())), _host.getPort()); + if (getForwardedPortAsAuthority() && !StringUtil.isEmpty(getForwardedPortHeader())) + { + if (_host == null) + _host = new PossiblyPartialHostPort(getLeftMost(field.getValue())); + else if (_host instanceof PortSetHostPort) + _host = new HostPort(HostPort.normalizeHost(getLeftMost(field.getValue())), _host.getPort()); + } + else if (_host == null) + { + _host = new HostPort(getLeftMost(field.getValue())); + } } - else if (_host == null) + catch (Throwable t) { - _host = new HostPort(getLeftMost(field.getValue())); + throw new BadMessageException("Bad header value for " + field.getName()); } } @@ -623,39 +631,51 @@ public class ForwardedRequestCustomizer implements Customizer @SuppressWarnings("unused") public void handleFor(HttpField field) { - if (!getForwardedPortAsAuthority() && !StringUtil.isEmpty(getForwardedPortHeader())) + try { - if (_for == null) - _for = new PossiblyPartialHostPort(getLeftMost(field.getValue())); - else if (_for instanceof PortSetHostPort) - _for = new HostPort(HostPort.normalizeHost(getLeftMost(field.getValue())), _for.getPort()); + String authority = getLeftMost(field.getValue()); + if (!getForwardedPortAsAuthority() && !StringUtil.isEmpty(getForwardedPortHeader())) + { + if (_for == null) + _for = new PossiblyPartialHostPort(authority); + else if (_for instanceof PortSetHostPort) + _for = new HostPort(HostPort.normalizeHost(authority), _for.getPort()); + } + else if (_for == null) + { + _for = new HostPort(authority); + } } - else if (_for == null) + catch (Throwable t) { - _for = new HostPort(getLeftMost(field.getValue())); + throw new BadMessageException("Bad header value for " + field.getName()); } } @SuppressWarnings("unused") public void handlePort(HttpField field) { - String port = getLeftMost(field.getValue()); - if (StringUtil.isEmpty(port)) - throw new IllegalArgumentException(field.getName() + " has empty value"); - - if (!getForwardedPortAsAuthority()) + try { - if (_for == null) - _for = new PortSetHostPort(_request.getRemoteHost(), Integer.parseInt(port)); - else if (_for instanceof PossiblyPartialHostPort && _for.getPort() <= 0) - _for = new HostPort(HostPort.normalizeHost(_for.getHost()), Integer.parseInt(port)); + int port = HostPort.parsePort(getLeftMost(field.getValue())); + if (!getForwardedPortAsAuthority()) + { + if (_for == null) + _for = new PortSetHostPort(_request.getRemoteHost(), port); + else if (_for instanceof PossiblyPartialHostPort && _for.getPort() <= 0) + _for = new HostPort(HostPort.normalizeHost(_for.getHost()), port); + } + else + { + if (_host == null) + _host = new PortSetHostPort(_request.getServerName(), port); + else if (_host instanceof PossiblyPartialHostPort && _host.getPort() <= 0) + _host = new HostPort(HostPort.normalizeHost(_host.getHost()), port); + } } - else + catch (Throwable t) { - if (_host == null) - _host = new PortSetHostPort(_request.getServerName(), Integer.parseInt(port)); - else if (_host instanceof PossiblyPartialHostPort && _host.getPort() <= 0) - _host = new HostPort(HostPort.normalizeHost(_host.getHost()), Integer.parseInt(port)); + throw new BadMessageException("Bad header value for " + field.getName()); } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/HostPort.java b/jetty-util/src/main/java/org/eclipse/jetty/util/HostPort.java index 410b26d3606..546d9bc6d00 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/HostPort.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/HostPort.java @@ -32,7 +32,7 @@ public class HostPort private final String _host; private final int _port; - public HostPort(String host, int port) throws IllegalArgumentException + public HostPort(String host, int port) { _host = host; _port = port; @@ -61,7 +61,7 @@ public class HostPort { if (authority.charAt(close + 1) != ':') throw new IllegalArgumentException("Bad IPv6 port"); - _port = StringUtil.toInt(authority, close + 2); + _port = parsePort(authority.substring(close + 2)); } else _port = 0; @@ -80,7 +80,7 @@ public class HostPort else { _host = authority.substring(0, c); - _port = StringUtil.toInt(authority, c + 1); + _port = parsePort(authority.substring(c + 1)); } } else @@ -103,10 +103,6 @@ public class HostPort } }; } - if (_host == null) - throw new IllegalArgumentException("Bad host"); - if (_port < 0) - throw new IllegalArgumentException("Bad port"); } /** @@ -163,4 +159,23 @@ public class HostPort // normalize with [ ] return "[" + host + "]"; } + + /** + * Parse a string representing a port validating it is a valid port value. + * + * @param rawPort the port string. + * @return the integer value for the port. + * @throws IllegalArgumentException + */ + public static int parsePort(String rawPort) throws IllegalArgumentException + { + if (StringUtil.isEmpty(rawPort)) + throw new IllegalArgumentException("Bad port"); + + int port = Integer.parseInt(rawPort); + if (port <= 0 || port > 65535) + throw new IllegalArgumentException("Bad port"); + + return port; + } } diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/HostPortTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/HostPortTest.java index 07561a53f56..3d7667e59da 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/HostPortTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/HostPortTest.java @@ -43,6 +43,7 @@ public class HostPortTest Arguments.of("[0::0::0::1]", "[0::0::0::1]", null), Arguments.of("[0::0::0::1]:80", "[0::0::0::1]", "80"), Arguments.of("0:1:2:3:4:5:6", "[0:1:2:3:4:5:6]", null), + Arguments.of("127.0.0.1:65535", "127.0.0.1", "65535"), // Localhost tests Arguments.of("localhost:80", "localhost", "80"), Arguments.of("127.0.0.1:80", "127.0.0.1", "80"), @@ -79,7 +80,9 @@ public class HostPortTest "[0::0::0::0::1]:xxx", "host:-80", "127.0.0.1:-80", - "[0::0::0::0::1]:-80") + "[0::0::0::0::1]:-80", + "127.0.0.1:65536" + ) .map(Arguments::of); } From d5ee7b058b04b544af1fb17c1f6ffa1032452693 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Wed, 11 Mar 2020 18:41:41 +1100 Subject: [PATCH 09/16] Issue #4645 - handle exceptions from all headers Signed-off-by: Lachlan Roberts --- .../server/ForwardedRequestCustomizer.java | 96 +++++++++---------- 1 file changed, 46 insertions(+), 50 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java index ecb95790145..7700e91e650 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java @@ -36,6 +36,8 @@ import org.eclipse.jetty.util.ArrayTrie; import org.eclipse.jetty.util.HostPort; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.Trie; +import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; import static java.lang.invoke.MethodType.methodType; @@ -62,6 +64,8 @@ import static java.lang.invoke.MethodType.methodType; */ public class ForwardedRequestCustomizer implements Customizer { + private static final Logger LOG = Log.getLogger(ForwardedRequestCustomizer.class); + private HostPortHttpField _forcedHost; private boolean _proxyAsAuthority = false; private boolean _forwardedPortAsAuthority = true; @@ -381,9 +385,16 @@ public class ForwardedRequestCustomizer implements Customizer { for (HttpField field : httpFields) { - MethodHandle handle = _handles.get(field.getName()); - if (handle != null) - handle.invoke(forwarded, field); + try + { + MethodHandle handle = _handles.get(field.getName()); + if (handle != null) + handle.invoke(forwarded, field); + } + catch (Throwable t) + { + onError(field, t); + } } } catch (Throwable e) @@ -421,6 +432,12 @@ public class ForwardedRequestCustomizer implements Customizer } } + protected void onError(HttpField field, Throwable t) + { + LOG.warn("Exception while processing {}", field, t); + throw new BadMessageException("Bad header value for " + field.getName()); + } + protected String getLeftMost(String headerValue) { if (headerValue == null) @@ -593,23 +610,16 @@ public class ForwardedRequestCustomizer implements Customizer @SuppressWarnings("unused") public void handleHost(HttpField field) { - try + if (getForwardedPortAsAuthority() && !StringUtil.isEmpty(getForwardedPortHeader())) { - if (getForwardedPortAsAuthority() && !StringUtil.isEmpty(getForwardedPortHeader())) - { - if (_host == null) - _host = new PossiblyPartialHostPort(getLeftMost(field.getValue())); - else if (_host instanceof PortSetHostPort) - _host = new HostPort(HostPort.normalizeHost(getLeftMost(field.getValue())), _host.getPort()); - } - else if (_host == null) - { - _host = new HostPort(getLeftMost(field.getValue())); - } + if (_host == null) + _host = new PossiblyPartialHostPort(getLeftMost(field.getValue())); + else if (_host instanceof PortSetHostPort) + _host = new HostPort(HostPort.normalizeHost(getLeftMost(field.getValue())), _host.getPort()); } - catch (Throwable t) + else if (_host == null) { - throw new BadMessageException("Bad header value for " + field.getName()); + _host = new HostPort(getLeftMost(field.getValue())); } } @@ -631,51 +641,37 @@ public class ForwardedRequestCustomizer implements Customizer @SuppressWarnings("unused") public void handleFor(HttpField field) { - try + String authority = getLeftMost(field.getValue()); + if (!getForwardedPortAsAuthority() && !StringUtil.isEmpty(getForwardedPortHeader())) { - String authority = getLeftMost(field.getValue()); - if (!getForwardedPortAsAuthority() && !StringUtil.isEmpty(getForwardedPortHeader())) - { - if (_for == null) - _for = new PossiblyPartialHostPort(authority); - else if (_for instanceof PortSetHostPort) - _for = new HostPort(HostPort.normalizeHost(authority), _for.getPort()); - } - else if (_for == null) - { - _for = new HostPort(authority); - } + if (_for == null) + _for = new PossiblyPartialHostPort(authority); + else if (_for instanceof PortSetHostPort) + _for = new HostPort(HostPort.normalizeHost(authority), _for.getPort()); } - catch (Throwable t) + else if (_for == null) { - throw new BadMessageException("Bad header value for " + field.getName()); + _for = new HostPort(authority); } } @SuppressWarnings("unused") public void handlePort(HttpField field) { - try + int port = HostPort.parsePort(getLeftMost(field.getValue())); + if (!getForwardedPortAsAuthority()) { - int port = HostPort.parsePort(getLeftMost(field.getValue())); - if (!getForwardedPortAsAuthority()) - { - if (_for == null) - _for = new PortSetHostPort(_request.getRemoteHost(), port); - else if (_for instanceof PossiblyPartialHostPort && _for.getPort() <= 0) - _for = new HostPort(HostPort.normalizeHost(_for.getHost()), port); - } - else - { - if (_host == null) - _host = new PortSetHostPort(_request.getServerName(), port); - else if (_host instanceof PossiblyPartialHostPort && _host.getPort() <= 0) - _host = new HostPort(HostPort.normalizeHost(_host.getHost()), port); - } + if (_for == null) + _for = new PortSetHostPort(_request.getRemoteHost(), port); + else if (_for instanceof PossiblyPartialHostPort && _for.getPort() <= 0) + _for = new HostPort(HostPort.normalizeHost(_for.getHost()), port); } - catch (Throwable t) + else { - throw new BadMessageException("Bad header value for " + field.getName()); + if (_host == null) + _host = new PortSetHostPort(_request.getServerName(), port); + else if (_host instanceof PossiblyPartialHostPort && _host.getPort() <= 0) + _host = new HostPort(HostPort.normalizeHost(_host.getHost()), port); } } From 633298b5c7dfee8377c59b3f872f81082049cbf3 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Wed, 11 Mar 2020 22:41:31 +1100 Subject: [PATCH 10/16] Issue #4645 - changes from review Signed-off-by: Lachlan Roberts --- .../server/ForwardedRequestCustomizer.java | 7 +------ .../ForwardedRequestCustomizerTest.java | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java index 7700e91e650..3dc313b49f0 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java @@ -36,8 +36,6 @@ import org.eclipse.jetty.util.ArrayTrie; import org.eclipse.jetty.util.HostPort; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.Trie; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import static java.lang.invoke.MethodType.methodType; @@ -64,8 +62,6 @@ import static java.lang.invoke.MethodType.methodType; */ public class ForwardedRequestCustomizer implements Customizer { - private static final Logger LOG = Log.getLogger(ForwardedRequestCustomizer.class); - private HostPortHttpField _forcedHost; private boolean _proxyAsAuthority = false; private boolean _forwardedPortAsAuthority = true; @@ -434,8 +430,7 @@ public class ForwardedRequestCustomizer implements Customizer protected void onError(HttpField field, Throwable t) { - LOG.warn("Exception while processing {}", field, t); - throw new BadMessageException("Bad header value for " + field.getName()); + throw new BadMessageException("Bad header value for " + field.getName(), t); } protected String getLeftMost(String headerValue) diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java index a6dfa9f58a2..a55fcf82ef4 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java @@ -32,6 +32,7 @@ import org.eclipse.jetty.http.HttpTester; import org.eclipse.jetty.server.handler.AbstractHandler; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -619,6 +620,25 @@ public class ForwardedRequestCustomizerTest expectations.accept(actual); } + @Test + public void testBadInput() throws Exception + { + Request request = new Request("Bad port value") + .headers( + "GET / HTTP/1.1", + "Host: myhost", + "X-Forwarded-Port: " + ); + + request.configure(customizer); + + String rawRequest = request.getRawRequest((header) -> header); + System.out.println(rawRequest); + + HttpTester.Response response = HttpTester.parseResponse(connector.getResponse(rawRequest)); + assertThat("status", response.getStatus(), is(400)); + } + private static class Request { String description; From fcbe704b24ec80cf65876f63caad475f8696d3ee Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Fri, 13 Mar 2020 13:59:43 +1100 Subject: [PATCH 11/16] Issue #4645 - do not wrap exceptions from onError with RuntimeException Signed-off-by: Lachlan Roberts --- .../server/ForwardedRequestCustomizer.java | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java index 3dc313b49f0..bf79bd61e72 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ForwardedRequestCustomizer.java @@ -377,25 +377,18 @@ public class ForwardedRequestCustomizer implements Customizer // Do a single pass through the header fields as it is a more efficient single iteration. Forwarded forwarded = new Forwarded(request, config); - try + for (HttpField field : httpFields) { - for (HttpField field : httpFields) + try { - try - { - MethodHandle handle = _handles.get(field.getName()); - if (handle != null) - handle.invoke(forwarded, field); - } - catch (Throwable t) - { - onError(field, t); - } + MethodHandle handle = _handles.get(field.getName()); + if (handle != null) + handle.invoke(forwarded, field); + } + catch (Throwable t) + { + onError(field, t); } - } - catch (Throwable e) - { - throw new RuntimeException(e); } if (forwarded._proto != null) From fb00422fca1d0b0ae01e0983b6ce3ab8c743512d Mon Sep 17 00:00:00 2001 From: Denny Abraham Cheriyan Date: Mon, 16 Mar 2020 14:51:00 +0530 Subject: [PATCH 12/16] Refactor CrossOriginFilter with small perf improvements (#4672) * Refactor CrossOriginFilter Signed-off-by: Denny Abraham Cheriyan * Fix checkstyle violation Signed-off-by: Denny Abraham Cheriyan --- .../jetty/servlets/CrossOriginFilter.java | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java index 4947adde2dc..d1ae44c9878 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java @@ -23,7 +23,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Enumeration; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.servlet.Filter; @@ -157,8 +159,10 @@ public class CrossOriginFilter implements Filter private boolean anyOriginAllowed; private boolean anyTimingOriginAllowed; private boolean anyHeadersAllowed; - private List allowedOrigins = new ArrayList(); - private List allowedTimingOrigins = new ArrayList(); + private Set allowedOrigins = new HashSet(); + private List allowedOriginPatterns = new ArrayList(); + private Set allowedTimingOrigins = new HashSet(); + private List allowedTimingOriginPatterns = new ArrayList(); private List allowedMethods = new ArrayList(); private List allowedHeaders = new ArrayList(); private List exposedHeaders = new ArrayList(); @@ -172,8 +176,8 @@ public class CrossOriginFilter implements Filter String allowedOriginsConfig = config.getInitParameter(ALLOWED_ORIGINS_PARAM); String allowedTimingOriginsConfig = config.getInitParameter(ALLOWED_TIMING_ORIGINS_PARAM); - anyOriginAllowed = generateAllowedOrigins(allowedOrigins, allowedOriginsConfig, DEFAULT_ALLOWED_ORIGINS); - anyTimingOriginAllowed = generateAllowedOrigins(allowedTimingOrigins, allowedTimingOriginsConfig, DEFAULT_ALLOWED_TIMING_ORIGINS); + anyOriginAllowed = generateAllowedOrigins(allowedOrigins, allowedOriginPatterns, allowedOriginsConfig, DEFAULT_ALLOWED_ORIGINS); + anyTimingOriginAllowed = generateAllowedOrigins(allowedTimingOrigins, allowedTimingOriginPatterns, allowedTimingOriginsConfig, DEFAULT_ALLOWED_TIMING_ORIGINS); String allowedMethodsConfig = config.getInitParameter(ALLOWED_METHODS_PARAM); if (allowedMethodsConfig == null) @@ -235,7 +239,7 @@ public class CrossOriginFilter implements Filter } } - private boolean generateAllowedOrigins(List allowedOriginStore, String allowedOriginsConfig, String defaultOrigin) + private boolean generateAllowedOrigins(Set allowedOriginStore, List allowedOriginPatternStore, String allowedOriginsConfig, String defaultOrigin) { if (allowedOriginsConfig == null) allowedOriginsConfig = defaultOrigin; @@ -247,8 +251,13 @@ public class CrossOriginFilter implements Filter if (ANY_ORIGIN.equals(allowedOrigin)) { allowedOriginStore.clear(); + allowedOriginPatternStore.clear(); return true; } + else if (allowedOrigin.contains("*")) + { + allowedOriginPatternStore.add(Pattern.compile(parseAllowedWildcardOriginToRegex(allowedOrigin))); + } else { allowedOriginStore.add(allowedOrigin); @@ -270,7 +279,7 @@ public class CrossOriginFilter implements Filter // Is it a cross origin request ? if (origin != null && isEnabled(request)) { - if (anyOriginAllowed || originMatches(allowedOrigins, origin)) + if (anyOriginAllowed || originMatches(allowedOrigins, allowedOriginPatterns, origin)) { if (isSimpleRequest(request)) { @@ -292,7 +301,7 @@ public class CrossOriginFilter implements Filter handleSimpleResponse(request, response, origin); } - if (anyTimingOriginAllowed || originMatches(allowedTimingOrigins, origin)) + if (anyTimingOriginAllowed || originMatches(allowedTimingOrigins, allowedTimingOriginPatterns, origin)) { response.setHeader(TIMING_ALLOW_ORIGIN_HEADER, origin); } @@ -330,7 +339,7 @@ public class CrossOriginFilter implements Filter return true; } - private boolean originMatches(List allowedOrigins, String originList) + private boolean originMatches(Set allowedOrigins, List allowedOriginPatterns, String originList) { if (originList.trim().length() == 0) return false; @@ -341,30 +350,18 @@ public class CrossOriginFilter implements Filter if (origin.trim().length() == 0) continue; - for (String allowedOrigin : allowedOrigins) + if (allowedOrigins.contains(origin)) + return true; + + for (Pattern allowedOrigin : allowedOriginPatterns) { - if (allowedOrigin.contains("*")) - { - Matcher matcher = createMatcher(origin, allowedOrigin); - if (matcher.matches()) - return true; - } - else if (allowedOrigin.equals(origin)) - { + if (allowedOrigin.matcher(origin).matches()) return true; - } } } return false; } - private Matcher createMatcher(String origin, String allowedOrigin) - { - String regex = parseAllowedWildcardOriginToRegex(allowedOrigin); - Pattern pattern = Pattern.compile(regex); - return pattern.matcher(origin); - } - private String parseAllowedWildcardOriginToRegex(String allowedOrigin) { String regex = StringUtil.replace(allowedOrigin, ".", "\\."); @@ -507,7 +504,11 @@ public class CrossOriginFilter implements Filter public void destroy() { anyOriginAllowed = false; + anyTimingOriginAllowed = false; allowedOrigins.clear(); + allowedOriginPatterns.clear(); + allowedTimingOrigins.clear(); + allowedTimingOriginPatterns.clear(); allowedMethods.clear(); allowedHeaders.clear(); preflightMaxAge = 0; From ce8d2ef16875169c06d9766b695ac95e438d48e7 Mon Sep 17 00:00:00 2001 From: Denny Abraham Cheriyan Date: Mon, 16 Mar 2020 14:51:00 +0530 Subject: [PATCH 13/16] Refactor CrossOriginFilter with small perf improvements (#4672) * Refactor CrossOriginFilter Signed-off-by: Denny Abraham Cheriyan * Fix checkstyle violation Signed-off-by: Denny Abraham Cheriyan --- .../jetty/servlets/CrossOriginFilter.java | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java index 8dae56099a5..184f76cde28 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java @@ -23,7 +23,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Enumeration; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.servlet.Filter; @@ -157,8 +159,10 @@ public class CrossOriginFilter implements Filter private boolean anyOriginAllowed; private boolean anyTimingOriginAllowed; private boolean anyHeadersAllowed; - private List allowedOrigins = new ArrayList(); - private List allowedTimingOrigins = new ArrayList(); + private Set allowedOrigins = new HashSet(); + private List allowedOriginPatterns = new ArrayList(); + private Set allowedTimingOrigins = new HashSet(); + private List allowedTimingOriginPatterns = new ArrayList(); private List allowedMethods = new ArrayList(); private List allowedHeaders = new ArrayList(); private List exposedHeaders = new ArrayList(); @@ -172,8 +176,8 @@ public class CrossOriginFilter implements Filter String allowedOriginsConfig = config.getInitParameter(ALLOWED_ORIGINS_PARAM); String allowedTimingOriginsConfig = config.getInitParameter(ALLOWED_TIMING_ORIGINS_PARAM); - anyOriginAllowed = generateAllowedOrigins(allowedOrigins, allowedOriginsConfig, DEFAULT_ALLOWED_ORIGINS); - anyTimingOriginAllowed = generateAllowedOrigins(allowedTimingOrigins, allowedTimingOriginsConfig, DEFAULT_ALLOWED_TIMING_ORIGINS); + anyOriginAllowed = generateAllowedOrigins(allowedOrigins, allowedOriginPatterns, allowedOriginsConfig, DEFAULT_ALLOWED_ORIGINS); + anyTimingOriginAllowed = generateAllowedOrigins(allowedTimingOrigins, allowedTimingOriginPatterns, allowedTimingOriginsConfig, DEFAULT_ALLOWED_TIMING_ORIGINS); String allowedMethodsConfig = config.getInitParameter(ALLOWED_METHODS_PARAM); if (allowedMethodsConfig == null) @@ -235,7 +239,7 @@ public class CrossOriginFilter implements Filter } } - private boolean generateAllowedOrigins(List allowedOriginStore, String allowedOriginsConfig, String defaultOrigin) + private boolean generateAllowedOrigins(Set allowedOriginStore, List allowedOriginPatternStore, String allowedOriginsConfig, String defaultOrigin) { if (allowedOriginsConfig == null) allowedOriginsConfig = defaultOrigin; @@ -247,8 +251,13 @@ public class CrossOriginFilter implements Filter if (ANY_ORIGIN.equals(allowedOrigin)) { allowedOriginStore.clear(); + allowedOriginPatternStore.clear(); return true; } + else if (allowedOrigin.contains("*")) + { + allowedOriginPatternStore.add(Pattern.compile(parseAllowedWildcardOriginToRegex(allowedOrigin))); + } else { allowedOriginStore.add(allowedOrigin); @@ -270,7 +279,7 @@ public class CrossOriginFilter implements Filter // Is it a cross origin request ? if (origin != null && isEnabled(request)) { - if (anyOriginAllowed || originMatches(allowedOrigins, origin)) + if (anyOriginAllowed || originMatches(allowedOrigins, allowedOriginPatterns, origin)) { if (isSimpleRequest(request)) { @@ -292,7 +301,7 @@ public class CrossOriginFilter implements Filter handleSimpleResponse(request, response, origin); } - if (anyTimingOriginAllowed || originMatches(allowedTimingOrigins, origin)) + if (anyTimingOriginAllowed || originMatches(allowedTimingOrigins, allowedTimingOriginPatterns, origin)) { response.setHeader(TIMING_ALLOW_ORIGIN_HEADER, origin); } @@ -330,7 +339,7 @@ public class CrossOriginFilter implements Filter return true; } - private boolean originMatches(List allowedOrigins, String originList) + private boolean originMatches(Set allowedOrigins, List allowedOriginPatterns, String originList) { if (originList.trim().length() == 0) return false; @@ -341,30 +350,18 @@ public class CrossOriginFilter implements Filter if (origin.trim().length() == 0) continue; - for (String allowedOrigin : allowedOrigins) + if (allowedOrigins.contains(origin)) + return true; + + for (Pattern allowedOrigin : allowedOriginPatterns) { - if (allowedOrigin.contains("*")) - { - Matcher matcher = createMatcher(origin, allowedOrigin); - if (matcher.matches()) - return true; - } - else if (allowedOrigin.equals(origin)) - { + if (allowedOrigin.matcher(origin).matches()) return true; - } } } return false; } - private Matcher createMatcher(String origin, String allowedOrigin) - { - String regex = parseAllowedWildcardOriginToRegex(allowedOrigin); - Pattern pattern = Pattern.compile(regex); - return pattern.matcher(origin); - } - private String parseAllowedWildcardOriginToRegex(String allowedOrigin) { String regex = StringUtil.replace(allowedOrigin, ".", "\\."); @@ -505,7 +502,11 @@ public class CrossOriginFilter implements Filter public void destroy() { anyOriginAllowed = false; + anyTimingOriginAllowed = false; allowedOrigins.clear(); + allowedOriginPatterns.clear(); + allowedTimingOrigins.clear(); + allowedTimingOriginPatterns.clear(); allowedMethods.clear(); allowedHeaders.clear(); preflightMaxAge = 0; From bc60ff1c743441cdaf1c263026ef912bee7e7c60 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Mon, 16 Mar 2020 11:12:39 +0100 Subject: [PATCH 14/16] Fixes #4676 - ALPN support for Java 15. Signed-off-by: Simone Bordet --- .../src/main/config/modules/alpn-impl/alpn-15.mod | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-15.mod diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-15.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-15.mod new file mode 100644 index 00000000000..eebcdb72615 --- /dev/null +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-15.mod @@ -0,0 +1,4 @@ +DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[depend] +alpn-impl/alpn-11 From 8b7e64915f9e6d7be6ca69cc1143931e1b35fde2 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 24 Feb 2020 13:20:51 -0600 Subject: [PATCH 15/16] Issue #4572 - Replace Jetty Logging with SLF4J * Introducing jetty-slf4j-impl * Make Jetty use org.slf4j * Removed most of org.eclipse.jetty.util.log classes * Left org.eclipse.jetty.util.log.Log and org.eclipse.jetty.util.log.Logger but as simple bridge classes that are deprecated * Migrated code using org.eclipse.jetty.util.log.StacklessLogging to org.eclipse.jetty.logging.StacklessLogging found in the jetty-slf4j-impl * Moved logging start modules from jetty-util to jetty-home * Simplified logging start modules * Updated code that was using StdErrLog directly * Updating module-info.java for org.slf4j * removing org.eclipse.jetty.util.log.class references * jetty-start supports manually declared default provider + and we use it to default "logging" to the "logging-jetty" provider * Cleaning up jetty-maven-plugin and IT testing for Logging * Using old slf4j for it testing * Updating compiler config to show Xlint:exports warnings * Updating console-capture and logging-noop * Adding slf4j bridge (capture) jetty modules * Updates to jetty logging module locations * Changing reference to slf4j dependent mod * Process requested enabled modules in topological order * Limiting inclusions in shaded jetty-start + Also adding note to jetty-util classes that are used by jetty-start * Default logging level on baseline logging config is INFO (not DEBUG) * Changing from system to server classes in logging * Updating other modules to use new logging names Signed-off-by: Joakim Erdfelt --- apache-jsp/pom.xml | 4 + apache-jsp/src/main/java/module-info.java | 1 + .../org/eclipse/jetty/apache/jsp/JuliLog.java | 21 +- .../test/resources/jetty-logging.properties | 2 +- examples/embedded/pom.xml | 8 + .../main/resources/jetty-logging.properties | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../src/main/java/module-info.java | 1 + .../TestAnnotationIntrospector.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- jetty-client/pom.xml | 6 +- jetty-client/src/main/java/module-info.java | 1 + .../eclipse/jetty/client/HttpClientTest.java | 2 +- .../client/HttpConnectionLifecycleTest.java | 2 +- .../jetty/client/HttpRequestAbortTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- jetty-deploy/pom.xml | 4 + jetty-deploy/src/main/java/module-info.java | 1 + .../jetty/deploy/BadAppDeployTest.java | 17 +- .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- jetty-fcgi/fcgi-server/pom.xml | 4 + .../src/main/java/module-info.java | 1 + .../server/proxy/FastCGIProxyServlet.java | 2 +- .../jetty/fcgi/server/HttpClientTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../modules/gcloud-datastore.mod | 4 +- jetty-home/pom.xml | 32 + .../resources/etc/logging-jul-capture.xml | 5 + .../resources/modules/logging-jcl-capture.mod | 24 +- .../main/resources/modules/logging-jetty.mod | 24 + .../resources/modules/logging-jul-capture.mod | 47 + .../main/resources/modules/logging-jul.mod | 53 ++ .../modules/logging-log4j1-capture.mod | 44 + .../main/resources/modules/logging-log4j1.mod | 58 ++ .../main/resources/modules/logging-log4j2.mod | 35 + .../resources/modules/logging-logback.mod | 45 + .../main/resources/modules/logging-noop.mod | 13 + .../jetty/resources/jetty-logging.properties | 8 + .../resources/java-util-logging.properties | 13 + .../logging/log4j1/resources/log4j.xml | 15 + .../logging/log4j2/resources/log4j2.xml | 13 + .../logging/logback/resources/logback.xml | 11 + .../main/resources/modules/logging/slf4j.mod | 18 + jetty-http/src/main/java/module-info.java | 1 + .../eclipse/jetty/http/HttpParserTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../jetty/http2/client/StreamResetTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../jetty/http2/server/HTTP2ServerTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- jetty-io/src/main/java/module-info.java | 1 + .../eclipse/jetty/io/WriteFlusherTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- jetty-jaas/src/main/java/module-info.java | 1 + jetty-jaspi/src/main/java/module-info.java | 1 + jetty-jmx/src/main/java/module-info.java | 1 + .../eclipse/jetty/util/log/jmx/LogMBean.java | 60 -- .../java/org/eclipse/jetty/jmx/PojoTest.java | 3 +- .../jetty/util/log/jmx/LogMBeanTest.java | 60 -- .../test/resources/jetty-logging.properties | 2 +- jetty-jndi/src/main/java/module-info.java | 1 + jetty-maven-plugin/pom.xml | 8 +- .../src/it/javax-annotation-api/pom.xml | 18 +- .../src/main/resources/log4j.xml | 15 + ...sLoadingTestingServletContextListener.java | 1 - .../src/main/webapp/WEB-INF/web.xml | 6 +- .../jetty/maven/plugin/AbstractForker.java | 8 +- .../maven/plugin/AbstractWebAppMojo.java | 4 +- .../jetty/maven/plugin/JettyForkedChild.java | 6 +- .../plugin/MavenMetaInfConfiguration.java | 6 +- .../plugin/MavenQuickStartConfiguration.java | 6 +- .../maven/plugin/MavenWebAppContext.java | 8 +- .../plugin/MavenWebInfConfiguration.java | 6 +- .../maven/plugin/SelectiveJarResource.java | 6 +- .../jetty/maven/plugin/TestForkedChild.java | 11 +- .../jetty/maven/plugin/TestJettyEmbedder.java | 6 +- .../plugin/TestWebAppPropertyConverter.java | 3 +- .../plugin/it/IntegrationTestGetContent.java | 8 +- .../src/test/resources/embedder-context.xml | 6 +- .../session-data-cache/xmemcached.mod | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../eclipse/jetty/osgi/test/TestOSGiUtil.java | 5 +- jetty-plus/src/main/java/module-info.java | 1 + jetty-proxy/pom.xml | 4 + jetty-proxy/src/main/java/module-info.java | 1 + .../jetty/proxy/AbstractProxyServlet.java | 12 +- .../org/eclipse/jetty/proxy/ProxyServlet.java | 2 +- .../proxy/AsyncMiddleManServletTest.java | 2 +- .../jetty/proxy/ProxyServletFailureTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + jetty-rewrite/src/main/java/module-info.java | 1 + jetty-security/src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 3 +- jetty-server/pom.xml | 4 + .../src/main/config/modules/server.mod | 2 +- jetty-server/src/main/java/module-info.java | 1 + .../jetty/server/Slf4jRequestLogWriter.java | 6 +- .../jetty/server/handler/ContextHandler.java | 9 +- .../jetty/server/AbstractHttpTest.java | 2 +- .../jetty/server/ConnectorTimeoutTest.java | 2 +- .../jetty/server/ErrorHandlerTest.java | 2 +- .../jetty/server/HttpConnectionTest.java | 17 +- .../server/HttpManyWaysToAsyncCommitTest.java | 2 +- .../jetty/server/HttpServerTestBase.java | 8 +- .../jetty/server/PartialRFC2616Test.java | 2 +- .../jetty/server/ProxyConnectionTest.java | 2 +- .../org/eclipse/jetty/server/RequestTest.java | 3 +- .../jetty/server/ServerConnectorTest.java | 2 +- .../server/ServerConnectorTimeoutTest.java | 2 +- .../server/handler/NcsaRequestLogTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- jetty-servlet/src/main/java/module-info.java | 1 + .../jetty/servlet/AsyncContextTest.java | 2 +- .../jetty/servlet/AsyncServletTest.java | 2 +- .../jetty/servlet/DefaultServletTest.java | 2 +- .../eclipse/jetty/servlet/DispatcherTest.java | 2 +- .../eclipse/jetty/servlet/ErrorPageTest.java | 2 +- .../jetty/servlet/FilterHolderTest.java | 12 +- .../jetty/servlet/ListenerHolderTest.java | 2 +- .../jetty/servlet/MultiPartServletTest.java | 2 +- .../jetty/servlet/PostServletTest.java | 2 +- .../servlet/ServletContextHandlerTest.java | 17 +- .../jetty/servlet/ServletHolderTest.java | 13 +- .../test/resources/jetty-logging.properties | 2 +- jetty-servlets/src/main/java/module-info.java | 1 + .../jetty/servlets/ThreadStarvationTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- jetty-slf4j-impl/pom.xml | 38 + .../src/main/java/module-info.java | 14 +- .../eclipse/jetty/logging/JettyAppender.java | 12 +- .../eclipse/jetty/logging/JettyLogger.java | 678 ++++++++++++++ .../logging/JettyLoggerConfiguration.java | 332 +++++++ .../jetty/logging/JettyLoggerFactory.java | 182 ++++ .../logging/JettyLoggingServiceProvider.java | 78 ++ .../jetty/logging/StacklessLogging.java | 123 +++ .../eclipse/jetty/logging/StdErrAppender.java | 255 ++++++ .../org/eclipse/jetty/logging/Timestamp.java | 118 +++ .../org.slf4j.spi.SLF4JServiceProvider | 1 + .../eclipse/jetty/logging/CapturedStream.java | 28 +- .../logging/JettyLoggerConfigurationTest.java | 264 ++++++ .../jetty/logging/JettyLoggerTest.java | 614 +++++++++++++ .../eclipse/jetty/logging/Slf4jEffort.java | 240 +++++ .../jetty/logging/StdErrAppenderTest.java | 49 + jetty-spring/src/main/java/module-info.java | 1 + jetty-start/pom.xml | 10 + .../org/eclipse/jetty/start/BaseBuilder.java | 2 +- .../java/org/eclipse/jetty/start/Main.java | 2 +- .../java/org/eclipse/jetty/start/Modules.java | 113 ++- .../org/eclipse/jetty/start/StartArgs.java | 2 +- .../org/eclipse/jetty/start/StartLog.java | 9 +- .../org/eclipse/jetty/start/MainTest.java | 41 + .../org/eclipse/jetty/start/TestUseCases.java | 50 +- .../resources/assert-providers-default.txt | 11 + .../resources/assert-providers-specific.txt | 11 + .../providers-home/etc/logging-a.xml | 0 .../providers-home/etc/logging-b.xml | 0 .../providers-home/etc/logging-c.xml | 0 .../providers-home/modules/logging-a.mod | 12 + .../providers-home/modules/logging-b.mod | 12 + .../providers-home/modules/logging-c.mod | 12 + .../providers-home/modules/server.mod | 8 + .../test/resources/usecases/loop.prepare.txt | 1 + .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + jetty-util/pom.xml | 13 +- .../src/main/config/etc/console-capture.xml | 62 +- .../main/config/modules/console-capture.mod | 3 + .../src/main/config/modules/jcl-slf4j.mod | 25 - .../src/main/config/modules/jul-impl.mod | 20 - .../jul-impl/etc/java-util-logging.properties | 12 - .../src/main/config/modules/jul-slf4j.mod | 28 - .../etc/java-util-logging.properties | 2 - .../src/main/config/modules/log4j-impl.mod | 32 - .../modules/log4j-impl/resources/log4j.xml | 28 - .../src/main/config/modules/log4j2-api.mod | 28 - .../src/main/config/modules/log4j2-impl.mod | 27 - .../modules/log4j2-impl/resources/log4j2.xml | 45 - .../src/main/config/modules/log4j2-slf4j.mod | 25 - .../src/main/config/modules/logback-impl.mod | 40 - .../logback-impl/resources/logback.xml | 31 - .../src/main/config/modules/logging-jetty.mod | 17 - .../resources/jetty-logging.properties | 12 - .../src/main/config/modules/logging-jul.mod | 18 - .../src/main/config/modules/logging-log4j.mod | 18 - .../main/config/modules/logging-log4j2.mod | 18 - .../main/config/modules/logging-logback.mod | 18 - .../src/main/config/modules/logging-slf4j.mod | 18 - .../src/main/config/modules/slf4j-jul.mod | 22 - .../src/main/config/modules/slf4j-log4j.mod | 25 - .../src/main/config/modules/slf4j-log4j2.mod | 25 - .../src/main/config/modules/slf4j-logback.mod | 24 - .../main/config/modules/slf4j-simple-impl.mod | 24 - .../resources/simplelogger.properties | 6 - jetty-util/src/main/java/module-info.java | 5 +- .../org/eclipse/jetty/util/JavaVersion.java | 2 + .../org/eclipse/jetty/util/ManifestUtils.java | 2 + .../eclipse/jetty/util/TopologicalSort.java | 2 + .../jetty/util/log/AbstractLogger.java | 257 ------ .../eclipse/jetty/util/log/JavaUtilLog.java | 303 ------ .../jetty/util/log/JettyAwareLogger.java | 446 --------- .../jetty/util/log/JettyLogHandler.java | 198 ---- .../java/org/eclipse/jetty/util/log/Log.java | 291 +----- .../org/eclipse/jetty/util/log/Logger.java | 5 +- .../org/eclipse/jetty/util/log/LoggerLog.java | 243 ----- .../org/eclipse/jetty/util/log/Slf4jLog.java | 152 --- .../eclipse/jetty/util/log/Slf4jLogger.java | 123 +++ .../jetty/util/log/StacklessLogging.java | 86 -- .../org/eclipse/jetty/util/log/StdErrLog.java | 688 -------------- .../util/component/LifeCycleListenerTest.java | 2 +- .../java/org/eclipse/jetty/util/log/Blue.java | 32 - .../jetty/util/log/CapturingJULHandler.java | 87 -- .../org/eclipse/jetty/util/log/Green.java | 32 - .../jetty/util/log/JavaUtilLogTest.java | 243 ----- .../org/eclipse/jetty/util/log/LogTest.java | 141 --- .../eclipse/jetty/util/log/NamedLogTest.java | 59 -- .../java/org/eclipse/jetty/util/log/Red.java | 32 - .../eclipse/jetty/util/log/Slf4jHelper.java | 61 -- .../eclipse/jetty/util/log/StdErrLogTest.java | 862 ------------------ .../jetty/util/ssl/SslContextFactoryTest.java | 2 +- .../jetty/util/thread/EatWhatYouKillTest.java | 2 +- .../util/thread/QueuedThreadPoolTest.java | 2 +- .../jetty/util/thread/SchedulerTest.java | 2 +- .../jetty/util/thread/SweeperTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- jetty-webapp/src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../core/ParserBadCloseStatusCodesTest.java | 2 +- .../websocket/core/ParserBadOpCodesTest.java | 2 +- .../websocket/core/ParserReservedBitTest.java | 2 +- .../websocket/core/WebSocketCloseTest.java | 2 +- .../core/WebSocketNegotiationTest.java | 2 +- .../websocket/core/WebSocketOpenTest.java | 2 +- .../core/proxy/WebSocketProxyTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../misbehaving/MisbehavingClassTest.java | 2 +- .../javax/tests/server/IdleTimeoutTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../jetty/websocket/tests/ErrorCloseTest.java | 2 +- .../tests/JettyWebSocketNegotiationTest.java | 2 +- .../tests/WebSocketOverHTTP2Test.java | 2 +- .../tests/server/FrameAnnotationTest.java | 2 +- .../tests/server/FrameListenerTest.java | 2 +- .../tests/server/PartialListenerTest.java | 2 +- .../tests/server/ServerCloseTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../src/main/java/module-info.java | 1 + .../src/main/java/module-info.java | 1 + .../test/resources/jetty-logging.properties | 2 +- jetty-xml/src/main/java/module-info.java | 1 + .../jetty/xml/XmlConfigurationTest.java | 158 ++-- .../test/resources/jetty-logging.properties | 2 +- pom.xml | 14 +- .../LogCondensePackageStringBenchmark.java | 65 -- .../main/resources/jetty-logging.properties | 2 +- tests/test-distribution/pom.xml | 4 - .../distribution/DistributionTester.java | 8 +- .../test/resources/jetty-logging.properties | 2 +- .../src/test/resources/test-realm.xml | 45 +- .../jetty/http/client/AsyncIOServletTest.java | 2 +- .../jetty/http/client/ServerTimeoutsTest.java | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../jetty/test/DeploymentErrorTest.java | 2 +- .../jetty/test/FailedSelectorTest.java | 2 +- .../jetty/test/rfcs/RFC2616BaseTest.java | 2 +- .../test/resources/jetty-logging.properties | 4 +- .../test/resources/jetty-logging.properties | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../ReloadedSessionMissingClassTest.java | 5 +- .../test/resources/jetty-logging.properties | 3 +- .../session/AbstractSessionCacheTest.java | 6 +- .../jetty/server/session/AsyncTest.java | 17 +- .../jetty/server/session/CreationTest.java | 15 +- .../session/DeleteUnloadableSessionTest.java | 5 +- .../server/session/DuplicateCookieTest.java | 11 +- .../jetty/server/session/IdleSessionTest.java | 7 +- .../server/session/SaveOptimizeTest.java | 15 +- .../session/SessionEvictionFailureTest.java | 5 +- .../test/resources/jetty-logging.properties | 2 +- .../test/resources/jetty-logging.properties | 2 +- .../main/config/demo-base/etc/test-realm.xml | 43 +- .../java/org/eclipse/jetty/TestServer.java | 3 - .../test/resources/jetty-logging.properties | 2 +- .../jetty/TestTransparentProxyServer.java | 3 - 319 files changed, 4419 insertions(+), 5511 deletions(-) create mode 100644 jetty-home/src/main/resources/etc/logging-jul-capture.xml rename jetty-util/src/main/config/modules/slf4j-api.mod => jetty-home/src/main/resources/modules/logging-jcl-capture.mod (74%) create mode 100644 jetty-home/src/main/resources/modules/logging-jetty.mod create mode 100644 jetty-home/src/main/resources/modules/logging-jul-capture.mod create mode 100644 jetty-home/src/main/resources/modules/logging-jul.mod create mode 100644 jetty-home/src/main/resources/modules/logging-log4j1-capture.mod create mode 100644 jetty-home/src/main/resources/modules/logging-log4j1.mod create mode 100644 jetty-home/src/main/resources/modules/logging-log4j2.mod create mode 100644 jetty-home/src/main/resources/modules/logging-logback.mod create mode 100644 jetty-home/src/main/resources/modules/logging-noop.mod create mode 100644 jetty-home/src/main/resources/modules/logging/jetty/resources/jetty-logging.properties create mode 100644 jetty-home/src/main/resources/modules/logging/jul/resources/java-util-logging.properties create mode 100644 jetty-home/src/main/resources/modules/logging/log4j1/resources/log4j.xml create mode 100644 jetty-home/src/main/resources/modules/logging/log4j2/resources/log4j2.xml create mode 100644 jetty-home/src/main/resources/modules/logging/logback/resources/logback.xml create mode 100644 jetty-home/src/main/resources/modules/logging/slf4j.mod delete mode 100644 jetty-jmx/src/main/java/org/eclipse/jetty/util/log/jmx/LogMBean.java delete mode 100644 jetty-jmx/src/test/java/org/eclipse/jetty/util/log/jmx/LogMBeanTest.java create mode 100644 jetty-maven-plugin/src/it/javax-annotation-api/src/main/resources/log4j.xml create mode 100644 jetty-slf4j-impl/pom.xml rename jetty-util/src/main/java/org/eclipse/jetty/util/log/package-info.java => jetty-slf4j-impl/src/main/java/module-info.java (72%) rename jetty-jmx/src/main/java/org/eclipse/jetty/util/log/jmx/package-info.java => jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyAppender.java (74%) create mode 100644 jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLogger.java create mode 100644 jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerConfiguration.java create mode 100644 jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactory.java create mode 100644 jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingServiceProvider.java create mode 100644 jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/StacklessLogging.java create mode 100644 jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/StdErrAppender.java create mode 100644 jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/Timestamp.java create mode 100644 jetty-slf4j-impl/src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider rename jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrCapture.java => jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/CapturedStream.java (74%) create mode 100644 jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JettyLoggerConfigurationTest.java create mode 100644 jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JettyLoggerTest.java create mode 100644 jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/Slf4jEffort.java create mode 100644 jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/StdErrAppenderTest.java create mode 100644 jetty-start/src/test/resources/assert-providers-default.txt create mode 100644 jetty-start/src/test/resources/assert-providers-specific.txt create mode 100644 jetty-start/src/test/resources/providers-home/etc/logging-a.xml create mode 100644 jetty-start/src/test/resources/providers-home/etc/logging-b.xml create mode 100644 jetty-start/src/test/resources/providers-home/etc/logging-c.xml create mode 100644 jetty-start/src/test/resources/providers-home/modules/logging-a.mod create mode 100644 jetty-start/src/test/resources/providers-home/modules/logging-b.mod create mode 100644 jetty-start/src/test/resources/providers-home/modules/logging-c.mod create mode 100644 jetty-start/src/test/resources/providers-home/modules/server.mod delete mode 100644 jetty-util/src/main/config/modules/jcl-slf4j.mod delete mode 100644 jetty-util/src/main/config/modules/jul-impl.mod delete mode 100644 jetty-util/src/main/config/modules/jul-impl/etc/java-util-logging.properties delete mode 100644 jetty-util/src/main/config/modules/jul-slf4j.mod delete mode 100644 jetty-util/src/main/config/modules/jul-slf4j/etc/java-util-logging.properties delete mode 100644 jetty-util/src/main/config/modules/log4j-impl.mod delete mode 100644 jetty-util/src/main/config/modules/log4j-impl/resources/log4j.xml delete mode 100644 jetty-util/src/main/config/modules/log4j2-api.mod delete mode 100644 jetty-util/src/main/config/modules/log4j2-impl.mod delete mode 100644 jetty-util/src/main/config/modules/log4j2-impl/resources/log4j2.xml delete mode 100644 jetty-util/src/main/config/modules/log4j2-slf4j.mod delete mode 100644 jetty-util/src/main/config/modules/logback-impl.mod delete mode 100644 jetty-util/src/main/config/modules/logback-impl/resources/logback.xml delete mode 100644 jetty-util/src/main/config/modules/logging-jetty.mod delete mode 100644 jetty-util/src/main/config/modules/logging-jetty/resources/jetty-logging.properties delete mode 100644 jetty-util/src/main/config/modules/logging-jul.mod delete mode 100644 jetty-util/src/main/config/modules/logging-log4j.mod delete mode 100644 jetty-util/src/main/config/modules/logging-log4j2.mod delete mode 100644 jetty-util/src/main/config/modules/logging-logback.mod delete mode 100644 jetty-util/src/main/config/modules/logging-slf4j.mod delete mode 100644 jetty-util/src/main/config/modules/slf4j-jul.mod delete mode 100644 jetty-util/src/main/config/modules/slf4j-log4j.mod delete mode 100644 jetty-util/src/main/config/modules/slf4j-log4j2.mod delete mode 100644 jetty-util/src/main/config/modules/slf4j-logback.mod delete mode 100644 jetty-util/src/main/config/modules/slf4j-simple-impl.mod delete mode 100644 jetty-util/src/main/config/modules/slf4j-simple-impl/resources/simplelogger.properties delete mode 100644 jetty-util/src/main/java/org/eclipse/jetty/util/log/AbstractLogger.java delete mode 100644 jetty-util/src/main/java/org/eclipse/jetty/util/log/JavaUtilLog.java delete mode 100644 jetty-util/src/main/java/org/eclipse/jetty/util/log/JettyAwareLogger.java delete mode 100644 jetty-util/src/main/java/org/eclipse/jetty/util/log/JettyLogHandler.java delete mode 100644 jetty-util/src/main/java/org/eclipse/jetty/util/log/LoggerLog.java delete mode 100644 jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java create mode 100644 jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLogger.java delete mode 100644 jetty-util/src/main/java/org/eclipse/jetty/util/log/StacklessLogging.java delete mode 100644 jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java delete mode 100644 jetty-util/src/test/java/org/eclipse/jetty/util/log/Blue.java delete mode 100644 jetty-util/src/test/java/org/eclipse/jetty/util/log/CapturingJULHandler.java delete mode 100644 jetty-util/src/test/java/org/eclipse/jetty/util/log/Green.java delete mode 100644 jetty-util/src/test/java/org/eclipse/jetty/util/log/JavaUtilLogTest.java delete mode 100644 jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java delete mode 100644 jetty-util/src/test/java/org/eclipse/jetty/util/log/NamedLogTest.java delete mode 100644 jetty-util/src/test/java/org/eclipse/jetty/util/log/Red.java delete mode 100644 jetty-util/src/test/java/org/eclipse/jetty/util/log/Slf4jHelper.java delete mode 100644 jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java delete mode 100644 tests/jetty-jmh/src/main/java/org/eclipse/jetty/util/logs/LogCondensePackageStringBenchmark.java diff --git a/apache-jsp/pom.xml b/apache-jsp/pom.xml index 4220f823685..4b0a2b9ddd1 100644 --- a/apache-jsp/pom.xml +++ b/apache-jsp/pom.xml @@ -63,6 +63,10 @@
+ + org.slf4j + slf4j-api + org.eclipse.jetty jetty-util diff --git a/apache-jsp/src/main/java/module-info.java b/apache-jsp/src/main/java/module-info.java index 18545591505..018320716a0 100644 --- a/apache-jsp/src/main/java/module-info.java +++ b/apache-jsp/src/main/java/module-info.java @@ -29,6 +29,7 @@ module org.eclipse.jetty.apache.jsp requires java.xml; requires jetty.servlet.api; + requires org.slf4j; requires org.eclipse.jetty.util; requires org.mortbay.apache.jasper; diff --git a/apache-jsp/src/main/java/org/eclipse/jetty/apache/jsp/JuliLog.java b/apache-jsp/src/main/java/org/eclipse/jetty/apache/jsp/JuliLog.java index 961a0de9125..b85aecfbabc 100644 --- a/apache-jsp/src/main/java/org/eclipse/jetty/apache/jsp/JuliLog.java +++ b/apache-jsp/src/main/java/org/eclipse/jetty/apache/jsp/JuliLog.java @@ -18,6 +18,8 @@ package org.eclipse.jetty.apache.jsp; +import org.slf4j.LoggerFactory; + public class JuliLog implements org.apache.juli.logging.Log { public static org.apache.juli.logging.Log getInstance(String name) @@ -25,19 +27,16 @@ public class JuliLog implements org.apache.juli.logging.Log return new JuliLog(name); } - private final org.eclipse.jetty.util.log.Logger _logger; - private final org.eclipse.jetty.util.log.StdErrLog _stdErrLog; + private final org.slf4j.Logger _logger; public JuliLog() { - _logger = org.eclipse.jetty.util.log.Log.getRootLogger(); - _stdErrLog = (_logger instanceof org.eclipse.jetty.util.log.StdErrLog) ? (org.eclipse.jetty.util.log.StdErrLog)_logger : null; + _logger = LoggerFactory.getLogger(""); } public JuliLog(String name) { - _logger = org.eclipse.jetty.util.log.Log.getLogger(name); - _stdErrLog = (_logger instanceof org.eclipse.jetty.util.log.StdErrLog) ? (org.eclipse.jetty.util.log.StdErrLog)_logger : null; + _logger = LoggerFactory.getLogger(name); } @Override @@ -49,31 +48,31 @@ public class JuliLog implements org.apache.juli.logging.Log @Override public boolean isErrorEnabled() { - return _stdErrLog == null ? true : _stdErrLog.getLevel() <= org.eclipse.jetty.util.log.StdErrLog.LEVEL_WARN; + return _logger.isErrorEnabled(); } @Override public boolean isFatalEnabled() { - return _stdErrLog == null ? true : _stdErrLog.getLevel() <= org.eclipse.jetty.util.log.StdErrLog.LEVEL_WARN; + return _logger.isErrorEnabled(); } @Override public boolean isInfoEnabled() { - return _stdErrLog == null ? true : _stdErrLog.getLevel() <= org.eclipse.jetty.util.log.StdErrLog.LEVEL_INFO; + return _logger.isInfoEnabled(); } @Override public boolean isTraceEnabled() { - return _stdErrLog == null ? true : _stdErrLog.getLevel() <= org.eclipse.jetty.util.log.StdErrLog.LEVEL_DEBUG; + return _logger.isTraceEnabled(); } @Override public boolean isWarnEnabled() { - return _stdErrLog == null ? true : _stdErrLog.getLevel() <= org.eclipse.jetty.util.log.StdErrLog.LEVEL_WARN; + return _logger.isWarnEnabled(); } @Override diff --git a/apache-jstl/src/test/resources/jetty-logging.properties b/apache-jstl/src/test/resources/jetty-logging.properties index 08befa5ce97..c1f44baf179 100644 --- a/apache-jstl/src/test/resources/jetty-logging.properties +++ b/apache-jstl/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl # org.eclipse.jetty.LEVEL=INFO # org.eclipse.jetty.util.LEVEL=DEBUG diff --git a/examples/embedded/pom.xml b/examples/embedded/pom.xml index 04785ddabf4..7dceec94289 100644 --- a/examples/embedded/pom.xml +++ b/examples/embedded/pom.xml @@ -15,6 +15,14 @@ ${project.groupId}.embedded + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + org.eclipse.jetty jetty-util-ajax diff --git a/examples/embedded/src/main/resources/jetty-logging.properties b/examples/embedded/src/main/resources/jetty-logging.properties index c0a226179d4..b7d93c80293 100644 --- a/examples/embedded/src/main/resources/jetty-logging.properties +++ b/examples/embedded/src/main/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -#org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.JavaUtilLog +## Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.util.log.javautil.PROPERTIES=java-util-logging.properties #org.eclipse.jetty.util.log.SOURCE=true #org.eclipse.jetty.LEVEL=INFO diff --git a/examples/embedded/src/test/resources/jetty-logging.properties b/examples/embedded/src/test/resources/jetty-logging.properties index b86623fd081..ce01e8bace1 100644 --- a/examples/embedded/src/test/resources/jetty-logging.properties +++ b/examples/embedded/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl org.eclipse.jetty.LEVEL=INFO org.eclipse.jetty.embedded.JettyDistribution.LEVEL=DEBUG #org.eclipse.jetty.STACKS=true diff --git a/jetty-alpn/jetty-alpn-client/src/main/java/module-info.java b/jetty-alpn/jetty-alpn-client/src/main/java/module-info.java index f66048b405f..d047028c69c 100644 --- a/jetty-alpn/jetty-alpn-client/src/main/java/module-info.java +++ b/jetty-alpn/jetty-alpn-client/src/main/java/module-info.java @@ -23,6 +23,7 @@ module org.eclipse.jetty.alpn.client exports org.eclipse.jetty.alpn.client; requires transitive org.eclipse.jetty.io; + requires org.slf4j; uses ALPNProcessor.Client; } diff --git a/jetty-alpn/jetty-alpn-conscrypt-client/src/main/java/module-info.java b/jetty-alpn/jetty-alpn-conscrypt-client/src/main/java/module-info.java index 3d9a92407d8..baccbefede3 100644 --- a/jetty-alpn/jetty-alpn-conscrypt-client/src/main/java/module-info.java +++ b/jetty-alpn/jetty-alpn-conscrypt-client/src/main/java/module-info.java @@ -23,6 +23,7 @@ module org.eclipse.jetty.alpn.conscrypt.client { requires org.conscrypt; requires transitive org.eclipse.jetty.alpn.client; + requires org.slf4j; provides ALPNProcessor.Client with ConscryptClientALPNProcessor; } diff --git a/jetty-alpn/jetty-alpn-conscrypt-client/src/test/resources/jetty-logging.properties b/jetty-alpn/jetty-alpn-conscrypt-client/src/test/resources/jetty-logging.properties index d96a696f82e..56cc73e5d68 100644 --- a/jetty-alpn/jetty-alpn-conscrypt-client/src/test/resources/jetty-logging.properties +++ b/jetty-alpn/jetty-alpn-conscrypt-client/src/test/resources/jetty-logging.properties @@ -1,2 +1,2 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG diff --git a/jetty-alpn/jetty-alpn-conscrypt-server/src/main/java/module-info.java b/jetty-alpn/jetty-alpn-conscrypt-server/src/main/java/module-info.java index 3a5a872ca3b..a78a2135e81 100644 --- a/jetty-alpn/jetty-alpn-conscrypt-server/src/main/java/module-info.java +++ b/jetty-alpn/jetty-alpn-conscrypt-server/src/main/java/module-info.java @@ -22,6 +22,7 @@ import org.eclipse.jetty.io.ssl.ALPNProcessor; module org.eclipse.jetty.alpn.conscrypt.server { requires org.conscrypt; + requires org.slf4j; requires transitive org.eclipse.jetty.alpn.server; provides ALPNProcessor.Server with ConscryptServerALPNProcessor; diff --git a/jetty-alpn/jetty-alpn-conscrypt-server/src/test/resources/jetty-logging.properties b/jetty-alpn/jetty-alpn-conscrypt-server/src/test/resources/jetty-logging.properties index c391f84e35b..2f2fa6d19d9 100644 --- a/jetty-alpn/jetty-alpn-conscrypt-server/src/test/resources/jetty-logging.properties +++ b/jetty-alpn/jetty-alpn-conscrypt-server/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.alpn.LEVEL=DEBUG diff --git a/jetty-alpn/jetty-alpn-java-client/src/main/java/module-info.java b/jetty-alpn/jetty-alpn-java-client/src/main/java/module-info.java index 2ba4756950c..8496f7fe5e6 100644 --- a/jetty-alpn/jetty-alpn-java-client/src/main/java/module-info.java +++ b/jetty-alpn/jetty-alpn-java-client/src/main/java/module-info.java @@ -22,6 +22,7 @@ import org.eclipse.jetty.io.ssl.ALPNProcessor; module org.eclipse.jetty.alpn.java.client { requires transitive org.eclipse.jetty.alpn.client; + requires org.slf4j; provides ALPNProcessor.Client with JDK9ClientALPNProcessor; } diff --git a/jetty-alpn/jetty-alpn-java-client/src/test/resources/jetty-logging.properties b/jetty-alpn/jetty-alpn-java-client/src/test/resources/jetty-logging.properties index d96a696f82e..56cc73e5d68 100644 --- a/jetty-alpn/jetty-alpn-java-client/src/test/resources/jetty-logging.properties +++ b/jetty-alpn/jetty-alpn-java-client/src/test/resources/jetty-logging.properties @@ -1,2 +1,2 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG diff --git a/jetty-alpn/jetty-alpn-java-server/src/main/java/module-info.java b/jetty-alpn/jetty-alpn-java-server/src/main/java/module-info.java index f34903c4cbb..3dc66cb7ad2 100644 --- a/jetty-alpn/jetty-alpn-java-server/src/main/java/module-info.java +++ b/jetty-alpn/jetty-alpn-java-server/src/main/java/module-info.java @@ -21,6 +21,7 @@ import org.eclipse.jetty.io.ssl.ALPNProcessor; module org.eclipse.jetty.alpn.java.server { + requires org.slf4j; requires transitive org.eclipse.jetty.alpn.server; provides ALPNProcessor.Server with JDK9ServerALPNProcessor; diff --git a/jetty-alpn/jetty-alpn-java-server/src/test/resources/jetty-logging.properties b/jetty-alpn/jetty-alpn-java-server/src/test/resources/jetty-logging.properties index c391f84e35b..2f2fa6d19d9 100644 --- a/jetty-alpn/jetty-alpn-java-server/src/test/resources/jetty-logging.properties +++ b/jetty-alpn/jetty-alpn-java-server/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.alpn.LEVEL=DEBUG diff --git a/jetty-alpn/jetty-alpn-server/src/main/java/module-info.java b/jetty-alpn/jetty-alpn-server/src/main/java/module-info.java index 395048acd64..c0e6b7e1452 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/java/module-info.java +++ b/jetty-alpn/jetty-alpn-server/src/main/java/module-info.java @@ -23,6 +23,7 @@ module org.eclipse.jetty.alpn.server exports org.eclipse.jetty.alpn.server; requires transitive org.eclipse.jetty.server; + requires org.slf4j; uses ALPNProcessor.Server; } diff --git a/jetty-annotations/src/main/java/module-info.java b/jetty-annotations/src/main/java/module-info.java index bca49e300ef..6575c28d572 100644 --- a/jetty-annotations/src/main/java/module-info.java +++ b/jetty-annotations/src/main/java/module-info.java @@ -29,6 +29,7 @@ module org.eclipse.jetty.annotations requires java.naming; requires transitive org.eclipse.jetty.plus; requires transitive org.objectweb.asm; + requires org.slf4j; uses ServletContainerInitializer; diff --git a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationIntrospector.java b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationIntrospector.java index d2ff57d8a82..6458daa52bd 100644 --- a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationIntrospector.java +++ b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationIntrospector.java @@ -20,10 +20,10 @@ package org.eclipse.jetty.annotations; import java.io.File; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.Source; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.FragmentDescriptor; import org.eclipse.jetty.webapp.WebAppContext; diff --git a/jetty-annotations/src/test/resources/jetty-logging.properties b/jetty-annotations/src/test/resources/jetty-logging.properties index fff7f1b3e39..9c9f7d77b57 100644 --- a/jetty-annotations/src/test/resources/jetty-logging.properties +++ b/jetty-annotations/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.annotations.LEVEL=DEBUG diff --git a/jetty-client/pom.xml b/jetty-client/pom.xml index b1c935b2f6f..e859d380e22 100644 --- a/jetty-client/pom.xml +++ b/jetty-client/pom.xml @@ -24,7 +24,6 @@ @{argLine} ${jetty.surefire.argLine} --add-modules java.security.jgss --add-modules org.eclipse.jetty.jmx - --add-modules org.slf4j
@@ -157,11 +156,10 @@ org.slf4j slf4j-api - test - org.slf4j - slf4j-simple + org.eclipse.jetty + jetty-slf4j-impl test diff --git a/jetty-client/src/main/java/module-info.java b/jetty-client/src/main/java/module-info.java index 5f5443c19a3..633e74db434 100644 --- a/jetty-client/src/main/java/module-info.java +++ b/jetty-client/src/main/java/module-info.java @@ -28,6 +28,7 @@ module org.eclipse.jetty.client requires org.eclipse.jetty.alpn.client; requires transitive org.eclipse.jetty.http; + requires org.slf4j; // Only required if using SPNEGO. requires static java.security.jgss; diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java index aff6cd24616..868fc335bb4 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java @@ -82,6 +82,7 @@ import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.io.AbstractConnection; import org.eclipse.jetty.io.ClientConnector; import org.eclipse.jetty.io.EndPoint; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.toolchain.test.Net; import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; @@ -92,7 +93,6 @@ import org.eclipse.jetty.util.FuturePromise; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.Promise; import org.eclipse.jetty.util.SocketAddressResolver; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java index c0d4aba223c..733cb78f873 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java @@ -35,9 +35,9 @@ import org.eclipse.jetty.client.api.Result; import org.eclipse.jetty.client.util.ByteBufferContentProvider; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpVersion; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; import org.junit.jupiter.params.ParameterizedTest; diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpRequestAbortTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpRequestAbortTest.java index d16996c8e26..aca7bb99461 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpRequestAbortTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpRequestAbortTest.java @@ -33,9 +33,9 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.client.api.Result; import org.eclipse.jetty.client.util.ByteBufferContentProvider; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ArgumentsSource; diff --git a/jetty-client/src/test/resources/jetty-logging.properties b/jetty-client/src/test/resources/jetty-logging.properties index f74a4da98d1..e6bbf9a6ca0 100644 --- a/jetty-client/src/test/resources/jetty-logging.properties +++ b/jetty-client/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.client.LEVEL=DEBUG #org.eclipse.jetty.io.ChannelEndPoint.LEVEL=DEBUG diff --git a/jetty-deploy/pom.xml b/jetty-deploy/pom.xml index 45376093155..68ace6744ea 100644 --- a/jetty-deploy/pom.xml +++ b/jetty-deploy/pom.xml @@ -51,6 +51,10 @@ ${project.version} true + + org.slf4j + slf4j-api + org.eclipse.jetty.toolchain diff --git a/jetty-deploy/src/main/java/module-info.java b/jetty-deploy/src/main/java/module-info.java index 7e2365477db..783914725a3 100644 --- a/jetty-deploy/src/main/java/module-info.java +++ b/jetty-deploy/src/main/java/module-info.java @@ -27,6 +27,7 @@ module org.eclipse.jetty.deploy requires java.xml; requires transitive org.eclipse.jetty.webapp; requires org.eclipse.jetty.xml; + requires org.slf4j; // Only required if using JMX. requires static org.eclipse.jetty.jmx; diff --git a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/BadAppDeployTest.java b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/BadAppDeployTest.java index ef65d445de8..0c99e06d673 100644 --- a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/BadAppDeployTest.java +++ b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/BadAppDeployTest.java @@ -24,6 +24,7 @@ import java.nio.file.Path; import javax.servlet.ServletException; import org.eclipse.jetty.deploy.providers.WebAppProvider; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.ContextHandlerCollection; @@ -33,12 +34,11 @@ import org.eclipse.jetty.toolchain.test.FS; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.webapp.WebAppContext; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.slf4j.LoggerFactory; import static java.time.Duration.ofSeconds; import static org.hamcrest.MatcherAssert.assertThat; @@ -103,10 +103,9 @@ public class BadAppDeployTest assertTimeoutPreemptively(ofSeconds(10), () -> { - - try (StacklessLogging ignore = new StacklessLogging(Log.getLogger(WebAppContext.class), - Log.getLogger(DeploymentManager.class), - Log.getLogger("org.eclipse.jetty.server.handler.ContextHandler.badapp"))) + try (StacklessLogging ignore = new StacklessLogging(LoggerFactory.getLogger(WebAppContext.class), + LoggerFactory.getLogger(DeploymentManager.class), + LoggerFactory.getLogger("org.eclipse.jetty.server.handler.ContextHandler.badapp"))) { ServletException cause = assertThrows(ServletException.class, () -> server.start()); assertThat(cause.getMessage(), containsString("intentionally")); @@ -157,9 +156,9 @@ public class BadAppDeployTest assertTimeoutPreemptively(ofSeconds(10), () -> { - try (StacklessLogging ignore = new StacklessLogging(Log.getLogger(WebAppContext.class), - Log.getLogger(DeploymentManager.class), - Log.getLogger("org.eclipse.jetty.server.handler.ContextHandler.badapp"))) + try (StacklessLogging ignore = new StacklessLogging(LoggerFactory.getLogger(WebAppContext.class), + LoggerFactory.getLogger(DeploymentManager.class), + LoggerFactory.getLogger("org.eclipse.jetty.server.handler.ContextHandler.badapp"))) { ServletException cause = assertThrows(ServletException.class, () -> server.start()); assertThat(cause.getMessage(), containsString("intentionally")); diff --git a/jetty-deploy/src/test/resources/jetty-logging.properties b/jetty-deploy/src/test/resources/jetty-logging.properties index 0a15aa423f2..363b21c3fb0 100644 --- a/jetty-deploy/src/test/resources/jetty-logging.properties +++ b/jetty-deploy/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl org.eclipse.jetty.deploy.LEVEL=WARN org.eclipse.jetty.util.Scanner=WARN #org.eclipse.jetty.webapp.LEVEL=DEBUG diff --git a/jetty-fcgi/fcgi-client/src/main/java/module-info.java b/jetty-fcgi/fcgi-client/src/main/java/module-info.java index 49d6ceab44e..bb5bcb07fe3 100644 --- a/jetty-fcgi/fcgi-client/src/main/java/module-info.java +++ b/jetty-fcgi/fcgi-client/src/main/java/module-info.java @@ -24,4 +24,5 @@ module org.eclipse.jetty.fcgi.client exports org.eclipse.jetty.fcgi.parser; requires transitive org.eclipse.jetty.client; + requires org.slf4j; } diff --git a/jetty-fcgi/fcgi-client/src/test/resources/jetty-logging.properties b/jetty-fcgi/fcgi-client/src/test/resources/jetty-logging.properties index b8df62d071d..4e7406f1b54 100644 --- a/jetty-fcgi/fcgi-client/src/test/resources/jetty-logging.properties +++ b/jetty-fcgi/fcgi-client/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.client.LEVEL=DEBUG #org.eclipse.jetty.fcgi.LEVEL=DEBUG diff --git a/jetty-fcgi/fcgi-server/pom.xml b/jetty-fcgi/fcgi-server/pom.xml index 742fcf5a9fe..6b8cd246e86 100644 --- a/jetty-fcgi/fcgi-server/pom.xml +++ b/jetty-fcgi/fcgi-server/pom.xml @@ -15,6 +15,10 @@ + + org.slf4j + slf4j-api + org.eclipse.jetty.toolchain jetty-servlet-api diff --git a/jetty-fcgi/fcgi-server/src/main/java/module-info.java b/jetty-fcgi/fcgi-server/src/main/java/module-info.java index bf0cac53d6e..c4201e8cd37 100644 --- a/jetty-fcgi/fcgi-server/src/main/java/module-info.java +++ b/jetty-fcgi/fcgi-server/src/main/java/module-info.java @@ -21,6 +21,7 @@ module org.eclipse.jetty.fcgi.server exports org.eclipse.jetty.fcgi.server; exports org.eclipse.jetty.fcgi.server.proxy; + requires org.slf4j; requires transitive org.eclipse.jetty.fcgi.client; requires transitive org.eclipse.jetty.proxy; diff --git a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/proxy/FastCGIProxyServlet.java b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/proxy/FastCGIProxyServlet.java index 2d2e7c6b939..f842f7f9ecd 100644 --- a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/proxy/FastCGIProxyServlet.java +++ b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/proxy/FastCGIProxyServlet.java @@ -260,7 +260,7 @@ public class FastCGIProxyServlet extends AsyncProxyServlet.Transparent fcgi.put(field.getName(), field.getValue()); } String eol = System.lineSeparator(); - _log.debug("FastCGI variables{}{}", eol, fcgi.entrySet().stream() + _log.debug("FastCGI variables {}{}", eol, fcgi.entrySet().stream() .map(entry -> String.format("%s: %s", entry.getKey(), entry.getValue())) .collect(Collectors.joining(eol))); } diff --git a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/HttpClientTest.java b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/HttpClientTest.java index 704d4a64f90..f2727aab175 100644 --- a/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/HttpClientTest.java +++ b/jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/HttpClientTest.java @@ -45,11 +45,11 @@ import org.eclipse.jetty.client.util.DeferredContentProvider; import org.eclipse.jetty.client.util.FutureResponseListener; import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.io.MappedByteBufferPool; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.toolchain.test.IO; import org.eclipse.jetty.toolchain.test.Net; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; diff --git a/jetty-fcgi/fcgi-server/src/test/resources/jetty-logging.properties b/jetty-fcgi/fcgi-server/src/test/resources/jetty-logging.properties index b8df62d071d..4e7406f1b54 100644 --- a/jetty-fcgi/fcgi-server/src/test/resources/jetty-logging.properties +++ b/jetty-fcgi/fcgi-server/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.client.LEVEL=DEBUG #org.eclipse.jetty.fcgi.LEVEL=DEBUG diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud-datastore.mod b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud-datastore.mod index 9415b77ed9d..11dbd23f2ff 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud-datastore.mod +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config-template/modules/gcloud-datastore.mod @@ -9,6 +9,6 @@ gcloud [depends] gcloud -jcl-slf4j -jul-impl +logging-jcl-capture +logging-jul diff --git a/jetty-home/pom.xml b/jetty-home/pom.xml index 85c5da33771..dc26067f8f8 100644 --- a/jetty-home/pom.xml +++ b/jetty-home/pom.xml @@ -170,6 +170,33 @@ ${source-assembly-directory}/lib + + copy-lib-logging-deps + generate-resources + + copy-dependencies + + + org.eclipse.jetty,org.slf4j + jetty-slf4j-impl,slf4j-api + jar + ${assembly-directory}/lib/logging + + + + copy-lib-logging-src-deps + generate-resources + + copy-dependencies + + + org.eclipse.jetty,org.slf4j + jetty-slf4j-impl,slf4j-api + jar + sources + ${source-assembly-directory}/lib/logging + + copy-lib-websocket-deps generate-resources @@ -603,6 +630,11 @@ + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + org.eclipse.jetty jetty-deploy diff --git a/jetty-home/src/main/resources/etc/logging-jul-capture.xml b/jetty-home/src/main/resources/etc/logging-jul-capture.xml new file mode 100644 index 00000000000..a701abe77c1 --- /dev/null +++ b/jetty-home/src/main/resources/etc/logging-jul-capture.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/jetty-util/src/main/config/modules/slf4j-api.mod b/jetty-home/src/main/resources/modules/logging-jcl-capture.mod similarity index 74% rename from jetty-util/src/main/config/modules/slf4j-api.mod rename to jetty-home/src/main/resources/modules/logging-jcl-capture.mod index 70c7b548249..78f59c7fb1b 100644 --- a/jetty-util/src/main/config/modules/slf4j-api.mod +++ b/jetty-home/src/main/resources/modules/logging-jcl-capture.mod @@ -1,23 +1,23 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html [description] -Provides SLF4J API. Requires a slf4j implementation (eg slf4j-simple-impl) -otherwise a noop implementation is used. +Capture jakarta-commons-logging events and bridge them to org.slf4j [tags] logging -slf4j -internal + +[depends] +logging/slf4j +logging + +[provides] +commons-logging [files] -maven://org.slf4j/slf4j-api/${slf4j.version}|lib/slf4j/slf4j-api-${slf4j.version}.jar +maven://org.slf4j/jcl-over-slf4j/%{slf4j.version}|jcl-over-slf4j-${slf4j.version}.jar [lib] -lib/slf4j/slf4j-api-${slf4j.version}.jar - -[ini] -slf4j.version?=1.8.0-beta2 -jetty.webapp.addServerClasses+=,${jetty.base.uri}/lib/slf4j/ +lib/logging/jcl-over-slf4j-${slf4j.version}.jar [license] SLF4J is distributed under the MIT License. @@ -42,3 +42,5 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + diff --git a/jetty-home/src/main/resources/modules/logging-jetty.mod b/jetty-home/src/main/resources/modules/logging-jetty.mod new file mode 100644 index 00000000000..71da0e34905 --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging-jetty.mod @@ -0,0 +1,24 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Configure jetty logging mechanism. +Provides a ${jetty.base}/resources/jetty-logging.properties. + +[tags] +logging + +[depends] +logging/slf4j +resources + +[provides] +logging|default + +[files] +basehome:modules/logging/jetty + +[lib] +lib/logging/jetty-slf4j-impl-${jetty.version}.jar + +[ini] +jetty.webapp.addServerClasses+=,org.eclipse.jetty.logging. diff --git a/jetty-home/src/main/resources/modules/logging-jul-capture.mod b/jetty-home/src/main/resources/modules/logging-jul-capture.mod new file mode 100644 index 00000000000..5401a052c17 --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging-jul-capture.mod @@ -0,0 +1,47 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Capture java.util.logging events and bridge them to org.slf4j + +[tags] +logging + +[depends] +logging/slf4j +logging + +[provides] +java-util-logging + +[xml] +etc/logging-jul-capture.xml + +[files] +maven://org.slf4j/jul-to-slf4j/%{slf4j.version}|jul-to-slf4j-${slf4j.version}.jar + +[lib] +lib/logging/jul-to-slf4j-${slf4j.version}.jar + +[license] +SLF4J is distributed under the MIT License. +Copyright (c) 2004-2013 QOS.ch +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/jetty-home/src/main/resources/modules/logging-jul.mod b/jetty-home/src/main/resources/modules/logging-jul.mod new file mode 100644 index 00000000000..4bf63a0924b --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging-jul.mod @@ -0,0 +1,53 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Configure jetty logging to use Java Util Logging (jul) +SLF4J is used as the core logging mechanism. + +[tags] +logging + +[depends] +logging/slf4j +resources + +[provides] +logging +java-util-logging + +[files] +basehome:modules/logging/jul +maven://org.slf4j/slf4j-jdk14/${slf4j.version}|lib/logging/slf4j-jdk14-${slf4j.version}.jar + +[lib] +lib/logging/slf4j-jdk14-${slf4j.version}.jar + +[ini] +slf4j.version?=2.0.0-alpha1 +java.util.logging.config.file=${jetty.base}/resources/java-util-logging.properties + +[license] +SLF4J is distributed under the MIT License. +Copyright (c) 2004-2013 QOS.ch +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + diff --git a/jetty-home/src/main/resources/modules/logging-log4j1-capture.mod b/jetty-home/src/main/resources/modules/logging-log4j1-capture.mod new file mode 100644 index 00000000000..41dca46cf85 --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging-log4j1-capture.mod @@ -0,0 +1,44 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Capture Apache log4j events and bridge them to org.slf4j + +[tags] +logging + +[depends] +logging/slf4j +logging + +[provides] +log4j + +[files] +maven://org.slf4j/jcl-over-slf4j/%{slf4j.version}|jcl-over-slf4j-${slf4j.version}.jar + +[lib] +lib/logging/log4j-to-slf4j-${slf4j.version}.jar + +[license] +SLF4J is distributed under the MIT License. +Copyright (c) 2004-2013 QOS.ch +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/jetty-home/src/main/resources/modules/logging-log4j1.mod b/jetty-home/src/main/resources/modules/logging-log4j1.mod new file mode 100644 index 00000000000..ef7332070e7 --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging-log4j1.mod @@ -0,0 +1,58 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Configure jetty logging to use Log4j Logging +SLF4J is used as the core logging mechanism. + +[tags] +logging + +[depends] +logging/slf4j +resources + +[provides] +logging +log4j + +[files] +basehome:modules/logging/log4j1 +maven://log4j/log4j/${log4j.version}|lib/logging/log4j-${log4j.version}.jar +maven://org.slf4j/slf4j-log4j12/${slf4j.version}|lib/logging/slf4j-log4j12-${slf4j.version}.jar + +[lib] +lib/logging/slf4j-log4j12-${slf4j.version}.jar +lib/logging/log4j-${log4j.version}.jar + +[ini] +log4j.version?=1.2.17 +jetty.webapp.addServerClasses+=,org.apache.log4j. + + +[license] +Log4j is released under the Apache 2.0 license. +http://www.apache.org/licenses/LICENSE-2.0.html + + +SLF4J is distributed under the MIT License. +Copyright (c) 2004-2013 QOS.ch +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/jetty-home/src/main/resources/modules/logging-log4j2.mod b/jetty-home/src/main/resources/modules/logging-log4j2.mod new file mode 100644 index 00000000000..784320b33ab --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging-log4j2.mod @@ -0,0 +1,35 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Configure jetty logging to use log4j version 2 +SLF4J is used as the core logging mechanism. + +[tags] +logging + +[depends] +logging/slf4j +resources + +[provides] +logging +log4j + +[files] +basehome:modules/logging/log4j2 +maven://org.apache.logging.log4j/log4j-slf4j18-impl/${log4j.version}|lib/logging/log4j-slf4j18-impl-${log4j.version}.jar +maven://org.apache.logging.log4j/log4j-api/${log4j.version}|lib/logging/log4j-api-${log4j.version}.jar +maven://org.apache.logging.log4j/log4j-core/${log4j.version}|lib/logging/log4j-core-${log4j.version}.jar + +[lib] +lib/logging/log4j-slf4j18-impl-${log4j.version}.jar +lib/logging/log4j-api-${log4j.version}.jar +lib/logging/log4j-core-${log4j.version}.jar + +[ini] +log4j.version?=2.13.0 +jetty.webapp.addServerClasses+=,org.apache.logging.log4j. + +[license] +Log4j is released under the Apache 2.0 license. +http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/jetty-home/src/main/resources/modules/logging-logback.mod b/jetty-home/src/main/resources/modules/logging-logback.mod new file mode 100644 index 00000000000..cdffd67921f --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging-logback.mod @@ -0,0 +1,45 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Configure jetty logging to use Logback Logging. +SLF4J is used as the core logging mechanism. + +[tags] +logging + +[depends] +logging/slf4j +resources + +[provides] +logging + +[files] +basehome:modules/logging/logback +maven://ch.qos.logback/logback-classic/${logback.version}|lib/logging/logback-classic-${logback.version}.jar +maven://ch.qos.logback/logback-core/${logback.version}|lib/logging/logback-core-${logback.version}.jar + +[lib] +lib/logging/logback-classic-${logback.version}.jar +lib/logging/logback-core-${logback.version}.jar + +[ini] +logback.version?=1.3.0-alpha5 +jetty.webapp.addServerClasses+=,ch.qos.logback. + +[license] +Logback: the reliable, generic, fast and flexible logging framework. +Copyright (C) 1999-2012, QOS.ch. All rights reserved. + +This program and the accompanying materials are dual-licensed under +either: + + the terms of the Eclipse Public License v1.0 + as published by the Eclipse Foundation: + http://www.eclipse.org/legal/epl-v10.html + +or (per the licensee's choosing) under + + the terms of the GNU Lesser General Public License version 2.1 + as published by the Free Software Foundation: + http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html diff --git a/jetty-home/src/main/resources/modules/logging-noop.mod b/jetty-home/src/main/resources/modules/logging-noop.mod new file mode 100644 index 00000000000..2a8c3743c47 --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging-noop.mod @@ -0,0 +1,13 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Configure logging to use SLF4J No-Op Implementation + +[tags] +logging + +[provides] +logging + +[depends] +logging/slf4j diff --git a/jetty-home/src/main/resources/modules/logging/jetty/resources/jetty-logging.properties b/jetty-home/src/main/resources/modules/logging/jetty/resources/jetty-logging.properties new file mode 100644 index 00000000000..d0fdf6c5bd5 --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging/jetty/resources/jetty-logging.properties @@ -0,0 +1,8 @@ +## Set logging levels from: ALL, TRACE, DEBUG, INFO, WARN, ERROR, OFF +org.eclipse.jetty.LEVEL=INFO +## Configure a level for an arbitrary logger tree +#com.example.LEVEL=INFO +## Configure a level for specific logger +#com.example.MyComponent.LEVEL=INFO +## Hide stacks traces in an arbitrary logger tree +#com.example.STACKS=false diff --git a/jetty-home/src/main/resources/modules/logging/jul/resources/java-util-logging.properties b/jetty-home/src/main/resources/modules/logging/jul/resources/java-util-logging.properties new file mode 100644 index 00000000000..a09450fc280 --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging/jul/resources/java-util-logging.properties @@ -0,0 +1,13 @@ +.level=INFO +handlers=java.util.logging.ConsoleHandler +java.util.logging.ConsoleHandler.level=INFO +java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter +## Note: The java.util.logging.SimpleFormatter does NOT have the ability to display +## the Thread name of when the logging event occurred, this will make debugging difficult +## See https://stackoverflow.com/questions/6889057/printing-thread-name-using-java-util-logging +java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS [%4$s] (%3$s) - %5$s%6$s%n +#handlers = java.util.logging.FileHandler +#java.util.logging.FileHandler.pattern = ${jetty.logging.dir}/jetty%u.log +#java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter + + diff --git a/jetty-home/src/main/resources/modules/logging/log4j1/resources/log4j.xml b/jetty-home/src/main/resources/modules/logging/log4j1/resources/log4j.xml new file mode 100644 index 00000000000..b4bf0ae6994 --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging/log4j1/resources/log4j.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jetty-home/src/main/resources/modules/logging/log4j2/resources/log4j2.xml b/jetty-home/src/main/resources/modules/logging/log4j2/resources/log4j2.xml new file mode 100644 index 00000000000..f20a1d40515 --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging/log4j2/resources/log4j2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/jetty-home/src/main/resources/modules/logging/logback/resources/logback.xml b/jetty-home/src/main/resources/modules/logging/logback/resources/logback.xml new file mode 100644 index 00000000000..23a6dbc24da --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging/logback/resources/logback.xml @@ -0,0 +1,11 @@ + + + + %d{HH:mm:ss.SSS} [%level] :%thread: \(%logger\) - %msg%n + + + + + + + \ No newline at end of file diff --git a/jetty-home/src/main/resources/modules/logging/slf4j.mod b/jetty-home/src/main/resources/modules/logging/slf4j.mod new file mode 100644 index 00000000000..67387a2c1f5 --- /dev/null +++ b/jetty-home/src/main/resources/modules/logging/slf4j.mod @@ -0,0 +1,18 @@ +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html + +[description] +Configure logging to use slf4j with no impl +(If you don't select an impl, then NOP will be used by slf4j) + +[tags] +logging + +[provides] +slf4j + +[lib] +lib/logging/slf4j-api-${slf4j.version}.jar + +[ini] +slf4j.version?=2.0.0-alpha1 +jetty.webapp.addServerClasses+=,org.slf4j. diff --git a/jetty-http/src/main/java/module-info.java b/jetty-http/src/main/java/module-info.java index b606ff8b299..918c69b7735 100644 --- a/jetty-http/src/main/java/module-info.java +++ b/jetty-http/src/main/java/module-info.java @@ -25,6 +25,7 @@ module org.eclipse.jetty.http exports org.eclipse.jetty.http.pathmap; requires transitive org.eclipse.jetty.io; + requires org.slf4j; uses HttpFieldPreEncoder; diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java index ed2228997ee..b2109cabb0e 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java @@ -24,9 +24,9 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.jetty.http.HttpParser.State; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.toolchain.test.Net; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.BeforeEach; diff --git a/jetty-http/src/test/resources/jetty-logging.properties b/jetty-http/src/test/resources/jetty-logging.properties index 799aa62aed3..ab545e4ab63 100644 --- a/jetty-http/src/test/resources/jetty-logging.properties +++ b/jetty-http/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.server.LEVEL=DEBUG #org.eclipse.jetty.http.LEVEL=DEBUG diff --git a/jetty-http2/http2-client/src/main/java/module-info.java b/jetty-http2/http2-client/src/main/java/module-info.java index dafdf57a310..721a1f43a8d 100644 --- a/jetty-http2/http2-client/src/main/java/module-info.java +++ b/jetty-http2/http2-client/src/main/java/module-info.java @@ -22,4 +22,5 @@ module org.eclipse.jetty.http2.client requires org.eclipse.jetty.alpn.client; requires transitive org.eclipse.jetty.http2.common; + requires org.slf4j; } diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/StreamResetTest.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/StreamResetTest.java index dbf003f06b8..2ec076e8b70 100644 --- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/StreamResetTest.java +++ b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/StreamResetTest.java @@ -72,6 +72,7 @@ import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory; import org.eclipse.jetty.io.AbstractEndPoint; import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.io.WriteFlusher; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpOutput; @@ -85,7 +86,6 @@ import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FutureCallback; import org.eclipse.jetty.util.FuturePromise; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; diff --git a/jetty-http2/http2-client/src/test/resources/jetty-logging.properties b/jetty-http2/http2-client/src/test/resources/jetty-logging.properties index 5304801a325..c94292482f0 100644 --- a/jetty-http2/http2-client/src/test/resources/jetty-logging.properties +++ b/jetty-http2/http2-client/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.http2.LEVEL=DEBUG org.eclipse.jetty.http2.hpack.LEVEL=INFO diff --git a/jetty-http2/http2-common/src/main/java/module-info.java b/jetty-http2/http2-common/src/main/java/module-info.java index 27e60a4bd26..592d25f361e 100644 --- a/jetty-http2/http2-common/src/main/java/module-info.java +++ b/jetty-http2/http2-common/src/main/java/module-info.java @@ -26,4 +26,5 @@ module org.eclipse.jetty.http2.common exports org.eclipse.jetty.http2.parser; requires transitive org.eclipse.jetty.http2.hpack; + requires org.slf4j; } diff --git a/jetty-http2/http2-common/src/test/resources/jetty-logging.properties b/jetty-http2/http2-common/src/test/resources/jetty-logging.properties index b4e43807801..874ebdbc1eb 100644 --- a/jetty-http2/http2-common/src/test/resources/jetty-logging.properties +++ b/jetty-http2/http2-common/src/test/resources/jetty-logging.properties @@ -1,2 +1,2 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl org.eclipse.jetty.http2.LEVEL=INFO diff --git a/jetty-http2/http2-hpack/src/main/java/module-info.java b/jetty-http2/http2-hpack/src/main/java/module-info.java index c482d5ea44f..53ae65a0873 100644 --- a/jetty-http2/http2-hpack/src/main/java/module-info.java +++ b/jetty-http2/http2-hpack/src/main/java/module-info.java @@ -24,6 +24,7 @@ module org.eclipse.jetty.http2.hpack exports org.eclipse.jetty.http2.hpack; requires transitive org.eclipse.jetty.http; + requires org.slf4j; provides HttpFieldPreEncoder with HpackFieldPreEncoder; } diff --git a/jetty-http2/http2-hpack/src/test/resources/jetty-logging.properties b/jetty-http2/http2-hpack/src/test/resources/jetty-logging.properties index f4e33644f4c..9c83a8ee8bb 100644 --- a/jetty-http2/http2-hpack/src/test/resources/jetty-logging.properties +++ b/jetty-http2/http2-hpack/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.http2.LEVEL=DEBUG #org.eclipse.jetty.http2.hpack.LEVEL=DEBUG diff --git a/jetty-http2/http2-http-client-transport/src/main/java/module-info.java b/jetty-http2/http2-http-client-transport/src/main/java/module-info.java index bb53a46a7cd..c5e35ef3ef8 100644 --- a/jetty-http2/http2-http-client-transport/src/main/java/module-info.java +++ b/jetty-http2/http2-http-client-transport/src/main/java/module-info.java @@ -23,4 +23,5 @@ module org.eclipse.jetty.http2.http.client.transport requires org.eclipse.jetty.alpn.client; requires transitive org.eclipse.jetty.client; requires transitive org.eclipse.jetty.http2.client; + requires org.slf4j; } diff --git a/jetty-http2/http2-http-client-transport/src/test/resources/jetty-logging.properties b/jetty-http2/http2-http-client-transport/src/test/resources/jetty-logging.properties index 34929219c9d..1cec8b3203e 100644 --- a/jetty-http2/http2-http-client-transport/src/test/resources/jetty-logging.properties +++ b/jetty-http2/http2-http-client-transport/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.client.LEVEL=DEBUG org.eclipse.jetty.http2.hpack.LEVEL=INFO diff --git a/jetty-http2/http2-server/src/main/java/module-info.java b/jetty-http2/http2-server/src/main/java/module-info.java index 198e74749d5..4bce9a0b782 100644 --- a/jetty-http2/http2-server/src/main/java/module-info.java +++ b/jetty-http2/http2-server/src/main/java/module-info.java @@ -22,4 +22,5 @@ module org.eclipse.jetty.http2.server requires transitive org.eclipse.jetty.http2.common; requires transitive org.eclipse.jetty.server; + requires org.slf4j; } diff --git a/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2ServerTest.java b/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2ServerTest.java index b2d25039c88..650634fc2d9 100644 --- a/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2ServerTest.java +++ b/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2ServerTest.java @@ -60,12 +60,12 @@ import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.io.ChannelEndPoint; import org.eclipse.jetty.io.ManagedSelector; import org.eclipse.jetty.io.SocketChannelEndPoint; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertArrayEquals; diff --git a/jetty-http2/http2-server/src/test/resources/jetty-logging.properties b/jetty-http2/http2-server/src/test/resources/jetty-logging.properties index 9611e7c6ad5..d71badfeed6 100644 --- a/jetty-http2/http2-server/src/test/resources/jetty-logging.properties +++ b/jetty-http2/http2-server/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.http2.LEVEL=DEBUG org.eclipse.jetty.http2.hpack.LEVEL=INFO diff --git a/jetty-io/src/main/java/module-info.java b/jetty-io/src/main/java/module-info.java index 7aee3271134..e9286fa962f 100644 --- a/jetty-io/src/main/java/module-info.java +++ b/jetty-io/src/main/java/module-info.java @@ -22,4 +22,5 @@ module org.eclipse.jetty.io exports org.eclipse.jetty.io.ssl; requires transitive org.eclipse.jetty.util; + requires org.slf4j; } diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/WriteFlusherTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/WriteFlusherTest.java index cfb9b4634a8..c2fbc7f91ee 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/WriteFlusherTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/WriteFlusherTest.java @@ -32,10 +32,10 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FutureCallback; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; diff --git a/jetty-io/src/test/resources/jetty-logging.properties b/jetty-io/src/test/resources/jetty-logging.properties index 0e7fd71dc25..a83221a9354 100644 --- a/jetty-io/src/test/resources/jetty-logging.properties +++ b/jetty-io/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.io.AbstractConnection.LEVEL=DEBUG #org.eclipse.jetty.io.ManagedSelector.LEVEL=DEBUG diff --git a/jetty-jaas/src/main/java/module-info.java b/jetty-jaas/src/main/java/module-info.java index 954880aa359..848615dea70 100644 --- a/jetty-jaas/src/main/java/module-info.java +++ b/jetty-jaas/src/main/java/module-info.java @@ -23,6 +23,7 @@ module org.eclipse.jetty.jaas exports org.eclipse.jetty.jaas.spi; requires transitive org.eclipse.jetty.security; + requires org.slf4j; // Only required if using JDBCLoginModule. requires static java.sql; diff --git a/jetty-jaspi/src/main/java/module-info.java b/jetty-jaspi/src/main/java/module-info.java index 9db76bdd281..c24a9d13b12 100644 --- a/jetty-jaspi/src/main/java/module-info.java +++ b/jetty-jaspi/src/main/java/module-info.java @@ -28,6 +28,7 @@ module org.eclipse.jetty.security.jaspi requires javax.security.auth.message; requires jetty.servlet.api; requires transitive org.eclipse.jetty.security; + requires org.slf4j; provides Authenticator.Factory with JaspiAuthenticatorFactory; } diff --git a/jetty-jmx/src/main/java/module-info.java b/jetty-jmx/src/main/java/module-info.java index ac62f51dd98..8036a54102b 100644 --- a/jetty-jmx/src/main/java/module-info.java +++ b/jetty-jmx/src/main/java/module-info.java @@ -23,6 +23,7 @@ module org.eclipse.jetty.jmx // Applications that use ObjectMBean must use JMX classes too. requires transitive java.management; requires transitive org.eclipse.jetty.util; + requires org.slf4j; // Only required if using ConnectorServer. requires static java.management.rmi; diff --git a/jetty-jmx/src/main/java/org/eclipse/jetty/util/log/jmx/LogMBean.java b/jetty-jmx/src/main/java/org/eclipse/jetty/util/log/jmx/LogMBean.java deleted file mode 100644 index 48714ab0257..00000000000 --- a/jetty-jmx/src/main/java/org/eclipse/jetty/util/log/jmx/LogMBean.java +++ /dev/null @@ -1,60 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log.jmx; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jetty.jmx.ObjectMBean; -import org.eclipse.jetty.util.annotation.ManagedAttribute; -import org.eclipse.jetty.util.annotation.ManagedObject; -import org.eclipse.jetty.util.annotation.ManagedOperation; -import org.eclipse.jetty.util.annotation.Name; -import org.eclipse.jetty.util.log.Log; - -/** - * - */ -@ManagedObject("Jetty Logging") -public class LogMBean extends ObjectMBean -{ - public LogMBean(Object managedObject) - { - super(managedObject); - } - - @ManagedAttribute(value = "list of instantiated loggers") - public List getLoggers() - { - List keySet = new ArrayList(Log.getLoggers().keySet()); - return keySet; - } - - @ManagedOperation(value = "true if debug enabled for the given logger") - public boolean isDebugEnabled(@Name("logger") String logger) - { - return Log.getLogger(logger).isDebugEnabled(); - } - - @ManagedOperation(value = "Set debug enabled for given logger") - public void setDebugEnabled(@Name("logger") String logger, @Name("enabled") Boolean enabled) - { - Log.getLogger(logger).setDebugEnabled(enabled); - } -} diff --git a/jetty-jmx/src/test/java/org/eclipse/jetty/jmx/PojoTest.java b/jetty-jmx/src/test/java/org/eclipse/jetty/jmx/PojoTest.java index 18e39cc1991..3f52ab9245c 100644 --- a/jetty-jmx/src/test/java/org/eclipse/jetty/jmx/PojoTest.java +++ b/jetty-jmx/src/test/java/org/eclipse/jetty/jmx/PojoTest.java @@ -26,7 +26,6 @@ import com.openpojo.validation.Validator; import com.openpojo.validation.ValidatorBuilder; import com.openpojo.validation.test.impl.GetterTester; import com.openpojo.validation.test.impl.SetterTester; -import org.eclipse.jetty.util.log.jmx.LogMBean; import org.junit.jupiter.api.Test; /* @@ -38,7 +37,7 @@ public class PojoTest public void testOpenPojo() { Validator validator = ValidatorBuilder.create().with(new SetterTester()).with(new GetterTester()).build(); - List classes = Arrays.asList(MBeanContainer.class, ObjectMBean.class, LogMBean.class); + List classes = Arrays.asList(MBeanContainer.class, ObjectMBean.class); for (Class clazz : classes) { validator.validate(PojoClassFactory.getPojoClass(clazz)); diff --git a/jetty-jmx/src/test/java/org/eclipse/jetty/util/log/jmx/LogMBeanTest.java b/jetty-jmx/src/test/java/org/eclipse/jetty/util/log/jmx/LogMBeanTest.java deleted file mode 100644 index 90cfbf50893..00000000000 --- a/jetty-jmx/src/test/java/org/eclipse/jetty/util/log/jmx/LogMBeanTest.java +++ /dev/null @@ -1,60 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log.jmx; - -import com.acme.Managed; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.in; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class LogMBeanTest -{ - - private Managed managed; - - private LogMBean logMBean; - - private static final String MANAGED_CLASS = "Managed"; - - @BeforeEach - public void setUp() - { - managed = new Managed(); - logMBean = new LogMBean(managed); - } - - @Test - public void testKeySet() - { - // given - assertThat("Managed is not registered with loggers", MANAGED_CLASS, not(is(in(logMBean.getLoggers())))); - - // when - logMBean.setDebugEnabled(MANAGED_CLASS, true); - - // then - assertThat("Managed must be registered with loggers", MANAGED_CLASS, is(in(logMBean.getLoggers()))); - assertTrue(logMBean.isDebugEnabled(MANAGED_CLASS), "This must return true as debug is enabled for this class"); - } -} diff --git a/jetty-jmx/src/test/resources/jetty-logging.properties b/jetty-jmx/src/test/resources/jetty-logging.properties index ad4b63c91cc..1f674758b1c 100644 --- a/jetty-jmx/src/test/resources/jetty-logging.properties +++ b/jetty-jmx/src/test/resources/jetty-logging.properties @@ -1,2 +1,2 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.jmx.LEVEL=DEBUG diff --git a/jetty-jndi/src/main/java/module-info.java b/jetty-jndi/src/main/java/module-info.java index 2bbc61066ca..c5c5e41cb48 100644 --- a/jetty-jndi/src/main/java/module-info.java +++ b/jetty-jndi/src/main/java/module-info.java @@ -25,6 +25,7 @@ module org.eclipse.jetty.jndi requires transitive java.naming; requires transitive org.eclipse.jetty.server; + requires org.slf4j; // Only required if using DataSourceCloser. requires static java.sql; diff --git a/jetty-maven-plugin/pom.xml b/jetty-maven-plugin/pom.xml index e1a6c907e1e..131a3603827 100644 --- a/jetty-maven-plugin/pom.xml +++ b/jetty-maven-plugin/pom.xml @@ -236,6 +236,11 @@ apache-jstl ${project.version} + + org.slf4j + slf4j-api + ${slf4j.version} + jakarta.transaction jakarta.transaction-api @@ -259,9 +264,6 @@ org.apache.maven.plugins maven-project-info-reports-plugin - - false - diff --git a/jetty-maven-plugin/src/it/javax-annotation-api/pom.xml b/jetty-maven-plugin/src/it/javax-annotation-api/pom.xml index fc1dfce43cf..4d2af3f1b78 100644 --- a/jetty-maven-plugin/src/it/javax-annotation-api/pom.xml +++ b/jetty-maven-plugin/src/it/javax-annotation-api/pom.xml @@ -19,6 +19,7 @@ ${project.build.directory}/jetty-run-mojo-annotation.txt EMBED + 1.7.30 @@ -41,12 +42,17 @@ org.slf4j slf4j-api - @slf4j.version@ + ${logging.slf4j.version} - org.apache.logging.log4j - log4j-slf4j18-impl - @log4j2.version@ + org.slf4j + slf4j-log4j12 + ${logging.slf4j.version} + + + org.slf4j + jul-to-slf4j + ${logging.slf4j.version} org.springframework.boot @@ -87,9 +93,7 @@ ${jetty.port.file} - - ${basedir}/src/config/jetty.xml - + ${basedir}/src/config/jetty.xml diff --git a/jetty-maven-plugin/src/it/javax-annotation-api/src/main/resources/log4j.xml b/jetty-maven-plugin/src/it/javax-annotation-api/src/main/resources/log4j.xml new file mode 100644 index 00000000000..83a28a67537 --- /dev/null +++ b/jetty-maven-plugin/src/it/javax-annotation-api/src/main/resources/log4j.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jetty-maven-plugin/src/it/jetty-maven-plugin-provided-module-dep/web/src/main/java/test/ClassLoadingTestingServletContextListener.java b/jetty-maven-plugin/src/it/jetty-maven-plugin-provided-module-dep/web/src/main/java/test/ClassLoadingTestingServletContextListener.java index 47ed26e235a..61f143ef172 100755 --- a/jetty-maven-plugin/src/it/jetty-maven-plugin-provided-module-dep/web/src/main/java/test/ClassLoadingTestingServletContextListener.java +++ b/jetty-maven-plugin/src/it/jetty-maven-plugin-provided-module-dep/web/src/main/java/test/ClassLoadingTestingServletContextListener.java @@ -20,7 +20,6 @@ package test; import java.net.URL; import java.net.URLClassLoader; - import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import javax.servlet.annotation.WebListener; diff --git a/jetty-maven-plugin/src/it/jetty-start-gwt-it/beer-server/src/main/webapp/WEB-INF/web.xml b/jetty-maven-plugin/src/it/jetty-start-gwt-it/beer-server/src/main/webapp/WEB-INF/web.xml index 4ece79123db..fe9829584d3 100644 --- a/jetty-maven-plugin/src/it/jetty-start-gwt-it/beer-server/src/main/webapp/WEB-INF/web.xml +++ b/jetty-maven-plugin/src/it/jetty-start-gwt-it/beer-server/src/main/webapp/WEB-INF/web.xml @@ -1,9 +1,7 @@ - + - + greetServlet org.olamy.GreetingServiceImpl diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractForker.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractForker.java index 447e4a00641..7c544dace82 100644 --- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractForker.java +++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractForker.java @@ -23,8 +23,8 @@ import java.util.List; import java.util.Map; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AbstractForker @@ -33,7 +33,7 @@ import org.eclipse.jetty.util.log.Logger; */ public abstract class AbstractForker extends AbstractLifeCycle { - private static final Logger LOG = Log.getLogger(AbstractForker.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractForker.class); protected Map env; @@ -245,7 +245,7 @@ public abstract class AbstractForker extends AbstractLifeCycle int attempts = maxChildStartChecks; while (!tokenFile.exists() && attempts > 0) { - Thread.currentThread().sleep(maxChildStartCheckMs); + Thread.sleep(maxChildStartCheckMs); --attempts; } if (attempts <= 0) diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractWebAppMojo.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractWebAppMojo.java index 91b61554a95..c4b1dd0b7df 100644 --- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractWebAppMojo.java +++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractWebAppMojo.java @@ -680,7 +680,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo for (Object obj : pluginArtifacts) { Artifact artifact = (Artifact)obj; - if ("jar".equals(artifact.getType()) && !artifact.getGroupId().contains("slf4j")) + if ("jar".equals(artifact.getType())) { if (classPath.length() > 0) classPath.append(File.pathSeparator); @@ -689,7 +689,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo else { if (artifact.getArtifactId().equals(plugin.getArtifactId())) //get the jetty-maven-plugin jar - classPath.append(artifact.getFile().getAbsolutePath()); + classPath.append(artifact.getFile().getAbsolutePath()); } } diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyForkedChild.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyForkedChild.java index 8f8190ea2fa..82885b8d336 100644 --- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyForkedChild.java +++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyForkedChild.java @@ -33,9 +33,9 @@ import org.eclipse.jetty.util.PathWatcher; import org.eclipse.jetty.util.PathWatcher.PathWatchEvent; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * JettyForkedChild @@ -45,7 +45,7 @@ import org.eclipse.jetty.util.resource.Resource; */ public class JettyForkedChild extends AbstractLifeCycle { - private static final Logger LOG = Log.getLogger(JettyForkedChild.class); + private static final Logger LOG = LoggerFactory.getLogger(JettyForkedChild.class); protected JettyEmbedder jetty; protected File tokenFile; diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenMetaInfConfiguration.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenMetaInfConfiguration.java index 447215decec..ac0175e77bb 100644 --- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenMetaInfConfiguration.java +++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenMetaInfConfiguration.java @@ -23,12 +23,12 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.Configuration; import org.eclipse.jetty.webapp.MetaInfConfiguration; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * MavenWebInfConfiguration @@ -38,7 +38,7 @@ import org.eclipse.jetty.webapp.WebAppContext; */ public class MavenMetaInfConfiguration extends MetaInfConfiguration { - private static final Logger LOG = Log.getLogger(MavenMetaInfConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(MavenMetaInfConfiguration.class); protected static int COUNTER = 0; diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenQuickStartConfiguration.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenQuickStartConfiguration.java index 166e2edf3f6..6199d45a7d1 100644 --- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenQuickStartConfiguration.java +++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenQuickStartConfiguration.java @@ -20,19 +20,19 @@ package org.eclipse.jetty.maven.plugin; import org.eclipse.jetty.quickstart.QuickStartConfiguration; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.ResourceCollection; import org.eclipse.jetty.webapp.Configuration; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * MavenQuickStartConfiguration */ public class MavenQuickStartConfiguration extends QuickStartConfiguration { - private static final Logger LOG = Log.getLogger(QuickStartConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(QuickStartConfiguration.class); @Override public Class replaces() diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenWebAppContext.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenWebAppContext.java index 6937850ae0d..7aae9d0b533 100644 --- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenWebAppContext.java +++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenWebAppContext.java @@ -37,14 +37,14 @@ import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletMapping; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.ResourceCollection; import org.eclipse.jetty.webapp.Configuration; import org.eclipse.jetty.webapp.Configurations; import org.eclipse.jetty.webapp.MetaInfConfiguration; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * MavenWebAppContext @@ -56,7 +56,7 @@ import org.eclipse.jetty.webapp.WebAppContext; */ public class MavenWebAppContext extends WebAppContext { - private static final Logger LOG = Log.getLogger(MavenWebAppContext.class); + private static final Logger LOG = LoggerFactory.getLogger(MavenWebAppContext.class); private static final String DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN = ".*/javax.servlet-[^/]*\\.jar$|.*/jetty-servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar"; @@ -425,7 +425,7 @@ public class MavenWebAppContext extends WebAppContext } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } return resource; diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenWebInfConfiguration.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenWebInfConfiguration.java index 6d7201923bb..80901607c94 100644 --- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenWebInfConfiguration.java +++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/MavenWebInfConfiguration.java @@ -20,12 +20,12 @@ package org.eclipse.jetty.maven.plugin; import java.io.File; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.Configuration; import org.eclipse.jetty.webapp.WebAppClassLoader; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.webapp.WebInfConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * MavenWebInfConfiguration @@ -35,7 +35,7 @@ import org.eclipse.jetty.webapp.WebInfConfiguration; */ public class MavenWebInfConfiguration extends WebInfConfiguration { - private static final Logger LOG = Log.getLogger(MavenWebInfConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(MavenWebInfConfiguration.class); public MavenWebInfConfiguration() { diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/SelectiveJarResource.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/SelectiveJarResource.java index cc74752e11d..41697a26218 100644 --- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/SelectiveJarResource.java +++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/SelectiveJarResource.java @@ -35,9 +35,9 @@ import org.codehaus.plexus.util.SelectorUtils; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.JarResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * SelectiveJarResource @@ -46,7 +46,7 @@ import org.eclipse.jetty.util.resource.JarResource; */ public class SelectiveJarResource extends JarResource { - private static final Logger LOG = Log.getLogger(SelectiveJarResource.class); + private static final Logger LOG = LoggerFactory.getLogger(SelectiveJarResource.class); /** * Default matches every resource. diff --git a/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/TestForkedChild.java b/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/TestForkedChild.java index 4a5e3cdba60..8696223f210 100644 --- a/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/TestForkedChild.java +++ b/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/TestForkedChild.java @@ -42,11 +42,11 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; /** * Test the JettyForkedChild class, which * is the main that is executed by jetty:run/start in mode FORKED. - * */ public class TestForkedChild { @@ -107,11 +107,14 @@ public class TestForkedChild testDir.mkdirs(); tmpDir = new File(testDir, "tmp"); webappPropsFile = new File(testDir, "webapp.props"); - - stopPort = Integer.valueOf(System.getProperty("stop.port")); + + String stopPortString = System.getProperty("stop.port"); + assertNotNull(stopPortString, "stop.port System property"); + stopPort = Integer.valueOf(stopPortString); jettyPortString = System.getProperty("jetty.port"); + assertNotNull(jettyPortString, "jetty.port System property"); jettyPort = Integer.valueOf(jettyPortString); - + Random random = new Random(); token = Long.toString(random.nextLong() ^ System.currentTimeMillis(), 36).toUpperCase(Locale.ENGLISH); tokenFile = testDir.toPath().resolve(token + ".txt").toFile(); diff --git a/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/TestJettyEmbedder.java b/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/TestJettyEmbedder.java index d52c4da6857..0f220b1cf3e 100644 --- a/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/TestJettyEmbedder.java +++ b/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/TestJettyEmbedder.java @@ -33,10 +33,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -/** - * - * - */ public class TestJettyEmbedder { @@ -82,7 +78,7 @@ public class TestJettyEmbedder MavenWebAppContext webApp = new MavenWebAppContext(); Server server = new Server(); Map jettyProperties = new HashMap<>(); - jettyProperties.put("jetty.server.dumpAfterStart", "true"); + jettyProperties.put("jetty.server.dumpAfterStart", "false"); ContextHandler otherHandler = new ContextHandler(); otherHandler.setContextPath("/other"); diff --git a/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/TestWebAppPropertyConverter.java b/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/TestWebAppPropertyConverter.java index 97291bafce5..9b238d2647f 100644 --- a/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/TestWebAppPropertyConverter.java +++ b/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/TestWebAppPropertyConverter.java @@ -35,6 +35,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.instanceOf; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -152,7 +153,7 @@ public class TestWebAppPropertyConverter assertEquals(true, webApp.isPersistTempDirectory()); assertEquals(war.getAbsolutePath(), webApp.getWar()); assertEquals(webXml.getAbsolutePath(), webApp.getDescriptor()); - assertTrue(webApp.getBaseResource() instanceof ResourceCollection); + assertThat(webApp.getBaseResource(), instanceOf(ResourceCollection.class)); assertThat(webApp.getBaseResource().toString(), Matchers.containsString(Resource.newResource(base1).toString())); assertThat(webApp.getBaseResource().toString(), Matchers.containsString(Resource.newResource(base2).toString())); } diff --git a/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/IntegrationTestGetContent.java b/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/IntegrationTestGetContent.java index 03340d6391e..7ee511214ed 100644 --- a/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/IntegrationTestGetContent.java +++ b/jetty-maven-plugin/src/test/java/org/eclipse/jetty/maven/plugin/it/IntegrationTestGetContent.java @@ -75,7 +75,7 @@ public class IntegrationTestGetContent } String response = httpClient.GET(url).getContentAsString(); assertTrue(response.contains(contentCheck), "it test " + System.getProperty("maven.it.name") + - ", response not contentCheck: " + contentCheck + ", response:" + response); + ", response not contentCheck: " + contentCheck + ", response:" + response); System.out.println("contentCheck"); } if (Boolean.getBoolean("helloTestServlet")) @@ -104,8 +104,9 @@ public class IntegrationTestGetContent int attempts = 70; int port = -1; String s = System.getProperty("jetty.port.file"); - assertNotNull(s); + assertNotNull(s, "jetty.port.file System property"); Path p = Paths.get(s); + System.err.println("Looking for port file: " + p); while (true) { if (Files.exists(p)) @@ -127,8 +128,9 @@ public class IntegrationTestGetContent } else { - Thread.currentThread().sleep(1000); + Thread.sleep(1000); } + System.err.printf(" attempts left: #%d%n", attempts); } } return port; diff --git a/jetty-maven-plugin/src/test/resources/embedder-context.xml b/jetty-maven-plugin/src/test/resources/embedder-context.xml index f2c058e0fda..c13affca5e7 100644 --- a/jetty-maven-plugin/src/test/resources/embedder-context.xml +++ b/jetty-maven-plugin/src/test/resources/embedder-context.xml @@ -1,8 +1,6 @@ - - - /embedder - + + /embedder diff --git a/jetty-memcached/jetty-memcached-sessions/src/main/config/modules/sessions/session-data-cache/xmemcached.mod b/jetty-memcached/jetty-memcached-sessions/src/main/config/modules/sessions/session-data-cache/xmemcached.mod index 77a21ea759f..017c004f4b9 100644 --- a/jetty-memcached/jetty-memcached-sessions/src/main/config/modules/sessions/session-data-cache/xmemcached.mod +++ b/jetty-memcached/jetty-memcached-sessions/src/main/config/modules/sessions/session-data-cache/xmemcached.mod @@ -8,7 +8,7 @@ session [depends] session-store -slf4j-api +logging/slf4j [files] maven://com.googlecode.xmemcached/xmemcached/2.4.5|lib/xmemcached/xmemcached-2.4.5.jar diff --git a/jetty-openid/src/test/resources/jetty-logging.properties b/jetty-openid/src/test/resources/jetty-logging.properties index c73ac07f8ac..6f21b764f54 100755 --- a/jetty-openid/src/test/resources/jetty-logging.properties +++ b/jetty-openid/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl # org.eclipse.jetty.LEVEL=DEBUG # org.eclipse.jetty.security.openid.LEVEL=DEBUG \ No newline at end of file diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java index ba0aa680755..a5b0022a065 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java @@ -37,7 +37,6 @@ import org.eclipse.jetty.io.ClientConnector; import org.eclipse.jetty.osgi.boot.OSGiServerConstants; import org.eclipse.jetty.toolchain.test.FS; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.StdErrLog; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.ops4j.pax.exam.CoreOptions; import org.ops4j.pax.exam.Option; @@ -132,6 +131,8 @@ public class TestOSGiUtil res.add(mavenBundle().groupId("org.apache.aries.spifly").artifactId("org.apache.aries.spifly.dynamic.bundle").versionAsInProject().start()); res.add(mavenBundle().groupId("jakarta.annotation").artifactId("jakarta.annotation-api").versionAsInProject().start()); res.add(mavenBundle().groupId("org.apache.geronimo.specs").artifactId("geronimo-jta_1.1_spec").version("1.1.1").start()); + res.add(mavenBundle().groupId("org.slf4j").artifactId("slf4j-api").versionAsInProject().noStart()); + res.add(mavenBundle().groupId("org.slf4j").artifactId("slf4j-log4j12").versionAsInProject().noStart()); res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-util").versionAsInProject().start()); res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-deploy").versionAsInProject().start()); res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-server").versionAsInProject().start()); @@ -304,9 +305,7 @@ public class TestOSGiUtil options.add(mavenBundle().groupId("org.slf4j").artifactId("jul-to-slf4j").versionAsInProject().start()); options.add(mavenBundle().groupId("org.slf4j").artifactId("slf4j-log4j12").versionAsInProject().start()); options.add(mavenBundle().groupId("log4j").artifactId("log4j").versionAsInProject().start()); - options.add(systemProperty("org.eclipse.jetty.util.log.class").value(Slf4jLog.class.getName())); */ - options.add(systemProperty("org.eclipse.jetty.util.log.class").value(StdErrLog.class.getName())); options.add(systemProperty("org.eclipse.jetty.LEVEL").value("INFO")); return options; } diff --git a/jetty-plus/src/main/java/module-info.java b/jetty-plus/src/main/java/module-info.java index 3437b8fd765..0db6561deb0 100644 --- a/jetty-plus/src/main/java/module-info.java +++ b/jetty-plus/src/main/java/module-info.java @@ -29,6 +29,7 @@ module org.eclipse.jetty.plus requires org.eclipse.jetty.jndi; requires transitive org.eclipse.jetty.webapp; + requires org.slf4j; // Only required if using DataSourceLoginService. requires static java.sql; diff --git a/jetty-proxy/pom.xml b/jetty-proxy/pom.xml index d8964411ccd..0066877b80f 100644 --- a/jetty-proxy/pom.xml +++ b/jetty-proxy/pom.xml @@ -27,6 +27,10 @@ + + org.slf4j + slf4j-api + org.eclipse.jetty.toolchain jetty-servlet-api diff --git a/jetty-proxy/src/main/java/module-info.java b/jetty-proxy/src/main/java/module-info.java index 4f0b439c1dd..10a07fbc8eb 100644 --- a/jetty-proxy/src/main/java/module-info.java +++ b/jetty-proxy/src/main/java/module-info.java @@ -22,4 +22,5 @@ module org.eclipse.jetty.proxy requires transitive org.eclipse.jetty.client; requires transitive org.eclipse.jetty.server; + requires transitive org.slf4j; } diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AbstractProxyServlet.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AbstractProxyServlet.java index 002d5b3b7bd..19ce91ed7e1 100644 --- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AbstractProxyServlet.java +++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AbstractProxyServlet.java @@ -51,9 +51,9 @@ import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.io.ClientConnector; import org.eclipse.jetty.util.HttpCookieStore; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.QueuedThreadPool; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Abstract base class for proxy servlets.

@@ -151,7 +151,7 @@ public abstract class AbstractProxyServlet extends HttpServlet catch (Exception x) { if (_log.isDebugEnabled()) - _log.debug(x); + _log.debug("Failed to stop client", x); } } @@ -208,7 +208,7 @@ public abstract class AbstractProxyServlet extends HttpServlet { servletName = getClass().getName() + "." + servletName; } - return Log.getLogger(servletName); + return LoggerFactory.getLogger(servletName); } /** @@ -692,14 +692,14 @@ public abstract class AbstractProxyServlet extends HttpServlet } catch (Exception e) { - _log.ignore(e); + _log.trace("IGNORED", e); try { proxyResponse.sendError(-1); } catch (Exception e2) { - _log.ignore(e2); + _log.trace("IGNORED", e2); } } finally diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java index da638db8941..0d153bafd92 100644 --- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java +++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java @@ -332,7 +332,7 @@ public class ProxyServlet extends AbstractProxyServlet } catch (Throwable x) { - _log.ignore(x); + _log.trace("IGNORED", x); } } diff --git a/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/AsyncMiddleManServletTest.java b/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/AsyncMiddleManServletTest.java index 6937aa50b5a..a77330e3765 100644 --- a/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/AsyncMiddleManServletTest.java +++ b/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/AsyncMiddleManServletTest.java @@ -61,6 +61,7 @@ import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpHeaderValue; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.io.RuntimeIOException; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpConnectionFactory; @@ -75,7 +76,6 @@ import org.eclipse.jetty.util.Utf8StringBuilder; import org.eclipse.jetty.util.ajax.JSON; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Disabled; diff --git a/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletFailureTest.java b/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletFailureTest.java index ac2d93a5f37..e226745bae3 100644 --- a/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletFailureTest.java +++ b/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletFailureTest.java @@ -43,6 +43,7 @@ import org.eclipse.jetty.client.util.BytesContentProvider; import org.eclipse.jetty.client.util.DeferredContentProvider; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.tools.HttpTester; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.server.Server; @@ -50,7 +51,6 @@ import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.params.ParameterizedTest; diff --git a/jetty-proxy/src/test/resources/jetty-logging.properties b/jetty-proxy/src/test/resources/jetty-logging.properties index af4d4f4fd55..7e7e5ce6384 100644 --- a/jetty-proxy/src/test/resources/jetty-logging.properties +++ b/jetty-proxy/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.client.LEVEL=DEBUG #org.eclipse.jetty.proxy.LEVEL=DEBUG diff --git a/jetty-quickstart/src/main/java/module-info.java b/jetty-quickstart/src/main/java/module-info.java index d21970a7301..2bf0a15d606 100644 --- a/jetty-quickstart/src/main/java/module-info.java +++ b/jetty-quickstart/src/main/java/module-info.java @@ -22,4 +22,5 @@ module org.eclipse.jetty.quickstart requires jetty.servlet.api; requires transitive org.eclipse.jetty.annotations; + requires org.slf4j; } diff --git a/jetty-rewrite/src/main/java/module-info.java b/jetty-rewrite/src/main/java/module-info.java index 685a4032f0f..7fa740254e8 100644 --- a/jetty-rewrite/src/main/java/module-info.java +++ b/jetty-rewrite/src/main/java/module-info.java @@ -23,4 +23,5 @@ module org.eclipse.jetty.rewrite requires jetty.servlet.api; requires transitive org.eclipse.jetty.server; + requires org.slf4j; } diff --git a/jetty-security/src/main/java/module-info.java b/jetty-security/src/main/java/module-info.java index bbb9d6fc4a7..06c20fccb8e 100644 --- a/jetty-security/src/main/java/module-info.java +++ b/jetty-security/src/main/java/module-info.java @@ -24,6 +24,7 @@ module org.eclipse.jetty.security exports org.eclipse.jetty.security.authentication; requires transitive org.eclipse.jetty.server; + requires org.slf4j; // Only required if using JDBCLoginService. requires static java.sql; diff --git a/jetty-security/src/test/resources/jetty-logging.properties b/jetty-security/src/test/resources/jetty-logging.properties index 24d5e3aadc7..e6d3c167d1f 100755 --- a/jetty-security/src/test/resources/jetty-logging.properties +++ b/jetty-security/src/test/resources/jetty-logging.properties @@ -1,6 +1,5 @@ # Setup default logging implementation for during testing -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog - +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.util.PathWatcher.LEVEL=DEBUG diff --git a/jetty-server/pom.xml b/jetty-server/pom.xml index af6e5b32e47..ceccb93e0f3 100644 --- a/jetty-server/pom.xml +++ b/jetty-server/pom.xml @@ -61,6 +61,10 @@ ${project.version} true
+ + org.slf4j + slf4j-api + org.eclipse.jetty diff --git a/jetty-server/src/main/config/modules/server.mod b/jetty-server/src/main/config/modules/server.mod index a6d85c7d5a4..6118e9abeac 100644 --- a/jetty-server/src/main/config/modules/server.mod +++ b/jetty-server/src/main/config/modules/server.mod @@ -7,11 +7,11 @@ Enables the core Jetty server on the classpath. jvm ext resources -logging [depend] threadpool bytebufferpool +logging [lib] lib/jetty-servlet-api-4.0.*.jar diff --git a/jetty-server/src/main/java/module-info.java b/jetty-server/src/main/java/module-info.java index 2c1a31d338a..3bba30e7b79 100644 --- a/jetty-server/src/main/java/module-info.java +++ b/jetty-server/src/main/java/module-info.java @@ -25,6 +25,7 @@ module org.eclipse.jetty.server exports org.eclipse.jetty.server.jmx to org.eclipse.jetty.jmx; exports org.eclipse.jetty.server.session; + requires transitive org.slf4j; requires transitive jetty.servlet.api; requires transitive org.eclipse.jetty.http; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Slf4jRequestLogWriter.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Slf4jRequestLogWriter.java index 9dfcc4bb1cf..e5faf948df7 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Slf4jRequestLogWriter.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Slf4jRequestLogWriter.java @@ -23,7 +23,7 @@ import java.io.IOException; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Slf4jLog; +import org.slf4j.LoggerFactory; /** * Request log writer using a Slf4jLog Logger @@ -31,7 +31,7 @@ import org.eclipse.jetty.util.log.Slf4jLog; @ManagedObject("Slf4j RequestLog Writer") public class Slf4jRequestLogWriter extends AbstractLifeCycle implements RequestLog.Writer { - private Slf4jLog logger; + private org.slf4j.Logger logger; private String loggerName; public Slf4jRequestLogWriter() @@ -65,7 +65,7 @@ public class Slf4jRequestLogWriter extends AbstractLifeCycle implements RequestL @Override protected synchronized void doStart() throws Exception { - logger = new Slf4jLog(loggerName); + logger = LoggerFactory.getLogger(loggerName); super.doStart(); } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java index fee184e224e..93b199cfc42 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java @@ -88,6 +88,7 @@ import org.eclipse.jetty.util.component.Graceful; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.LoggerFactory; /** * ContextHandler. @@ -190,7 +191,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu private String[] _vhosts; // Host name portion, matching _vconnectors array private boolean[] _vhostswildcard; private String[] _vconnectors; // connector portion, matching _vhosts array - private Logger _logger; + private org.slf4j.Logger _logger; private boolean _allowNullPathInfo; private int _maxFormKeys = Integer.getInteger(MAX_FORM_KEYS_KEY, DEFAULT_MAX_FORM_KEYS); private int _maxFormContentSize = Integer.getInteger(MAX_FORM_CONTENT_SIZE_KEY, DEFAULT_MAX_FORM_CONTENT_SIZE); @@ -734,12 +735,12 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } } - public Logger getLogger() + public org.slf4j.Logger getLogger() { return _logger; } - public void setLogger(Logger logger) + public void setLogger(org.slf4j.Logger logger) { _logger = logger; } @@ -753,7 +754,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu throw new IllegalStateException("Null contextPath"); if (_logger == null) - _logger = Log.getLogger(ContextHandler.class.getName() + getLogNameSuffix()); + _logger = LoggerFactory.getLogger(ContextHandler.class.getName() + getLogNameSuffix()); ClassLoader oldClassloader = null; Thread currentThread = null; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/AbstractHttpTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/AbstractHttpTest.java index d73c7b756f0..fd694f3276d 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/AbstractHttpTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/AbstractHttpTest.java @@ -33,8 +33,8 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.http.tools.HttpTester; import org.eclipse.jetty.io.ArrayByteBufferPool; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java index 25ab92ab85b..693dbf1bf02 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java @@ -37,11 +37,11 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.io.AbstractConnection; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.ssl.SslConnection; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Tag; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ErrorHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ErrorHandlerTest.java index 263fcb372aa..b6335bf287d 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ErrorHandlerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ErrorHandlerTest.java @@ -31,9 +31,9 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.BadMessageException; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.tools.HttpTester; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.util.ajax.JSON; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java index 972dcee7b73..d2acbc5c99c 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java @@ -47,13 +47,12 @@ import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpParser; import org.eclipse.jetty.http.MimeTypes; import org.eclipse.jetty.http.tools.HttpTester; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.LocalConnector.LocalEndPoint; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.ErrorHandler; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -61,6 +60,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -72,6 +72,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class HttpConnectionTest { + private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(HttpConnectionTest.class); private Server server; private LocalConnector connector; @@ -1121,10 +1122,9 @@ public class HttpConnectionTest "\r\n" + "abcdefghij\r\n"; - Logger logger = Log.getLogger(HttpChannel.class); - try (StacklessLogging stackless = new StacklessLogging(logger)) + try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class)) { - logger.info("EXPECTING: java.lang.IllegalStateException..."); + LOG.info("EXPECTING: java.lang.IllegalStateException..."); String response = connector.getResponse(requests); offset = checkContains(response, offset, "HTTP/1.1 500"); offset = checkContains(response, offset, "Connection: close"); @@ -1246,11 +1246,10 @@ public class HttpConnectionTest }); server.start(); - Logger logger = Log.getLogger(HttpChannel.class); String response = null; - try (StacklessLogging stackless = new StacklessLogging(logger)) + try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class)) { - logger.info("Expect IOException: Response header too large..."); + LOG.info("Expect IOException: Response header too large..."); response = connector.getResponse("GET / HTTP/1.1\r\n" + "Host: localhost\r\n" + "\r\n" @@ -1313,7 +1312,7 @@ public class HttpConnectionTest public void testAsterisk() throws Exception { String response = null; - try (StacklessLogging stackless = new StacklessLogging(HttpParser.LOG)) + try (StacklessLogging stackless = new StacklessLogging(HttpParser.class)) { int offset = 0; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToAsyncCommitTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToAsyncCommitTest.java index 4c355aac6da..3f9d323a90c 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToAsyncCommitTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpManyWaysToAsyncCommitTest.java @@ -34,7 +34,7 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.http.tools.HttpTester; -import org.eclipse.jetty.util.log.StacklessLogging; +import org.eclipse.jetty.logging.StacklessLogging; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java index 0d41ec5817d..bd2e83ce4fc 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java @@ -44,18 +44,19 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.tools.HttpTester; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.EofException; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.AbstractLogger; import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; import org.junit.jupiter.api.condition.DisabledOnJre; import org.junit.jupiter.api.condition.JRE; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -70,6 +71,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public abstract class HttpServerTestBase extends HttpServerTestFixture { + private static final Logger LOG = LoggerFactory.getLogger(HttpServerTestBase.class); private static final String REQUEST1_HEADER = "POST / HTTP/1.0\n" + "Host: localhost\n" + "Content-Type: text/xml; charset=utf-8\n" + @@ -1308,7 +1310,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture try (Socket client = newSocket(_serverURI.getHost(), _serverURI.getPort()); StacklessLogging stackless = new StacklessLogging(HttpChannel.class)) { - ((AbstractLogger)Log.getLogger(HttpChannel.class)).info("Expecting exception after commit then could not send 500...."); + LOG.info("Expecting exception after commit then could not send 500...."); OutputStream os = client.getOutputStream(); InputStream is = client.getInputStream(); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/PartialRFC2616Test.java b/jetty-server/src/test/java/org/eclipse/jetty/server/PartialRFC2616Test.java index 17d2e7adb30..a45a8d91be2 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/PartialRFC2616Test.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/PartialRFC2616Test.java @@ -24,10 +24,10 @@ import java.util.concurrent.TimeUnit; import org.eclipse.jetty.http.HttpFields; import org.eclipse.jetty.http.HttpParser; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.LocalConnector.LocalEndPoint; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.HandlerCollection; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ProxyConnectionTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ProxyConnectionTest.java index e5ef9fda146..93bf04a133b 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ProxyConnectionTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ProxyConnectionTest.java @@ -24,10 +24,10 @@ import java.util.function.Consumer; import java.util.stream.Stream; import org.eclipse.jetty.http.HttpVersion; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.ErrorHandler; import org.eclipse.jetty.toolchain.test.Net; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.params.ParameterizedTest; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java index 9ca079271ca..198392ae295 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java @@ -37,7 +37,6 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; - import javax.servlet.DispatcherType; import javax.servlet.MultipartConfigElement; import javax.servlet.ServletException; @@ -53,6 +52,7 @@ import org.eclipse.jetty.http.HttpCompliance; import org.eclipse.jetty.http.MimeTypes; import org.eclipse.jetty.http.pathmap.ServletPathSpec; import org.eclipse.jetty.http.tools.HttpTester; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.LocalConnector.LocalEndPoint; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.ContextHandler; @@ -63,7 +63,6 @@ import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorTest.java index d9485215956..11ce1879cc7 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorTest.java @@ -39,11 +39,11 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.SocketChannelEndPoint; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.DefaultHandler; import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorTimeoutTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorTimeoutTest.java index 465a7871a8b..0ec2c4ae857 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorTimeoutTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorTimeoutTest.java @@ -31,10 +31,10 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.session.SessionHandler; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/NcsaRequestLogTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/NcsaRequestLogTest.java index 632cf7d5cd9..573e671035c 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/NcsaRequestLogTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/NcsaRequestLogTest.java @@ -33,6 +33,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.BadMessageException; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.CustomRequestLog; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.HttpChannel; @@ -45,7 +46,6 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assumptions; diff --git a/jetty-server/src/test/resources/jetty-logging.properties b/jetty-server/src/test/resources/jetty-logging.properties index 21db0759fe3..407a732c85d 100644 --- a/jetty-server/src/test/resources/jetty-logging.properties +++ b/jetty-server/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.server.LEVEL=DEBUG #org.eclipse.jetty.server.ConnectionLimit.LEVEL=DEBUG diff --git a/jetty-servlet/src/main/java/module-info.java b/jetty-servlet/src/main/java/module-info.java index 490efab586a..df68f9f4117 100644 --- a/jetty-servlet/src/main/java/module-info.java +++ b/jetty-servlet/src/main/java/module-info.java @@ -23,6 +23,7 @@ module org.eclipse.jetty.servlet exports org.eclipse.jetty.servlet.listener; requires transitive org.eclipse.jetty.security; + requires org.slf4j; // Only required if using StatisticsServlet. requires static java.management; diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java index 2a7cda734d4..23b3ad97101 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java @@ -33,6 +33,7 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; import org.eclipse.jetty.http.tools.HttpTester; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.HttpConnectionFactory; @@ -43,7 +44,6 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.DefaultHandler; import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletTest.java index 0d282e81d9e..ac16a759a6a 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletTest.java @@ -43,6 +43,7 @@ import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.DebugListener; import org.eclipse.jetty.server.HttpChannel; @@ -55,7 +56,6 @@ import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java index 09df044d2a1..a49ca551c1b 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java @@ -49,6 +49,7 @@ import org.eclipse.jetty.http.HttpField; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http.tools.HttpTester; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.LocalConnector; import org.eclipse.jetty.server.ResourceContentFactory; @@ -61,7 +62,6 @@ import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.resource.PathResource; import org.eclipse.jetty.util.resource.Resource; import org.junit.jupiter.api.AfterEach; diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DispatcherTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DispatcherTest.java index 1b13cba102c..2e4452afcc0 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DispatcherTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DispatcherTest.java @@ -47,6 +47,7 @@ import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Dispatcher; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.HttpConfiguration; @@ -59,7 +60,6 @@ import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.UrlEncoded; import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ErrorPageTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ErrorPageTest.java index d576380ca5c..16136b68336 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ErrorPageTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ErrorPageTest.java @@ -43,6 +43,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.BadMessageException; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Dispatcher; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.HttpChannelState; @@ -51,7 +52,6 @@ import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.HandlerWrapper; import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/FilterHolderTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/FilterHolderTest.java index 9a69c9c34d6..57272790f22 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/FilterHolderTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/FilterHolderTest.java @@ -27,8 +27,8 @@ import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -45,15 +45,15 @@ public class FilterHolderTest public DummyFilter() { } - + @Override public void init(FilterConfig filterConfig) throws ServletException { } - + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException - { + { } } @@ -113,7 +113,7 @@ public class FilterHolderTest fh.initialize(); assertEquals(2, counter.get()); } - + @Test public void testCreateInstance() throws Exception { @@ -125,7 +125,7 @@ public class FilterHolderTest holder.setHeldClass(DummyFilter.class); Filter filter = holder.createInstance(); assertNotNull(filter); - + //test with a ServletContextHandler Server server = new Server(); ServletContextHandler context = new ServletContextHandler(); diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ListenerHolderTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ListenerHolderTest.java index 0d2bc1b951f..b2c25bc1592 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ListenerHolderTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ListenerHolderTest.java @@ -20,8 +20,8 @@ package org.eclipse.jetty.servlet; import java.util.EventListener; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/MultiPartServletTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/MultiPartServletTest.java index 91d459d56d6..0189d82b908 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/MultiPartServletTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/MultiPartServletTest.java @@ -35,6 +35,7 @@ import org.eclipse.jetty.client.util.MultiPartContentProvider; import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.http.HttpScheme; import org.eclipse.jetty.http.MimeTypes; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.MultiPartFormInputStream; import org.eclipse.jetty.server.Server; @@ -42,7 +43,6 @@ import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/PostServletTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/PostServletTest.java index 5ece276371e..45786127a94 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/PostServletTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/PostServletTest.java @@ -26,11 +26,11 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.LocalConnector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java index 50951d13bdd..d5149b00ece 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java @@ -60,6 +60,7 @@ import javax.servlet.http.HttpSessionIdListener; import javax.servlet.http.HttpSessionListener; import org.eclipse.jetty.http.pathmap.MappedResource; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.security.ConstraintSecurityHandler; import org.eclipse.jetty.security.RoleInfo; import org.eclipse.jetty.security.SecurityHandler; @@ -80,14 +81,12 @@ import org.eclipse.jetty.server.session.SessionHandler; import org.eclipse.jetty.util.DecoratedObjectFactory; import org.eclipse.jetty.util.Decorator; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.function.Executable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -725,7 +724,7 @@ public class ServletContextHandlerTest public void testAddServletFromServlet() throws Exception { //A servlet cannot be added by another servlet - Logger logger = Log.getLogger(ContextHandler.class.getName() + "ROOT"); + Logger logger = LoggerFactory.getLogger(ContextHandler.class.getName() + "ROOT"); try (StacklessLogging stackless = new StacklessLogging(logger)) { @@ -754,7 +753,7 @@ public class ServletContextHandlerTest public void testAddFilterFromServlet() throws Exception { //A filter cannot be added from a servlet - Logger logger = Log.getLogger(ContextHandler.class.getName() + "ROOT"); + Logger logger = LoggerFactory.getLogger(ContextHandler.class.getName() + "ROOT"); try (StacklessLogging stackless = new StacklessLogging(logger)) { @@ -783,7 +782,7 @@ public class ServletContextHandlerTest public void testAddServletByClassFromFilter() throws Exception { //A servlet cannot be added from a Filter - Logger logger = Log.getLogger(ContextHandler.class.getName() + "ROOT"); + Logger logger = LoggerFactory.getLogger(ContextHandler.class.getName() + "ROOT"); try (StacklessLogging stackless = new StacklessLogging(logger)) { @@ -835,7 +834,7 @@ public class ServletContextHandlerTest public void testAddServletByInstanceFromFilter() throws Exception { //A servlet cannot be added from a Filter - Logger logger = Log.getLogger(ContextHandler.class.getName() + "ROOT"); + Logger logger = LoggerFactory.getLogger(ContextHandler.class.getName() + "ROOT"); try (StacklessLogging stackless = new StacklessLogging(logger)) { @@ -887,7 +886,7 @@ public class ServletContextHandlerTest public void testAddServletByClassNameFromFilter() throws Exception { //A servlet cannot be added from a Filter - Logger logger = Log.getLogger(ContextHandler.class.getName() + "ROOT"); + Logger logger = LoggerFactory.getLogger(ContextHandler.class.getName() + "ROOT"); try (StacklessLogging stackless = new StacklessLogging(logger)) { diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletHolderTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletHolderTest.java index 6627dee8326..cf05efa8e9e 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletHolderTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletHolderTest.java @@ -20,16 +20,15 @@ package org.eclipse.jetty.servlet; import java.util.Collections; import java.util.Set; - import javax.servlet.Servlet; import javax.servlet.ServletRegistration; import javax.servlet.UnavailableException; import javax.servlet.http.HttpServlet; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.MultiException; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -117,7 +116,7 @@ public class ServletHolderTest assertEquals("org.apache.jsp.a.b.c.blah_jsp", h.getClassNameForJsp("/a/b/c/blah.jsp")); assertEquals("org.apache.jsp.a.b.c.blah_jsp", h.getClassNameForJsp("a/b/c/blah.jsp")); } - + @Test public void testCreateInstance() throws Exception { @@ -129,7 +128,7 @@ public class ServletHolderTest holder.setHeldClass(FakeServlet.class); Servlet servlet = holder.createInstance(); assertNotNull(servlet); - + //test with a ServletContextHandler Server server = new Server(); ServletContextHandler context = new ServletContextHandler(); @@ -165,7 +164,7 @@ public class ServletHolderTest assertThat(e.getCause().getMessage(), containsString("foo")); } } - + @Test public void testWithClass() throws Exception { @@ -183,7 +182,7 @@ public class ServletHolderTest assertTrue(holder.isStarted()); } } - + @Test public void testWithClassName() throws Exception { @@ -199,7 +198,7 @@ public class ServletHolderTest handler.start(); assertTrue(holder.isAvailable()); assertTrue(holder.isStarted()); - } + } } @Test diff --git a/jetty-servlet/src/test/resources/jetty-logging.properties b/jetty-servlet/src/test/resources/jetty-logging.properties index 37f092141fc..821cf3d2f35 100644 --- a/jetty-servlet/src/test/resources/jetty-logging.properties +++ b/jetty-servlet/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl org.eclipse.jetty.LEVEL=INFO #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.server.LEVEL=DEBUG diff --git a/jetty-servlets/src/main/java/module-info.java b/jetty-servlets/src/main/java/module-info.java index 0f0c0ba254f..7457afe64c8 100644 --- a/jetty-servlets/src/main/java/module-info.java +++ b/jetty-servlets/src/main/java/module-info.java @@ -24,6 +24,7 @@ module org.eclipse.jetty.servlets exports org.eclipse.jetty.servlets; requires transitive jetty.servlet.api; + requires org.slf4j; // Only required if using CloseableDoSFilter. requires static org.eclipse.jetty.io; diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ThreadStarvationTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ThreadStarvationTest.java index c21e12e0cd6..dd5db390cea 100644 --- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ThreadStarvationTest.java +++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ThreadStarvationTest.java @@ -48,6 +48,7 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.io.ChannelEndPoint; import org.eclipse.jetty.io.ManagedSelector; import org.eclipse.jetty.io.SocketChannelEndPoint; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; @@ -56,7 +57,6 @@ import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/jetty-servlets/src/test/resources/jetty-logging.properties b/jetty-servlets/src/test/resources/jetty-logging.properties index 3ceebb81afb..1e8385fcbd1 100644 --- a/jetty-servlets/src/test/resources/jetty-logging.properties +++ b/jetty-servlets/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.servlets.LEVEL=DEBUG #org.eclipse.jetty.servlet.ServletTester.LEVEL=DEBUG diff --git a/jetty-slf4j-impl/pom.xml b/jetty-slf4j-impl/pom.xml new file mode 100644 index 00000000000..aa59baac28b --- /dev/null +++ b/jetty-slf4j-impl/pom.xml @@ -0,0 +1,38 @@ + + + org.eclipse.jetty + jetty-project + 10.0.0-SNAPSHOT + + 4.0.0 + jetty-slf4j-impl + Jetty :: Slf4j Implementation + Slf4j Logging Implementation based on Jetty's older StdErrLog + http://www.eclipse.org/jetty + + ${project.groupId}.logging + + + + + org.apache.felix + maven-bundle-plugin + true + + + + + + + + + org.eclipse.jetty.toolchain + jetty-test-helper + test + + + org.slf4j + slf4j-api + + + diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/package-info.java b/jetty-slf4j-impl/src/main/java/module-info.java similarity index 72% rename from jetty-util/src/main/java/org/eclipse/jetty/util/log/package-info.java rename to jetty-slf4j-impl/src/main/java/module-info.java index 32e315704fa..0bfb99cd437 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/package-info.java +++ b/jetty-slf4j-impl/src/main/java/module-info.java @@ -16,8 +16,14 @@ // ======================================================================== // -/** - * Jetty Util : Common Logging Integrations - */ -package org.eclipse.jetty.util.log; +import org.eclipse.jetty.logging.JettyLoggingServiceProvider; +import org.slf4j.spi.SLF4JServiceProvider; +module org.eclipse.jetty.logging +{ + exports org.eclipse.jetty.logging; + + requires transitive org.slf4j; + + provides SLF4JServiceProvider with JettyLoggingServiceProvider; +} diff --git a/jetty-jmx/src/main/java/org/eclipse/jetty/util/log/jmx/package-info.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyAppender.java similarity index 74% rename from jetty-jmx/src/main/java/org/eclipse/jetty/util/log/jmx/package-info.java rename to jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyAppender.java index 47a281520e7..8aa65c21226 100644 --- a/jetty-jmx/src/main/java/org/eclipse/jetty/util/log/jmx/package-info.java +++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyAppender.java @@ -16,8 +16,12 @@ // ======================================================================== // -/** - * Jetty JMX : Jetty Logging JMX Integration - */ -package org.eclipse.jetty.util.log.jmx; +package org.eclipse.jetty.logging; +import org.slf4j.event.Level; + +public interface JettyAppender +{ + void emit(JettyLogger logger, Level level, long timestamp, String threadName, + Throwable throwable, String message, Object... argumentArray); +} diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLogger.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLogger.java new file mode 100644 index 00000000000..90e1a639b5b --- /dev/null +++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLogger.java @@ -0,0 +1,678 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under +// the terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0 +// +// This Source Code may also be made available under the following +// Secondary Licenses when the conditions for such availability set +// forth in the Eclipse Public License, v. 2.0 are satisfied: +// the Apache License v2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.logging; + +import java.util.Objects; + +import org.slf4j.Logger; +import org.slf4j.Marker; +import org.slf4j.event.Level; +import org.slf4j.event.LoggingEvent; +import org.slf4j.helpers.SubstituteLogger; +import org.slf4j.spi.LocationAwareLogger; + +public class JettyLogger implements LocationAwareLogger, Logger +{ + /** + * The Level to set if you want this logger to be "OFF" + */ + public static final int OFF = 999; + /** + * The Level to set if you want this logger to show all events from all levels. + */ + public static final int ALL = -1; + + private final JettyLoggerFactory factory; + private final String name; + private final String condensedName; + private final JettyAppender appender; + private int level; + private boolean hideStacks = false; + + public JettyLogger(JettyLoggerFactory factory, String name, JettyAppender appender) + { + this(factory, name, appender, Level.INFO.toInt(), false); + } + + public JettyLogger(JettyLoggerFactory factory, String name, JettyAppender appender, int level, boolean hideStacks) + { + this.factory = factory; + this.name = name; + this.condensedName = JettyLoggerFactory.condensePackageString(name); + this.appender = appender; + this.level = level; + this.hideStacks = hideStacks; + } + + @Override + public void debug(String msg) + { + if (isDebugEnabled()) + { + emit(Level.DEBUG, msg); + } + } + + @Override + public void debug(String format, Object arg) + { + if (isDebugEnabled()) + { + emit(Level.DEBUG, format, arg); + } + } + + @Override + public void debug(String format, Object arg1, Object arg2) + { + if (isDebugEnabled()) + { + emit(Level.DEBUG, format, arg1, arg2); + } + } + + @Override + public void debug(String format, Object... arguments) + { + if (isDebugEnabled()) + { + emit(Level.DEBUG, format, arguments); + } + } + + @Override + public void debug(String msg, Throwable throwable) + { + if (isDebugEnabled()) + { + emit(Level.DEBUG, msg, throwable); + } + } + + @Override + public boolean isDebugEnabled(Marker marker) + { + return isDebugEnabled(); + } + + @Override + public void debug(Marker marker, String msg) + { + // TODO: do we want to support org.sfl4j.Marker? + debug(msg); + } + + @Override + public void debug(Marker marker, String format, Object arg) + { + // TODO: do we want to support org.sfl4j.Marker? + debug(format, arg); + } + + @Override + public void debug(Marker marker, String format, Object arg1, Object arg2) + { + // TODO: do we want to support org.sfl4j.Marker? + debug(format, arg1, arg2); + } + + @Override + public void debug(Marker marker, String format, Object... arguments) + { + // TODO: do we want to support org.sfl4j.Marker? + debug(format, arguments); + } + + @Override + public void debug(Marker marker, String msg, Throwable t) + { + // TODO: do we want to support org.sfl4j.Marker? + debug(msg, t); + } + + @Override + public void error(String msg) + { + if (isErrorEnabled()) + { + emit(Level.ERROR, msg); + } + } + + @Override + public void error(String format, Object arg) + { + if (isErrorEnabled()) + { + emit(Level.ERROR, format, arg); + } + } + + @Override + public void error(String format, Object arg1, Object arg2) + { + if (isErrorEnabled()) + { + emit(Level.ERROR, format, arg1, arg2); + } + } + + @Override + public void error(String format, Object... arguments) + { + if (isErrorEnabled()) + { + emit(Level.ERROR, format, arguments); + } + } + + @Override + public void error(String msg, Throwable throwable) + { + if (isErrorEnabled()) + { + emit(Level.ERROR, msg, throwable); + } + } + + @Override + public boolean isErrorEnabled(Marker marker) + { + return isErrorEnabled(); + } + + @Override + public void error(Marker marker, String msg) + { + // TODO: do we want to support org.sfl4j.Marker? + error(msg); + } + + @Override + public void error(Marker marker, String format, Object arg) + { + // TODO: do we want to support org.sfl4j.Marker? + error(format, arg); + } + + @Override + public void error(Marker marker, String format, Object arg1, Object arg2) + { + // TODO: do we want to support org.sfl4j.Marker? + error(format, arg1, arg2); + } + + @Override + public void error(Marker marker, String format, Object... arguments) + { + // TODO: do we want to support org.sfl4j.Marker? + error(format, arguments); + } + + @Override + public void error(Marker marker, String msg, Throwable t) + { + // TODO: do we want to support org.sfl4j.Marker? + error(msg, t); + } + + public JettyAppender getAppender() + { + return appender; + } + + /** + * Entry point for {@link LocationAwareLogger} + */ + @Override + public void log(Marker marker, String fqcn, int levelInt, String message, Object[] argArray, Throwable throwable) + { + if (this.level <= levelInt) + { + long timestamp = System.currentTimeMillis(); + String threadName = Thread.currentThread().getName(); + getAppender().emit(this, intToLevel(levelInt), timestamp, threadName, throwable, message, argArray); + } + } + + /** + * Dynamic (via Reflection) entry point for {@link SubstituteLogger} usage. + * + * @param event the logging event + */ + @SuppressWarnings("unused") + public void log(LoggingEvent event) + { + // TODO: do we want to support org.sfl4j.Marker? + // TODO: do we want to support org.sfl4j.even.KeyValuePair? + getAppender().emit(this, event.getLevel(), event.getTimeStamp(), event.getThreadName(), event.getThrowable(), event.getMessage(), event.getArgumentArray()); + } + + public String getCondensedName() + { + return condensedName; + } + + public int getLevel() + { + return level; + } + + public void setLevel(Level level) + { + Objects.requireNonNull(level, "Level"); + setLevel(level.toInt()); + } + + public void setLevel(int lvlInt) + { + this.level = lvlInt; + + // apply setLevel to children too. + factory.walkChildLoggers(this.getName(), (logger) -> logger.setLevel(lvlInt)); + } + + @Override + public String getName() + { + return name; + } + + @Override + public void info(String msg) + { + if (isInfoEnabled()) + { + emit(Level.INFO, msg); + } + } + + @Override + public void info(String format, Object arg) + { + if (isInfoEnabled()) + { + emit(Level.INFO, format, arg); + } + } + + @Override + public void info(String format, Object arg1, Object arg2) + { + if (isInfoEnabled()) + { + emit(Level.INFO, format, arg1, arg2); + } + } + + @Override + public void info(String format, Object... arguments) + { + if (isInfoEnabled()) + { + emit(Level.INFO, format, arguments); + } + } + + @Override + public void info(String msg, Throwable throwable) + { + if (isInfoEnabled()) + { + emit(Level.INFO, msg, throwable); + } + } + + @Override + public boolean isInfoEnabled(Marker marker) + { + return isInfoEnabled(); + } + + @Override + public void info(Marker marker, String msg) + { + // TODO: do we want to support org.sfl4j.Marker? + info(msg); + } + + @Override + public void info(Marker marker, String format, Object arg) + { + // TODO: do we want to support org.sfl4j.Marker? + info(format, arg); + } + + @Override + public void info(Marker marker, String format, Object arg1, Object arg2) + { + // TODO: do we want to support org.sfl4j.Marker? + info(format, arg1, arg2); + } + + @Override + public void info(Marker marker, String format, Object... arguments) + { + // TODO: do we want to support org.sfl4j.Marker? + info(format, arguments); + } + + @Override + public void info(Marker marker, String msg, Throwable t) + { + // TODO: do we want to support org.sfl4j.Marker? + info(msg, t); + } + + @Override + public boolean isDebugEnabled() + { + return level <= Level.DEBUG.toInt(); + } + + @Override + public boolean isErrorEnabled() + { + return level <= Level.ERROR.toInt(); + } + + public boolean isHideStacks() + { + return hideStacks; + } + + public void setHideStacks(boolean hideStacks) + { + this.hideStacks = hideStacks; + + // apply setHideStacks to children too. + factory.walkChildLoggers(this.getName(), (logger) -> logger.setHideStacks(hideStacks)); + } + + @Override + public boolean isInfoEnabled() + { + return level <= Level.INFO.toInt(); + } + + @Override + public boolean isTraceEnabled() + { + return level <= Level.TRACE.toInt(); + } + + @Override + public boolean isWarnEnabled() + { + return level <= Level.WARN.toInt(); + } + + @Override + public void trace(String msg) + { + if (isTraceEnabled()) + { + emit(Level.TRACE, msg); + } + } + + @Override + public void trace(String format, Object arg) + { + if (isTraceEnabled()) + { + emit(Level.TRACE, format, arg); + } + } + + @Override + public void trace(String format, Object arg1, Object arg2) + { + if (isTraceEnabled()) + { + emit(Level.TRACE, format, arg1, arg2); + } + } + + @Override + public void trace(String format, Object... arguments) + { + if (isTraceEnabled()) + { + emit(Level.TRACE, format, arguments); + } + } + + @Override + public void trace(String msg, Throwable throwable) + { + if (isTraceEnabled()) + { + emit(Level.TRACE, msg, throwable); + } + } + + @Override + public boolean isTraceEnabled(Marker marker) + { + return isTraceEnabled(); + } + + @Override + public void trace(Marker marker, String msg) + { + // TODO: do we want to support org.sfl4j.Marker? + trace(msg); + } + + @Override + public void trace(Marker marker, String format, Object arg) + { + // TODO: do we want to support org.sfl4j.Marker? + trace(format, arg); + } + + @Override + public void trace(Marker marker, String format, Object arg1, Object arg2) + { + // TODO: do we want to support org.sfl4j.Marker? + trace(format, arg1, arg2); + } + + @Override + public void trace(Marker marker, String format, Object... argArray) + { + // TODO: do we want to support org.sfl4j.Marker? + trace(format, argArray); + } + + @Override + public void trace(Marker marker, String msg, Throwable t) + { + // TODO: do we want to support org.sfl4j.Marker? + trace(msg, t); + } + + @Override + public void warn(String msg) + { + if (isWarnEnabled()) + { + emit(Level.WARN, msg); + } + } + + @Override + public void warn(String format, Object arg) + { + if (isWarnEnabled()) + { + emit(Level.WARN, format, arg); + } + } + + @Override + public void warn(String format, Object... arguments) + { + if (isWarnEnabled()) + { + emit(Level.WARN, format, arguments); + } + } + + @Override + public void warn(String format, Object arg1, Object arg2) + { + if (isWarnEnabled()) + { + emit(Level.WARN, format, arg1, arg2); + } + } + + @Override + public void warn(String msg, Throwable throwable) + { + if (isWarnEnabled()) + { + emit(Level.WARN, msg, throwable); + } + } + + @Override + public boolean isWarnEnabled(Marker marker) + { + return isWarnEnabled(); + } + + @Override + public void warn(Marker marker, String msg) + { + // TODO: do we want to support org.sfl4j.Marker? + warn(msg); + } + + @Override + public void warn(Marker marker, String format, Object arg) + { + // TODO: do we want to support org.sfl4j.Marker? + warn(format, arg); + } + + @Override + public void warn(Marker marker, String format, Object arg1, Object arg2) + { + // TODO: do we want to support org.sfl4j.Marker? + warn(format, arg1, arg2); + } + + @Override + public void warn(Marker marker, String format, Object... arguments) + { + // TODO: do we want to support org.sfl4j.Marker? + warn(format, arguments); + } + + @Override + public void warn(Marker marker, String msg, Throwable t) + { + // TODO: do we want to support org.sfl4j.Marker? + warn(msg, t); + } + + private void emit(Level level, String msg) + { + long timestamp = System.currentTimeMillis(); + String threadName = Thread.currentThread().getName(); + getAppender().emit(this, level, timestamp, threadName, null, msg); + } + + private void emit(Level level, String format, Object arg) + { + long timestamp = System.currentTimeMillis(); + String threadName = Thread.currentThread().getName(); + if (arg instanceof Throwable) + getAppender().emit(this, level, timestamp, threadName, (Throwable)arg, format); + else + getAppender().emit(this, level, timestamp, threadName, null, format, arg); + } + + private void emit(Level level, String format, Object arg1, Object arg2) + { + long timestamp = System.currentTimeMillis(); + String threadName = Thread.currentThread().getName(); + if (arg2 instanceof Throwable) + getAppender().emit(this, level, timestamp, threadName, (Throwable)arg2, format, arg1); + else + getAppender().emit(this, level, timestamp, threadName, null, format, arg1, arg2); + } + + private void emit(Level level, String format, Object... arguments) + { + long timestamp = System.currentTimeMillis(); + String threadName = Thread.currentThread().getName(); + getAppender().emit(this, level, timestamp, threadName, null, format, arguments); + } + + private void emit(Level level, String msg, Throwable throwable) + { + long timestamp = System.currentTimeMillis(); + String threadName = Thread.currentThread().getName(); + getAppender().emit(this, level, timestamp, threadName, throwable, msg); + } + + public static Level intToLevel(int level) + { + if (level >= JettyLogger.OFF) + return Level.ERROR; + if (level >= Level.ERROR.toInt()) + return Level.ERROR; + if (level >= Level.WARN.toInt()) + return Level.WARN; + if (level >= Level.INFO.toInt()) + return Level.INFO; + if (level >= Level.DEBUG.toInt()) + return Level.DEBUG; + if (level >= Level.TRACE.toInt()) + return Level.TRACE; + return Level.TRACE; // everything else + } + + public static String levelToString(int level) + { + if (level >= JettyLogger.OFF) + return "OFF"; + if (level >= Level.ERROR.toInt()) + return "ERROR"; + if (level >= Level.WARN.toInt()) + return "WARN"; + if (level >= Level.INFO.toInt()) + return "INFO"; + if (level >= Level.DEBUG.toInt()) + return "DEBUG"; + if (level >= Level.TRACE.toInt()) + return "TRACE"; + return "OFF"; // everything else + } + + @Override + public String toString() + { + return String.format("%s:%s:LEVEL=%s", JettyLogger.class.getSimpleName(), name, levelToString(level)); + } +} diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerConfiguration.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerConfiguration.java new file mode 100644 index 00000000000..2864430fee2 --- /dev/null +++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerConfiguration.java @@ -0,0 +1,332 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under +// the terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0 +// +// This Source Code may also be made available under the following +// Secondary Licenses when the conditions for such availability set +// forth in the Eclipse Public License, v. 2.0 are satisfied: +// the Apache License v2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.logging; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Locale; +import java.util.Properties; +import java.util.TimeZone; +import java.util.function.Function; + +import org.slf4j.event.Level; + +/** + * JettyLogger specific configuration: + *
    + *
  • {@code .LEVEL=(String:LevelName)}
  • + *
  • {@code .STACKS=(boolean)}
  • + *
+ */ +public class JettyLoggerConfiguration +{ + private static final int DEFAULT_LEVEL = Level.INFO.toInt(); + private static final boolean DEFAULT_HIDE_STACKS = false; + private static final String SUFFIX_LEVEL = ".LEVEL"; + private static final String SUFFIX_STACKS = ".STACKS"; + + private final Properties properties = new Properties(); + + /** + * Default JettyLogger configuration (empty) + */ + public JettyLoggerConfiguration() + { + } + + /** + * JettyLogger configuration from provided Properties + * + * @param props A set of properties to base this configuration off of + */ + public JettyLoggerConfiguration(Properties props) + { + load(props); + } + + public boolean getHideStacks(String name) + { + if (properties.isEmpty()) + return DEFAULT_HIDE_STACKS; + + String startName = name; + + // strip trailing dot + while (startName.endsWith(".")) + { + startName = startName.substring(0, startName.length() - 1); + } + + // strip ".STACKS" suffix (if present) + if (startName.endsWith(SUFFIX_STACKS)) + { + startName = startName.substring(0, startName.length() - SUFFIX_STACKS.length()); + } + + Boolean hideStacks = walkParentLoggerNames(startName, (key) -> + { + String stacksBool = properties.getProperty(key + SUFFIX_STACKS); + if (stacksBool != null) + { + return Boolean.parseBoolean(stacksBool); + } + return null; + }); + + if (hideStacks != null) + return hideStacks; + + return DEFAULT_HIDE_STACKS; + } + + /** + * Get the Logging Level for the provided log name. Using the FQCN first, then each package segment from longest to + * shortest. + * + * @param name the name to get log for + * @return the logging level int + */ + public int getLevel(String name) + { + if (properties.isEmpty()) + return DEFAULT_LEVEL; + + String startName = name != null ? name : ""; + + // strip trailing dot + while (startName.endsWith(".")) + { + startName = startName.substring(0, startName.length() - 1); + } + + // strip ".LEVEL" suffix (if present) + if (startName.endsWith(SUFFIX_LEVEL)) + { + startName = startName.substring(0, startName.length() - SUFFIX_LEVEL.length()); + } + + Integer level = walkParentLoggerNames(startName, (key) -> + { + String levelStr = properties.getProperty(key + SUFFIX_LEVEL); + if (levelStr != null) + { + return getLevelInt(key, levelStr); + } + return null; + }); + + if (level == null) + { + // try legacy root logging config + String levelStr = properties.getProperty("log" + SUFFIX_LEVEL); + if (levelStr != null) + { + level = getLevelInt("log", levelStr); + } + } + + if (level != null) + return level; + + return DEFAULT_LEVEL; + } + + public TimeZone getTimeZone(String key) + { + String zoneIdStr = properties.getProperty(key); + if (zoneIdStr == null) + return null; + + return TimeZone.getTimeZone(zoneIdStr); + } + + /** + * Load the Configuration from the ClassLoader + * + * @param loader the classloader to use when finding the {@code jetty-logging.properties} resources in. + * Passing {@code null} means the {@link ClassLoader#getSystemClassLoader()} is used. + * @return the configuration + */ + public JettyLoggerConfiguration load(ClassLoader loader) + { + return AccessController.doPrivileged((PrivilegedAction)() -> + { + // First see if the jetty-logging.properties object exists in the classpath. + // * This is an optional feature used by embedded mode use, and test cases to allow for early + // * configuration of the Log class in situations where access to the System.properties are + // * either too late or just impossible. + load(readProperties(loader, "jetty-logging.properties")); + + // Next see if an OS specific jetty-logging.properties object exists in the classpath. + // This really for setting up test specific logging behavior based on OS. + String osName = System.getProperty("os.name"); + if (osName != null && osName.length() > 0) + { + // NOTE: cannot use jetty-util's StringUtil.replace() as it may initialize logging itself. + osName = osName.toLowerCase(Locale.ENGLISH).replace(' ', '-'); + load(readProperties(loader, "jetty-logging-" + osName + ".properties")); + } + + // Now load the System.properties as-is into the properties, + // these values will override any key conflicts in properties. + load(System.getProperties()); + return this; + }); + } + + public boolean getBoolean(String key, boolean defValue) + { + String val = properties.getProperty(key, Boolean.toString(defValue)); + return Boolean.parseBoolean(val); + } + + public int getInt(String key, int defValue) + { + String val = properties.getProperty(key, Integer.toString(defValue)); + if (val == null) + { + return defValue; + } + try + { + return Integer.parseInt(val); + } + catch (NumberFormatException e) + { + return defValue; + } + } + + private Integer getLevelInt(String levelSegment, String levelStr) + { + if (levelStr == null) + { + return null; + } + + String levelName = levelStr.trim().toUpperCase(Locale.ENGLISH); + switch (levelName) + { + case "ALL": + return JettyLogger.ALL; + case "TRACE": + return Level.TRACE.toInt(); + case "DEBUG": + return Level.DEBUG.toInt(); + case "INFO": + return Level.INFO.toInt(); + case "WARN": + return Level.WARN.toInt(); + case "ERROR": + return Level.ERROR.toInt(); + case "OFF": + return JettyLogger.OFF; + default: + System.err.println("Unknown JettyLogger/Slf4J Level [" + levelSegment + "]=[" + levelName + "], expecting only [ALL, TRACE, DEBUG, INFO, WARN, ERROR, OFF] as values."); + return null; + } + } + + private URL getResource(ClassLoader loader, String resourceName) + { + if (loader == null) + { + return ClassLoader.getSystemResource(resourceName); + } + else + { + return loader.getResource(resourceName); + } + } + + /** + * Overlay existing properties with provided properties. + * + * @param props the properties to load + */ + private void load(Properties props) + { + if (props == null) + return; + + for (String name : props.stringPropertyNames()) + { + if (name.startsWith("org.eclipse.jetty.logging.") || + name.endsWith(".LEVEL") || + name.endsWith(".STACKS")) + { + String val = props.getProperty(name); + // Protect against application code insertion of non-String values (returned as null). + if (val != null) + properties.setProperty(name, val); + } + } + } + + private Properties readProperties(ClassLoader loader, String resourceName) + { + URL propsUrl = getResource(loader, resourceName); + if (propsUrl == null) + { + return null; + } + + try (InputStream in = propsUrl.openStream()) + { + Properties p = new Properties(); + p.load(in); + return p; + } + catch (IOException e) + { + System.err.println("[WARN] Error loading logging config: " + propsUrl); + e.printStackTrace(); + } + return null; + } + + private T walkParentLoggerNames(String startName, Function nameFunction) + { + String nameSegment = startName; + + // Checking with FQCN first, then each package segment from longest to shortest. + while ((nameSegment != null) && (nameSegment.length() > 0)) + { + T ret = nameFunction.apply(nameSegment); + if (ret != null) + return ret; + + // Trim and try again. + int idx = nameSegment.lastIndexOf('.'); + if (idx >= 0) + { + nameSegment = nameSegment.substring(0, idx); + } + else + { + nameSegment = null; + } + } + + return null; + } +} diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactory.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactory.java new file mode 100644 index 00000000000..83d39cf71c1 --- /dev/null +++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactory.java @@ -0,0 +1,182 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under +// the terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0 +// +// This Source Code may also be made available under the following +// Secondary Licenses when the conditions for such availability set +// forth in the Eclipse Public License, v. 2.0 are satisfied: +// the Apache License v2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.logging; + +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.function.Consumer; + +import org.slf4j.ILoggerFactory; +import org.slf4j.Logger; + +public class JettyLoggerFactory implements ILoggerFactory +{ + private static final String ROOT_LOGGER_NAME = ""; + private final JettyLoggerConfiguration configuration; + private final JettyLogger rootLogger; + private ConcurrentMap loggerMap; + + public JettyLoggerFactory(JettyLoggerConfiguration config) + { + configuration = Objects.requireNonNull(config, "JettyLoggerConfiguration"); + + loggerMap = new ConcurrentHashMap<>(); + + StdErrAppender appender = new StdErrAppender(configuration); + + rootLogger = new JettyLogger(this, ROOT_LOGGER_NAME, appender); + loggerMap.put(ROOT_LOGGER_NAME, rootLogger); + rootLogger.setLevel(configuration.getLevel(ROOT_LOGGER_NAME)); + } + + /** + * Get a {@link JettyLogger} instance, creating if not yet existing. + * + * @param name the name of the logger + * @return the JettyLogger instance + */ + public JettyLogger getJettyLogger(String name) + { + if (name.equals(ROOT_LOGGER_NAME)) + { + return getRootLogger(); + } + + return loggerMap.computeIfAbsent(name, this::createLogger); + } + + /** + * Main interface for {@link ILoggerFactory} + * + * @param name the name of the logger + * @return the Slf4j Logger + */ + @Override + public Logger getLogger(String name) + { + return getJettyLogger(name); + } + + protected void walkChildLoggers(String parentName, Consumer childConsumer) + { + String prefix = parentName; + if (parentName.length() > 0 && !prefix.endsWith(".")) + { + prefix += "."; + } + + for (JettyLogger logger : loggerMap.values()) + { + if (logger.getName().equals(parentName)) + { + // skip self + continue; + } + + // is child, and is not itself + if (logger.getName().startsWith(prefix)) + { + childConsumer.accept(logger); + } + } + } + + public JettyLogger getRootLogger() + { + return rootLogger; + } + + private JettyLogger createLogger(String name) + { + // or is that handled by slf4j itself? + JettyAppender appender = rootLogger.getAppender(); + int level = this.configuration.getLevel(name); + boolean hideStacks = this.configuration.getHideStacks(name); + return new JettyLogger(this, name, appender, level, hideStacks); + } + + /** + * Condenses a classname by stripping down the package name to just the first character of each package name + * segment.Configured + * + *
+     * Examples:
+     * "org.eclipse.jetty.test.FooTest"           = "oejt.FooTest"
+     * "org.eclipse.jetty.server.logging.LogTest" = "orjsl.LogTest"
+     * 
+ * + * @param classname the fully qualified class name + * @return the condensed name + */ + protected static String condensePackageString(String classname) + { + if (classname == null || classname.isEmpty()) + { + return ""; + } + + int rawLen = classname.length(); + StringBuilder dense = new StringBuilder(rawLen); + boolean foundStart = false; + boolean hasPackage = false; + int startIdx = -1; + int endIdx = -1; + for (int i = 0; i < rawLen; i++) + { + char c = classname.charAt(i); + if (!foundStart) + { + foundStart = Character.isJavaIdentifierStart(c); + if (foundStart) + { + if (startIdx >= 0) + { + dense.append(classname.charAt(startIdx)); + hasPackage = true; + } + startIdx = i; + } + } + + if (foundStart) + { + if (!Character.isJavaIdentifierPart(c)) + { + foundStart = false; + } + else + { + endIdx = i; + } + } + } + // append remaining from startIdx + if ((startIdx >= 0) && (endIdx >= startIdx)) + { + if (hasPackage) + { + dense.append('.'); + } + dense.append(classname, startIdx, endIdx + 1); + } + + return dense.toString(); + } +} diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingServiceProvider.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingServiceProvider.java new file mode 100644 index 00000000000..01ad473162a --- /dev/null +++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingServiceProvider.java @@ -0,0 +1,78 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under +// the terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0 +// +// This Source Code may also be made available under the following +// Secondary Licenses when the conditions for such availability set +// forth in the Eclipse Public License, v. 2.0 are satisfied: +// the Apache License v2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.logging; + +import org.slf4j.ILoggerFactory; +import org.slf4j.IMarkerFactory; +import org.slf4j.helpers.BasicMarkerFactory; +import org.slf4j.helpers.NOPMDCAdapter; +import org.slf4j.spi.MDCAdapter; +import org.slf4j.spi.SLF4JServiceProvider; + +public class JettyLoggingServiceProvider implements SLF4JServiceProvider +{ + /** + * Declare the version of the SLF4J API this implementation is compiled against. + * The value of this field is modified with each major release. + */ + // to avoid constant folding by the compiler, this field must *not* be final + public static String REQUESTED_API_VERSION = "1.8.99"; // !final + + private JettyLoggerFactory loggerFactory; + private BasicMarkerFactory markerFactory; + private MDCAdapter mdcAdapter; + + @Override + public void initialize() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration().load(this.getClass().getClassLoader()); + loggerFactory = new JettyLoggerFactory(config); + markerFactory = new BasicMarkerFactory(); + mdcAdapter = new NOPMDCAdapter(); // TODO: Provide Jetty Implementation? + } + + public JettyLoggerFactory getJettyLoggerFactory() + { + return loggerFactory; + } + + @Override + public ILoggerFactory getLoggerFactory() + { + return getJettyLoggerFactory(); + } + + @Override + public IMarkerFactory getMarkerFactory() + { + return markerFactory; + } + + @Override + public MDCAdapter getMDCAdapter() + { + return mdcAdapter; + } + + @Override + public String getRequesteApiVersion() + { + return REQUESTED_API_VERSION; + } +} diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/StacklessLogging.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/StacklessLogging.java new file mode 100644 index 00000000000..93e05101ab1 --- /dev/null +++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/StacklessLogging.java @@ -0,0 +1,123 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under +// the terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0 +// +// This Source Code may also be made available under the following +// Secondary Licenses when the conditions for such availability set +// forth in the Eclipse Public License, v. 2.0 are satisfied: +// the Apache License v2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.logging; + +import java.util.HashSet; +import java.util.Set; + +import org.slf4j.ILoggerFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A try-with-resources compatible layer for {@link JettyLogger#setHideStacks(boolean) hiding stacktraces} within the scope of the try block when + * logging with {@link JettyLogger} implementation. + *

+ * Use of other logging implementation cause no effect when using this class + *

+ * Example: + * + *

+ * try (StacklessLogging scope = new StacklessLogging(EventDriver.class,Noisy.class))
+ * {
+ *     doActionThatCausesStackTraces();
+ * }
+ * 
+ */ +public class StacklessLogging implements AutoCloseable +{ + private static final Logger LOG = LoggerFactory.getLogger(StacklessLogging.class); + private static final JettyLoggerFactory loggerFactory; + + static + { + JettyLoggerFactory jettyLoggerFactory = null; + ILoggerFactory activeLoggerFactory = LoggerFactory.getILoggerFactory(); + if (activeLoggerFactory instanceof JettyLoggerFactory) + { + jettyLoggerFactory = (JettyLoggerFactory)activeLoggerFactory; + } + else + { + LOG.warn("Unable to squelch stacktraces ({} is not a {})", + activeLoggerFactory.getClass().getName(), + JettyLoggerFactory.class.getName()); + } + loggerFactory = jettyLoggerFactory; + } + + private final Set squelched = new HashSet<>(); + + public StacklessLogging(Class... classesToSquelch) + { + for (Class clazz : classesToSquelch) + { + JettyLogger jettyLogger = loggerFactory.getJettyLogger(clazz.getName()); + if (!jettyLogger.isDebugEnabled()) + { + if (!jettyLogger.isHideStacks()) + { + jettyLogger.setHideStacks(true); + squelched.add(jettyLogger); + } + } + } + } + + public StacklessLogging(Package... packagesToSquelch) + { + for (Package pkg : packagesToSquelch) + { + JettyLogger jettyLogger = loggerFactory.getJettyLogger(pkg.getName()); + if (!jettyLogger.isDebugEnabled()) + { + if (!jettyLogger.isHideStacks()) + { + jettyLogger.setHideStacks(true); + squelched.add(jettyLogger); + } + } + } + } + + public StacklessLogging(Logger... logs) + { + for (Logger log : logs) + { + if (log instanceof JettyLogger && !log.isDebugEnabled()) + { + JettyLogger jettyLogger = ((JettyLogger)log); + if (!jettyLogger.isHideStacks()) + { + jettyLogger.setHideStacks(true); + squelched.add(jettyLogger); + } + } + } + } + + @Override + public void close() + { + for (JettyLogger log : squelched) + { + log.setHideStacks(false); + } + } +} diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/StdErrAppender.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/StdErrAppender.java new file mode 100644 index 00000000000..001a3055461 --- /dev/null +++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/StdErrAppender.java @@ -0,0 +1,255 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under +// the terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0 +// +// This Source Code may also be made available under the following +// Secondary Licenses when the conditions for such availability set +// forth in the Eclipse Public License, v. 2.0 are satisfied: +// the Apache License v2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.logging; + +import java.io.PrintStream; +import java.util.Objects; +import java.util.TimeZone; + +import org.slf4j.event.Level; +import org.slf4j.helpers.FormattingTuple; +import org.slf4j.helpers.MessageFormatter; + +public class StdErrAppender implements JettyAppender +{ + /** + * Configuration keys specific to the StdErrAppender + */ + static final String NAME_CONDENSE_KEY = "org.eclipse.jetty.logging.appender.NAME_CONDENSE"; + static final String THREAD_PADDING_KEY = "org.eclipse.jetty.logging.appender.THREAD_PADDING"; + static final String MESSAGE_ESCAPE_KEY = "org.eclipse.jetty.logging.appender.MESSAGE_ESCAPE"; + static final String ZONEID_KEY = "org.eclipse.jetty.logging.appender.ZONE_ID"; + private static final String EOL = System.lineSeparator(); + + private final Timestamp timestamper; + + /** + * True to have output show condensed logger names, false to use the as defined long names. + */ + private final boolean condensedNames; + + /** + * True to have messages escaped for control characters, false to leave messages alone. + */ + private final boolean escapedMessages; + + /** + * The fixed size of the thread name to use for output + */ + private final int threadPadding; + + /** + * The stream to write logging events to. + */ + private PrintStream stderr; + + public StdErrAppender(JettyLoggerConfiguration config) + { + this(config, System.err); + } + + public StdErrAppender(JettyLoggerConfiguration config, PrintStream stream) + { + this(config, stream, null); + } + + public StdErrAppender(JettyLoggerConfiguration config, PrintStream stream, TimeZone timeZone) + { + Objects.requireNonNull(config, "JettyLoggerConfiguration"); + this.stderr = Objects.requireNonNull(stream, "PrintStream"); + + TimeZone tzone = timeZone; + if (tzone == null) + { + tzone = config.getTimeZone(ZONEID_KEY); + if (tzone == null) + { + tzone = TimeZone.getDefault(); + } + } + + this.timestamper = new Timestamp(tzone); + + this.condensedNames = config.getBoolean(NAME_CONDENSE_KEY, true); + this.escapedMessages = config.getBoolean(MESSAGE_ESCAPE_KEY, true); + this.threadPadding = config.getInt(THREAD_PADDING_KEY, -1); + } + + @Override + public void emit(JettyLogger logger, Level level, long timestamp, String threadName, Throwable throwable, String message, Object... argumentArray) + { + StringBuilder builder = new StringBuilder(64); + format(builder, logger, level, timestamp, threadName, throwable, message, argumentArray); + stderr.println(builder); + } + + public boolean isCondensedNames() + { + return condensedNames; + } + + public boolean isEscapedMessages() + { + return escapedMessages; + } + + public int getThreadPadding() + { + return threadPadding; + } + + public PrintStream getStream() + { + return stderr; + } + + public void setStream(PrintStream stream) + { + this.stderr = stream; + } + + private void format(StringBuilder builder, JettyLogger logger, Level level, long timestamp, String threadName, Throwable throwable, String message, Object... argumentArray) + { + Throwable cause = throwable; + + // Timestamp + timestamper.formatNow(timestamp, builder); + + // Level + builder.append(':').append(renderedLevel(level)); + + // Logger Name + builder.append(':'); + if (condensedNames) + { + builder.append(logger.getCondensedName()); + } + else + { + builder.append(logger.getName()); + } + + // Thread Name + builder.append(':'); + builder.append(threadName); // TODO: support TAG_PAD configuration + builder.append(':'); + + // Message + builder.append(' '); + + FormattingTuple ft = MessageFormatter.arrayFormat(message, argumentArray); + appendEscaped(builder, ft.getMessage()); + if (cause == null) + { + cause = ft.getThrowable(); + } + + // Throwable + if (cause != null) + { + if (logger.isHideStacks()) + { + builder.append(": ").append(cause); + } + else + { + appendCause(builder, cause, ""); + } + } + } + + private String renderedLevel(Level level) + { + switch (level) + { + case ERROR: // New for Jetty 10+ + return "ERROR"; + case WARN: + return "WARN "; + case INFO: + return "INFO "; + case DEBUG: + return "DEBUG"; + case TRACE: // New for Jetty 10+ + return "TRACE"; + default: + return "UNKNOWN"; + } + } + + private void appendCause(StringBuilder builder, Throwable cause, String indent) + { + builder.append(EOL).append(indent); + appendEscaped(builder, cause.toString()); + StackTraceElement[] elements = cause.getStackTrace(); + for (int i = 0; elements != null && i < elements.length; i++) + { + builder.append(EOL).append(indent).append("\tat "); + appendEscaped(builder, elements[i].toString()); + } + + for (Throwable suppressed : cause.getSuppressed()) + { + builder.append(EOL).append(indent).append("Suppressed: "); + appendCause(builder, suppressed, "\t|" + indent); + } + + Throwable by = cause.getCause(); + if (by != null && by != cause) + { + builder.append(EOL).append(indent).append("Caused by: "); + appendCause(builder, by, indent); + } + } + + private void appendEscaped(StringBuilder builder, String str) + { + if (str == null) + return; + + if (escapedMessages) + { + for (int i = 0; i < str.length(); ++i) + { + char c = str.charAt(i); + if (Character.isISOControl(c)) + { + if (c == '\n') + { + builder.append('|'); + } + else if (c == '\r') + { + builder.append('<'); + } + else + { + builder.append('?'); + } + } + else + { + builder.append(c); + } + } + } + else + builder.append(str); + } +} diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/Timestamp.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/Timestamp.java new file mode 100644 index 00000000000..064565d7c57 --- /dev/null +++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/Timestamp.java @@ -0,0 +1,118 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under +// the terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0 +// +// This Source Code may also be made available under the following +// Secondary Licenses when the conditions for such availability set +// forth in the Eclipse Public License, v. 2.0 are satisfied: +// the Apache License v2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.logging; + +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.TimeZone; + +/** + *

+ * This is a super stripped down version of {@code DateCache} from jetty-util. + *

+ * + *

+ * This is a private class, only 1 method is exposed. {@link #formatNow(long, StringBuilder)}, + * Caching of the formatted timestamp up to the current second is still performed. + * Format updates the StringBuilder directly. + * And millisecond formatting is done by this class. + *

+ */ +class Timestamp +{ + private final DateTimeFormatter tzFormatter; + private final ZoneId zoneId; + private volatile Tick tick; + + public static class Tick + { + private final long seconds; + private final String formattedString; + + public Tick(long seconds, String string) + { + this.seconds = seconds; + formattedString = string; + } + } + + public Timestamp(TimeZone timeZone) + { + tzFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + zoneId = timeZone.toZoneId(); + tzFormatter.withZone(zoneId); + tick = null; + } + + /** + * Format a timestamp according to our stored formatter. + * The passed time is expected to be close to the current time, so it is + * compared to the last value passed and if it is within the same second, + * the format is reused. Otherwise a new cached format is created. + * + * @param now the milliseconds since unix epoch + */ + public void formatNow(long now, StringBuilder builder) + { + long seconds = now / 1000; + int ms = (int)(now % 1000); + + Tick tick = this.tick; + + // Is this the cached time + if (tick != null && tick.seconds == seconds) + { + builder.append(tick.formattedString); + } + else + { + formatTick(now, builder); + } + + if (ms > 99) + { + builder.append('.'); + } + else if (ms > 9) + { + builder.append(".0"); + } + else + { + builder.append(".00"); + } + builder.append(ms); + } + + protected void formatTick(long now, StringBuilder builder) + { + long seconds = now / 1000; + + Tick tick = this.tick; + // recheck the tick, to save multiple formats + if (tick == null || tick.seconds != seconds) + { + String s = ZonedDateTime.ofInstant(Instant.ofEpochMilli(now), zoneId).format(tzFormatter); + builder.append(s); + this.tick = new Tick(seconds, s); + } + } +} diff --git a/jetty-slf4j-impl/src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider b/jetty-slf4j-impl/src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider new file mode 100644 index 00000000000..f5ceffeaa2b --- /dev/null +++ b/jetty-slf4j-impl/src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider @@ -0,0 +1 @@ +org.eclipse.jetty.logging.JettyLoggingServiceProvider diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrCapture.java b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/CapturedStream.java similarity index 74% rename from jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrCapture.java rename to jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/CapturedStream.java index f2404feb299..09b5814b1eb 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrCapture.java +++ b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/CapturedStream.java @@ -16,47 +16,34 @@ // ======================================================================== // -package org.eclipse.jetty.util.log; +package org.eclipse.jetty.logging; import java.io.ByteArrayOutputStream; import java.io.PrintStream; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.not; -public class StdErrCapture +public class CapturedStream extends PrintStream { - private ByteArrayOutputStream test; - private PrintStream err; + private final ByteArrayOutputStream test; - public StdErrCapture(StdErrLog log) + public CapturedStream() { - this(); - log.setStdErrStream(err); - } - - public StdErrCapture() - { - test = new ByteArrayOutputStream(); - err = new PrintStream(test); - } - - public void capture(StdErrLog log) - { - log.setStdErrStream(err); + super(new ByteArrayOutputStream(), true, UTF_8); + test = (ByteArrayOutputStream)super.out; } public void assertContains(String expectedString) { - err.flush(); String output = new String(test.toByteArray()); assertThat(output, containsString(expectedString)); } public void assertNotContains(String unexpectedString) { - err.flush(); String output = new String(test.toByteArray()); assertThat(output, not(containsString(unexpectedString))); } @@ -64,7 +51,6 @@ public class StdErrCapture @Override public String toString() { - err.flush(); return new String(test.toByteArray()); } } diff --git a/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JettyLoggerConfigurationTest.java b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JettyLoggerConfigurationTest.java new file mode 100644 index 00000000000..bc3982c0c64 --- /dev/null +++ b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JettyLoggerConfigurationTest.java @@ -0,0 +1,264 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under +// the terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0 +// +// This Source Code may also be made available under the following +// Secondary Licenses when the conditions for such availability set +// forth in the Eclipse Public License, v. 2.0 are satisfied: +// the Apache License v2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.logging; + +import java.util.Properties; + +import org.junit.jupiter.api.Test; +import org.slf4j.event.Level; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class JettyLoggerConfigurationTest +{ + @Test + public void testConfig() + { + Properties props = new Properties(); + props.setProperty(StdErrAppender.MESSAGE_ESCAPE_KEY, "false"); + props.setProperty(StdErrAppender.NAME_CONDENSE_KEY, "false"); + props.setProperty(StdErrAppender.THREAD_PADDING_KEY, "10"); + props.setProperty("com.mortbay.LEVEL", "WARN"); + props.setProperty("com.mortbay.STACKS", "false"); + + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + StdErrAppender appender = new StdErrAppender(config); + + assertFalse(appender.isEscapedMessages()); + assertFalse(appender.isCondensedNames()); + assertEquals(appender.getThreadPadding(), 10); + + int level = config.getLevel("com.mortbay"); + assertEquals(Level.WARN.toInt(), level); + + boolean stacks = config.getHideStacks("com.mortbay.Foo"); + assertFalse(stacks); + } + + @Test + public void testGetLevelExact() + { + Properties props = new Properties(); + props.setProperty("com.mortbay.LEVEL", "WARN"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + int level = config.getLevel("com.mortbay"); + assertEquals(Level.WARN.toInt(), level); + } + + @Test + public void testGetLevelDotEnd() + { + Properties props = new Properties(); + props.setProperty("com.mortbay.LEVEL", "WARN"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + // extra trailing dot "." + int level = config.getLevel("com.mortbay."); + assertEquals(Level.WARN.toInt(), level); + } + + @Test + public void testGetLevelWithLevel() + { + Properties props = new Properties(); + props.setProperty("com.mortbay.LEVEL", "WARN"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + // asking for name with ".LEVEL" + int level = config.getLevel("com.mortbay.Bar.LEVEL"); + assertEquals(Level.WARN.toInt(), level); + } + + @Test + public void testGetLevelChild() + { + Properties props = new Properties(); + props.setProperty("com.mortbay.LEVEL", "WARN"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + int level = config.getLevel("com.mortbay.Foo"); + assertEquals(Level.WARN.toInt(), level); + } + + @Test + public void testGetLevelDefault() + { + Properties props = new Properties(); + props.setProperty("com.mortbay.LEVEL", "WARN"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + // asking for name that isn't configured, returns default value + int level = config.getLevel("org.eclipse.jetty"); + assertEquals(Level.INFO.toInt(), level); + } + + @Test + public void testGetHideStacksExact() + { + Properties props = new Properties(); + props.setProperty("com.mortbay.STACKS", "true"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + boolean val = config.getHideStacks("com.mortbay"); + assertTrue(val); + } + + @Test + public void testGetHideStacksDotEnd() + { + Properties props = new Properties(); + props.setProperty("com.mortbay.STACKS", "true"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + // extra trailing dot "." + boolean val = config.getHideStacks("com.mortbay."); + assertTrue(val); + } + + @Test + public void testGetHideStacksWithStacks() + { + Properties props = new Properties(); + props.setProperty("com.mortbay.STACKS", "true"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + // asking for name with ".STACKS" + boolean val = config.getHideStacks("com.mortbay.Bar.STACKS"); + assertTrue(val); + } + + @Test + public void testGetHideStacksChild() + { + Properties props = new Properties(); + props.setProperty("com.mortbay.STACKS", "true"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + boolean val = config.getHideStacks("com.mortbay.Foo"); + assertTrue(val); + } + + @Test + public void testGetHideStacksDefault() + { + Properties props = new Properties(); + props.setProperty("com.mortbay.STACKS", "true"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + // asking for name that isn't configured, returns default value + boolean val = config.getHideStacks("org.eclipse.jetty"); + assertFalse(val); + } + + @Test + public void testGetLoggingLevelBad() + { + Properties props = new Properties(); + props.setProperty("log.LEVEL", "WARN"); + props.setProperty("org.eclipse.jetty.bad.LEVEL", "EXPECTED_BAD_LEVEL"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + + // Default Level (because of bad level value) + assertEquals(Level.WARN.toInt(), config.getLevel("org.eclipse.jetty.bad")); + } + + @Test + public void testGetLoggingLevelLowercase() + { + Properties props = new Properties(); + props.setProperty("log.LEVEL", "warn"); + props.setProperty("org.eclipse.jetty.util.LEVEL", "info"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + + // Default Level + assertEquals(Level.WARN.toInt(), config.getLevel("org.eclipse.jetty")); + // Specific Level + assertEquals(Level.INFO.toInt(), config.getLevel("org.eclipse.jetty.util")); + } + + @Test + public void testGetLoggingLevelRoot() + { + Properties props = new Properties(); + props.setProperty("log.LEVEL", "DEBUG"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + + // Default Levels + assertEquals(Level.DEBUG.toInt(), config.getLevel(null)); + assertEquals(Level.DEBUG.toInt(), config.getLevel("")); + assertEquals(Level.DEBUG.toInt(), config.getLevel("org.eclipse.jetty")); + String name = JettyLoggerConfigurationTest.class.getName(); + assertEquals(Level.DEBUG.toInt(), config.getLevel(name), "Default Logging Level - " + name + " name"); + } + + @Test + public void testGetLoggingLevelFQCN() + { + String name = JettyLoggerTest.class.getName(); + Properties props = new Properties(); + props.setProperty(name + ".LEVEL", "ALL"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + + // Default Levels + assertEquals(Level.INFO.toInt(), config.getLevel(null)); + assertEquals(Level.INFO.toInt(), config.getLevel("")); + assertEquals(Level.INFO.toInt(), config.getLevel("org.eclipse.jetty")); + + // Specified Level + assertEquals(JettyLogger.ALL, config.getLevel(name)); + } + + @Test + public void testGetLoggingLevelUtilLevel() + { + Properties props = new Properties(); + props.setProperty("org.eclipse.jetty.util.LEVEL", "DEBUG"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + + // Default Levels + assertEquals(Level.INFO.toInt(), config.getLevel(null)); + assertEquals(Level.INFO.toInt(), config.getLevel("")); + assertEquals(Level.INFO.toInt(), config.getLevel("org.eclipse.jetty")); + assertEquals(Level.INFO.toInt(), config.getLevel("org.eclipse.jetty.server.BogusObject")); + assertEquals(Level.INFO.toInt(), config.getLevel(JettyLoggerConfigurationTest.class.getName())); + + // Configured Level + assertEquals(Level.DEBUG.toInt(), config.getLevel("org.eclipse.jetty.util.Bogus")); + assertEquals(Level.DEBUG.toInt(), config.getLevel("org.eclipse.jetty.util")); + assertEquals(Level.DEBUG.toInt(), config.getLevel("org.eclipse.jetty.util.resource.PathResource")); + } + + @Test + public void testGetLoggingLevelMixedLevels() + { + Properties props = new Properties(); + props.setProperty("log.LEVEL", "DEBUG"); + props.setProperty("org.eclipse.jetty.util.LEVEL", "WARN"); + props.setProperty("org.eclipse.jetty.util.ConcurrentHashMap.LEVEL", "ALL"); + + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + + // Default Levels + assertEquals(Level.DEBUG.toInt(), config.getLevel(null)); + assertEquals(Level.DEBUG.toInt(), config.getLevel("")); + assertEquals(Level.DEBUG.toInt(), config.getLevel("org.eclipse.jetty")); + assertEquals(Level.DEBUG.toInt(), config.getLevel("org.eclipse.jetty.server.BogusObject")); + assertEquals(Level.DEBUG.toInt(), config.getLevel(JettyLoggerConfigurationTest.class.getName())); + + // Configured Level + assertEquals(Level.WARN.toInt(), config.getLevel("org.eclipse.jetty.util.MagicUtil")); + assertEquals(Level.WARN.toInt(), config.getLevel("org.eclipse.jetty.util")); + assertEquals(Level.WARN.toInt(), config.getLevel("org.eclipse.jetty.util.resource.PathResource")); + + assertEquals(JettyLogger.ALL, config.getLevel("org.eclipse.jetty.util.ConcurrentHashMap")); + } +} diff --git a/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JettyLoggerTest.java b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JettyLoggerTest.java new file mode 100644 index 00000000000..86b6fd6db8d --- /dev/null +++ b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JettyLoggerTest.java @@ -0,0 +1,614 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under +// the terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0 +// +// This Source Code may also be made available under the following +// Secondary Licenses when the conditions for such availability set +// forth in the Eclipse Public License, v. 2.0 are satisfied: +// the Apache License v2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.logging; + +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.Properties; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.event.Level; + +import static java.time.ZoneOffset.UTC; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +/** + * Tests for JettyLogger and StdErrAppender + */ +public class JettyLoggerTest +{ + @BeforeEach + public void before() + { + Thread.currentThread().setName("tname"); + } + + @SuppressWarnings("PlaceholderCountMatchesArgumentCount") + @Test + public void testStdErrLogFormatSlf4jStrict() + { + Properties props = new Properties(); + props.setProperty(StdErrAppender.ZONEID_KEY, UTC.getId()); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + Logger log = factory.getJettyLogger(JettyLoggerTest.class.getName()); + + log.info("testing:{},{}", "test", "format1"); + log.info("testing:{}", "test", "format2"); + log.info("testing", "test", "format3"); + log.info("testing:{},{}", "test", null); + log.info("testing {} {}", null, null); + log.info("testing:{}", null, null); + log.info("testing", null, null); + String msg = null; + log.info(msg, "test2", "format4"); + + System.err.println(output); + output.assertContains("INFO :oejl.JettyLoggerTest:tname: testing:test,format1"); + output.assertContains("INFO :oejl.JettyLoggerTest:tname: testing:test"); + output.assertContains("INFO :oejl.JettyLoggerTest:tname: testing"); + output.assertContains("INFO :oejl.JettyLoggerTest:tname: testing:test,null"); + output.assertContains("INFO :oejl.JettyLoggerTest:tname: testing null null"); + output.assertContains("INFO :oejl.JettyLoggerTest:tname: testing:null"); + output.assertContains("INFO :oejl.JettyLoggerTest:tname: testing"); + output.assertContains("INFO :oejl.JettyLoggerTest:tname: "); + } + + @Test + public void testStdErrLogDebug() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger log = factory.getJettyLogger("xxx"); + + log.setLevel(Level.DEBUG); + log.debug("testing {} {}", "test", "debug"); + log.info("testing {} {}", "test", "info"); + log.warn("testing {} {}", "test", "warn"); + log.setLevel(Level.INFO); + log.debug("YOU SHOULD NOT SEE THIS!"); + + output.assertContains("DEBUG:xxx:tname: testing test debug"); + output.assertContains("INFO :xxx:tname: testing test info"); + output.assertContains("WARN :xxx:tname: testing test warn"); + output.assertNotContains("YOU SHOULD NOT SEE THIS!"); + } + + @Test + public void testStdErrLogName() + { + Properties props = new Properties(); + props.setProperty(StdErrAppender.NAME_CONDENSE_KEY, "false"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger log = factory.getJettyLogger("test"); + + assertThat("Log.name", log.getName(), is("test")); + Logger next = factory.getLogger(log.getName() + ".next"); + assertThat("Log.name(child)", next.getName(), is("test.next")); + next.info("testing {} {}", "next", "info"); + + output.assertContains(":test.next:tname: testing next info"); + } + + @Test + public void testStdErrThrowable() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + // Common Throwable (for test) + Throwable th = new Throwable("Message"); + + // Capture raw string form + StringWriter tout = new StringWriter(); + th.printStackTrace(new PrintWriter(tout)); + String ths = tout.toString(); + + // Start test + JettyLogger log = factory.getJettyLogger("test"); + log.warn("ex", th); + output.assertContains(ths); + + th = new Throwable("Message with \033 escape"); + + log.warn("ex", th); + output.assertNotContains("Message with \033 escape"); + log.info(th.toString()); + output.assertNotContains("Message with \033 escape"); + + log.warn("ex", th); + output.assertContains("Message with ? escape"); + log.info(th.toString()); + output.assertContains("Message with ? escape"); + } + + /** + * Test to make sure that using a Null parameter on parameterized messages does not result in a NPE + */ + @SuppressWarnings({"PlaceholderCountMatchesArgumentCount", "ConstantConditions"}) + @Test + public void testParameterizedMessageNullValues() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger log = factory.getJettyLogger(JettyLoggerTest.class.getName()); + log.setLevel(Level.DEBUG); + + String nullMsg = null; + try (StacklessLogging ignored = new StacklessLogging(log)) + { + log.info("Testing info(msg,null,null) - {} {}", "arg0", "arg1"); + log.info("Testing info(msg,null,null) - {} {}", null, null); + log.info("Testing info(msg,null,null) - {}", null, null); + log.info("Testing info(msg,null,null)", null, null); + log.info(nullMsg, "Testing", "info(null,arg0,arg1)"); + log.info(nullMsg, null, null); + + log.debug("Testing debug(msg,null,null) - {} {}", "arg0", "arg1"); + log.debug("Testing debug(msg,null,null) - {} {}", null, null); + log.debug("Testing debug(msg,null,null) - {}", null, null); + log.debug("Testing debug(msg,null,null)", null, null); + log.debug(nullMsg, "Testing", "debug(null,arg0,arg1)"); + log.debug(nullMsg, null, null); + + log.debug("Testing debug(msg,null)"); + log.debug(null, new Throwable("Testing debug(null,thrw)").fillInStackTrace()); + + log.warn("Testing warn(msg,null,null) - {} {}", "arg0", "arg1"); + log.warn("Testing warn(msg,null,null) - {} {}", null, null); + log.warn("Testing warn(msg,null,null) - {}", null, null); + log.warn("Testing warn(msg,null,null)", null, null); + log.warn(nullMsg, "Testing", "warn(msg,arg0,arg1)"); + log.warn(nullMsg, null, null); + + log.warn("Testing warn(msg,null)"); + log.warn(nullMsg, new Throwable("Testing warn(msg,thrw)").fillInStackTrace()); + } + } + + /** + * Tests JettyLogger.warn() methods with level filtering. + *

+ * Should see WARN level messages, if level is set to WARN or below + */ + @Test + public void testWarnFiltering() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger log = factory.getJettyLogger(JettyLoggerTest.class.getName()); + + try (StacklessLogging ignored = new StacklessLogging(log)) + { + // Start with default level + log.warn("See Me"); + + // Set to debug level + log.setLevel(Level.DEBUG); + log.warn("Hear Me"); + + // Set to warn level + log.setLevel(Level.WARN); + log.warn("Cheer Me"); + + log.warn("", new Throwable("out of focus")); + log.warn("shot issue", new Throwable("scene lost")); + + // Validate Output + // System.err.print(output); + output.assertContains("See Me"); + output.assertContains("Hear Me"); + output.assertContains("Cheer Me"); + + // Validate Stack Traces + output.assertContains(".JettyLoggerTest:tname: "); + output.assertContains("java.lang.Throwable: out of focus"); + output.assertContains("java.lang.Throwable: scene lost"); + } + } + + /** + * Tests JettyLogger.info() methods with level filtering. + *

+ * Should only see INFO level messages when level is set to {@link Level#INFO} and below. + */ + @Test + public void testInfoFiltering() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger log = factory.getJettyLogger(JettyLoggerTest.class.getName()); + try (StacklessLogging ignored = new StacklessLogging(log)) + { + // Normal/Default behavior + log.info("I will not buy"); + + // Level Debug + log.setLevel(Level.DEBUG); + log.info("this record"); + + // Level All + log.setLevel(Level.TRACE); + log.info("it is scratched."); + + log.info("", new Throwable("out of focus")); + log.info("shot issue", new Throwable("scene lost")); + + // Level Warn + log.setLevel(Level.WARN); + log.info("sorry?"); + log.info("", new Throwable("on editing room floor")); + + // Validate Output + output.assertContains("I will not buy"); + output.assertContains("this record"); + output.assertContains("it is scratched."); + output.assertNotContains("sorry?"); + + // Validate Stack Traces + output.assertNotContains(""); + output.assertNotContains("on editing room floor"); + + output.assertContains(".JettyLoggerTest:tname: "); + output.assertContains("java.lang.Throwable: out of focus"); + output.assertContains("java.lang.Throwable: scene lost"); + } + } + + /** + * Tests {@link Level#ERROR} filtering. + */ + @Test + public void testErrorFiltering() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger log = factory.getJettyLogger(JettyLoggerTest.class.getName()); + try (StacklessLogging ignored = new StacklessLogging(log)) + { + log.setLevel(Level.ERROR); + + // Various logging events + log.debug("Squelch"); + log.debug("Squelch", new RuntimeException("Squelch")); + log.info("Squelch"); + log.info("Squelch", new IllegalStateException("Squelch")); + log.warn("Squelch"); + log.warn("Squelch", new Exception("Squelch")); + log.trace("IGNORED", new Throwable("Squelch")); + + // Validate Output + output.assertNotContains("Squelch"); + } + } + + /** + * Tests level OFF filtering. + */ + @Test + public void testOffFiltering() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger log = factory.getJettyLogger(JettyLoggerTest.class.getName()); + + try (StacklessLogging ignored = new StacklessLogging(log)) + { + log.setLevel(JettyLogger.OFF); + + // Various logging events + log.debug("Squelch"); + log.debug("Squelch", new RuntimeException("Squelch")); + log.info("Squelch"); + log.info("Squelch", new IllegalStateException("Squelch")); + log.warn("Squelch"); + log.warn("Squelch", new Exception("Squelch")); + log.trace("IGNORED", new Throwable("Squelch")); + + // Validate Output + output.assertNotContains("Squelch"); + } + } + + /** + * Tests StdErrLog.debug() methods with level filtering. + *

+ * Should only see DEBUG level messages when level is set to {@link Level#DEBUG} and below. + */ + @Test + public void testDebugFiltering() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger log = factory.getJettyLogger(JettyLoggerTest.class.getName()); + + try (StacklessLogging ignored = new StacklessLogging(log)) + { + // Normal/Default behavior + log.debug("Tobacconist"); + log.debug("", new Throwable("on editing room floor")); + + // Level Debug + log.setLevel(Level.DEBUG); + log.debug("my hovercraft is"); + + log.debug("", new Throwable("out of focus")); + log.debug("shot issue", new Throwable("scene lost")); + + // Level All + log.setLevel(Level.TRACE); + log.debug("full of eels."); + + // Level Warn + log.setLevel(Level.WARN); + log.debug("what?"); + + // Validate Output + // System.err.print(output); + output.assertNotContains("Tobacconist"); + output.assertContains("my hovercraft is"); + output.assertContains("full of eels."); + output.assertNotContains("what?"); + + // Validate Stack Traces + output.assertNotContains(""); + output.assertNotContains("on editing room floor"); + + output.assertContains(".JettyLoggerTest:tname: "); + output.assertContains("java.lang.Throwable: out of focus"); + output.assertContains("java.lang.Throwable: scene lost"); + } + } + + @Test + public void testIsDebugEnabled() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger log = factory.getJettyLogger(JettyLoggerTest.class.getName()); + + try (StacklessLogging ignored = new StacklessLogging(log)) + { + log.setLevel(Level.TRACE); + assertThat("log.level(trace).isDebugEnabled", log.isDebugEnabled(), is(true)); + + log.setLevel(Level.DEBUG); + assertThat("log.level(debug).isDebugEnabled", log.isDebugEnabled(), is(true)); + + log.setLevel(Level.INFO); + assertThat("log.level(info).isDebugEnabled", log.isDebugEnabled(), is(false)); + + log.setLevel(Level.WARN); + assertThat("log.level(warn).isDebugEnabled", log.isDebugEnabled(), is(false)); + + log.setLevel(Level.ERROR); + assertThat("log.level(error).isDebugEnabled", log.isDebugEnabled(), is(false)); + + log.setLevel(JettyLogger.OFF); + assertThat("log.level(null).isDebugEnabled", log.isDebugEnabled(), is(false)); + } + } + + @Test + public void testSetGetLevel() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger log = factory.getJettyLogger(JettyLoggerTest.class.getName()); + + try (StacklessLogging ignored = new StacklessLogging(log)) + { + log.setLevel(Level.TRACE); + assertThat("log.level(trace).getLevel()", log.getLevel(), is(Level.TRACE.toInt())); + + log.setLevel(Level.DEBUG); + assertThat("log.level(debug).getLevel()", log.getLevel(), is(Level.DEBUG.toInt())); + + log.setLevel(Level.INFO); + assertThat("log.level(info).getLevel()", log.getLevel(), is(Level.INFO.toInt())); + + log.setLevel(Level.WARN); + assertThat("log.level(warn).getLevel()", log.getLevel(), is(Level.WARN.toInt())); + + log.setLevel(Level.ERROR); + assertThat("log.level(error).getLevel()", log.getLevel(), is(Level.ERROR.toInt())); + + log.setLevel(888); + assertThat("log.level(888).getLevel()", log.getLevel(), is(888)); + } + } + + @Test + public void testToString() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger log = factory.getJettyLogger("xxx"); + + log.setLevel(Level.TRACE); + assertThat("Logger.toString", log.toString(), is("JettyLogger:xxx:LEVEL=TRACE")); + + log.setLevel(Level.DEBUG); + assertThat("Logger.toString", log.toString(), is("JettyLogger:xxx:LEVEL=DEBUG")); + + log.setLevel(Level.INFO); + assertThat("Logger.toString", log.toString(), is("JettyLogger:xxx:LEVEL=INFO")); + + log.setLevel(Level.WARN); + assertThat("Logger.toString", log.toString(), is("JettyLogger:xxx:LEVEL=WARN")); + + log.setLevel(Level.ERROR); + assertThat("Logger.toString", log.toString(), is("JettyLogger:xxx:LEVEL=ERROR")); + + log.setLevel(JettyLogger.OFF); + assertThat("Logger.toString", log.toString(), is("JettyLogger:xxx:LEVEL=OFF")); + } + + @Test + public void testConfiguredAndSetDebugEnabled() + { + Properties props = new Properties(); + props.setProperty("org.eclipse.jetty.util.LEVEL", "WARN"); + props.setProperty("org.eclipse.jetty.io.LEVEL", "WARN"); + + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger root = factory.getJettyLogger(""); + assertLevel(root, Level.INFO); // default + + JettyLogger log = factory.getJettyLogger("org.eclipse.jetty.util.Foo"); + assertThat("Log.isDebugEnabled()", log.isDebugEnabled(), is(false)); + assertLevel(log, Level.WARN); // as configured + + // Boot stomp it all to debug + root.setLevel(Level.DEBUG); + assertThat("Log.isDebugEnabled()", log.isDebugEnabled(), is(true)); + assertLevel(log, Level.DEBUG); // as stomped + + // Restore configured + factory.walkChildLoggers(root.getName(), (logger) -> + { + int configuredLevel = config.getLevel(logger.getName()); + logger.setLevel(configuredLevel); + }); + assertThat("Log.isDebugEnabled()", log.isDebugEnabled(), is(false)); + assertLevel(log, Level.WARN); // as configured + } + + @Test + public void testSuppressed() + { + JettyLoggerConfiguration config = new JettyLoggerConfiguration(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + CapturedStream output = new CapturedStream(); + appender.setStream(output); + + JettyLogger log = factory.getJettyLogger("xxx"); + + Exception inner = new Exception("inner"); + inner.addSuppressed(new IllegalStateException() + { + { + addSuppressed(new Exception("branch0")); + } + }); + IOException outer = new IOException("outer", inner); + + outer.addSuppressed(new IllegalStateException() + { + { + addSuppressed(new Exception("branch1")); + } + }); + outer.addSuppressed(new IllegalArgumentException() + { + { + addSuppressed(new Exception("branch2")); + } + }); + + log.warn("problem", outer); + + output.assertContains("\t|\t|java.lang.Exception: branch2"); + output.assertContains("\t|\t|java.lang.Exception: branch1"); + output.assertContains("\t|\t|java.lang.Exception: branch0"); + } + + private void assertLevel(JettyLogger log, Level expectedLevel) + { + assertThat("Log[" + log.getName() + "].level", + JettyLogger.levelToString(log.getLevel()), is(expectedLevel.toString())); + } +} diff --git a/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/Slf4jEffort.java b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/Slf4jEffort.java new file mode 100644 index 00000000000..132f00f3450 --- /dev/null +++ b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/Slf4jEffort.java @@ -0,0 +1,240 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under +// the terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0 +// +// This Source Code may also be made available under the following +// Secondary Licenses when the conditions for such availability set +// forth in the Eclipse Public License, v. 2.0 are satisfied: +// the Apache License v2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.logging; + +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Predicate; +import java.util.stream.Stream; + +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Tool to help identify maven projects that need to be updated. + */ +public class Slf4jEffort +{ + public static void main(String[] args) throws Throwable + { + if (args.length < 1) + throw new IllegalStateException("No path specified: (expected) Slf4jEffort "); + + Path path = Paths.get(args[0]); + + if (!Files.exists(path)) + { + throw new FileNotFoundException(path.toString()); + } + + if (!Files.isDirectory(path)) + { + throw new IllegalStateException("Not a directory: " + path.toString()); + } + + Slf4jEffort effort = new Slf4jEffort(); + effort.scan(path); + } + + private Predicate notInTargetDirectory = (path) -> !path.toString().contains("/target/"); + + private void scan(Path root) throws IOException + { + AtomicInteger countJpms = new AtomicInteger(0); + AtomicInteger countPomSlf4jApis = new AtomicInteger(0); + AtomicInteger countPomSlf4jImpls = new AtomicInteger(0); + AtomicInteger countOldLogClassProps = new AtomicInteger(0); + + getProjectsStream(root).forEach((pom) -> + { + Path project = pom.getParent(); + try + { + Path testLoggingProps = project.resolve("src/test/resources/jetty-logging.properties"); + + boolean isMainSrcUsingLogging = getSources(project.resolve("src/main/java")).anyMatch(Slf4jEffort::isUsingLogging); + boolean isTestSrcUsingLogging = getSources(project.resolve("src/test/java")).anyMatch(Slf4jEffort::isUsingLogging); + + if (isMainSrcUsingLogging || isTestSrcUsingLogging) + { + // Must include slf4j in module-info and pom + Path moduleInfo = project.resolve("src/main/java/module-info.java"); + if (Files.exists(moduleInfo) && isMainSrcUsingLogging && !isLoggingJpmsPresent(moduleInfo)) + { + System.err.printf("[Missing: JPMS] %s%n", moduleInfo); + countJpms.incrementAndGet(); + } + + if (!isSlf4jDepPresent(pom)) + { + // System.err.printf("[Missing: Dep: slf4j-api] %s%n", pom); + countPomSlf4jApis.incrementAndGet(); + } + + if (isTestSrcUsingLogging && !isSlf4jImplDepPresent(pom)) + { + // System.err.printf("[Missing: Dep: jetty-slf4j-impl] %s%n", pom); + countPomSlf4jImpls.incrementAndGet(); + } + + if (Files.exists(testLoggingProps) && isOldLogClassPropPresent(testLoggingProps)) + { + System.err.printf("[Deprecated: log.class=LogImpl] %s%n", testLoggingProps); + countOldLogClassProps.incrementAndGet(); + } + } + } + catch (IOException e) + { + e.printStackTrace(); + } + }); + + System.out.printf("JPMS (module-info.java) to fix: %d%n", countJpms.get()); + System.out.printf("POMS (pom.xml) - slf4j-api to fix: %d%n", countPomSlf4jApis.get()); + System.out.printf("POMS (pom.xml) - jetty-slf4j-impl to fix: %d%n", countPomSlf4jImpls.get()); + System.out.printf("PROPS (jetty-logging.properties) - to fix: %d%n", countOldLogClassProps.get()); + } + + private boolean isDepPresent(Path pom, String keyword) + { + try (BufferedReader reader = Files.newBufferedReader(pom)) + { + String line; + boolean inDependencies = false; + while ((line = reader.readLine()) != null) + { + if (line.contains("")) + { + inDependencies = true; + continue; + } + + if (line.contains("")) + { + inDependencies = false; + continue; + } + + if (inDependencies && line.contains(keyword)) + { + return true; + } + } + } + catch (IOException e) + { + System.err.printf(" [WARN] (%s) %s in %s%n", e.getClass().getName(), e.getMessage(), pom); + } + return false; + } + + private boolean isSlf4jDepPresent(Path pom) + { + return isDepPresent(pom, "slf4j-api"); + } + + private boolean isSlf4jImplDepPresent(Path pom) + { + return isDepPresent(pom, "jetty-slf4j-impl"); + } + + private boolean isOldLogClassPropPresent(Path propFile) + { + return getLineStream(propFile).anyMatch((line) -> line.startsWith("org.eclipse.jetty.util.log.class=")); + } + + private Stream getLineStream(Path file) + { + try + { + return Files.readAllLines(file, UTF_8).stream(); + } + catch (IOException e) + { + System.err.printf(" [WARN] (%s) %s in %s%n", e.getClass().getName(), e.getMessage(), file); + return Stream.empty(); + } + } + + private boolean isLoggingJpmsPresent(Path moduleInfo) + { + try (BufferedReader reader = Files.newBufferedReader(moduleInfo)) + { + String line; + while ((line = reader.readLine()) != null) + { + if (line.contains("requires org.slf4j;")) + { + return true; + } + } + } + catch (IOException e) + { + System.err.printf(" [WARN] (%s) %s in %s%n", e.getClass().getName(), e.getMessage(), moduleInfo); + } + return false; + } + + private static boolean isUsingLogging(Path src) + { + try (BufferedReader reader = Files.newBufferedReader(src)) + { + String line; + while ((line = reader.readLine()) != null) + { + if (line.startsWith("import org.eclipse.jetty.util.log.") || + line.startsWith("import org.slf4j.") || + line.startsWith("import org.eclipse.jetty.logging.")) + { + return true; + } + } + } + catch (IOException e) + { + System.err.printf(" [WARN] (%s) %s in %s%n", e.getClass().getName(), e.getMessage(), src); + } + return false; + } + + private Stream getSources(Path src) throws IOException + { + if (!Files.exists(src) || !Files.isDirectory(src)) + { + return Stream.empty(); + } + return Files.walk(src) + .filter(Files::isRegularFile) + .filter((path) -> path.getFileName().toString().endsWith(".java")); + } + + private Stream getProjectsStream(Path root) throws IOException + { + return Files.walk(root) + .filter(notInTargetDirectory) + .filter(Files::isRegularFile) + .filter((path) -> path.getFileName().toString().equals("pom.xml")); + } +} diff --git a/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/StdErrAppenderTest.java b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/StdErrAppenderTest.java new file mode 100644 index 00000000000..38184450283 --- /dev/null +++ b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/StdErrAppenderTest.java @@ -0,0 +1,49 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under +// the terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0 +// +// This Source Code may also be made available under the following +// Secondary Licenses when the conditions for such availability set +// forth in the Eclipse Public License, v. 2.0 are satisfied: +// the Apache License v2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.logging; + +import java.util.Properties; + +import org.junit.jupiter.api.Test; +import org.slf4j.event.Level; + +public class StdErrAppenderTest +{ + @Test + public void testStdErrLogFormat() + { + Properties props = new Properties(); + props.setProperty(StdErrAppender.ZONEID_KEY, "UTC"); + JettyLoggerConfiguration config = new JettyLoggerConfiguration(props); + CapturedStream output = new CapturedStream(); + JettyLoggerFactory factory = new JettyLoggerFactory(config); + StdErrAppender appender = (StdErrAppender)factory.getRootLogger().getAppender(); + appender.setStream(output); + JettyLogger logger = factory.getJettyLogger("org.eclipse.jetty.logging.LogTest"); + + String threadName = "tname"; + // Feb 17th, 2020 at 19:11:35 UTC (with 563 millis) + long timestamp = 1581966695563L; + + appender.emit(logger, Level.INFO, timestamp, threadName, null, "testing:{},{}", "test", "format1"); + + System.err.println(output); + output.assertContains("2020-02-17 19:11:35.563:INFO :oejl.LogTest:tname: testing:test,format1"); + } +} diff --git a/jetty-spring/src/main/java/module-info.java b/jetty-spring/src/main/java/module-info.java index 754dedd15fd..1ab02eee967 100644 --- a/jetty-spring/src/main/java/module-info.java +++ b/jetty-spring/src/main/java/module-info.java @@ -24,6 +24,7 @@ module org.eclipse.jetty.spring exports org.eclipse.jetty.spring; requires transitive org.eclipse.jetty.xml; + requires org.slf4j; requires spring.beans; requires spring.core; diff --git a/jetty-start/pom.xml b/jetty-start/pom.xml index 062db44d4f3..c7b7b275b8b 100644 --- a/jetty-start/pom.xml +++ b/jetty-start/pom.xml @@ -72,6 +72,16 @@ org.eclipse.jetty jetty-util ${project.version} + + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + + org.eclipse.jetty.toolchain diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/BaseBuilder.java b/jetty-start/src/main/java/org/eclipse/jetty/start/BaseBuilder.java index 8e2eb62b826..15eca129bfb 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/BaseBuilder.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/BaseBuilder.java @@ -136,7 +136,7 @@ public class BaseBuilder } if (StartLog.isDebugEnabled()) - StartLog.debug("added=%s", newlyAdded); + StartLog.debug("Newly Added %s", newlyAdded); // Check the licenses if (startArgs.isLicenseCheckRequired()) diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java index a196a916a4f..f72f8387a77 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java @@ -310,7 +310,7 @@ public class Main modules.registerAll(); // 4) Active Module Resolution - for (String enabledModule : args.getEnabledModules()) + for (String enabledModule : modules.getSortedNames(args.getEnabledModules())) { for (String source : args.getSources(enabledModule)) { diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java index 492bbe4b14b..a4e3b97415d 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java @@ -48,6 +48,7 @@ public class Modules implements Iterable private final List _modules = new ArrayList<>(); private final Map _names = new HashMap<>(); private final Map> _provided = new HashMap<>(); + private final Map _providedDefaults = new HashMap<>(); private final BaseHome _baseHome; private final StartArgs _args; private final Properties _deprecated = new Properties(); @@ -221,7 +222,22 @@ public class Modules implements Iterable _names.put(module.getName(), module); module.getProvides().forEach(n -> { - _provided.computeIfAbsent(n, k -> new HashSet()).add(module); + // Syntax can be : + // "" - for a simple provider reference + // "|default" - for a provider that is also the default implementation + String name = n; + boolean isDefaultProvider = false; + int idx = n.indexOf('|'); + if (idx > 0) + { + name = n.substring(0, idx); + isDefaultProvider = n.substring(idx + 1).equalsIgnoreCase("default"); + } + _provided.computeIfAbsent(name, k -> new HashSet<>()).add(module); + if (isDefaultProvider) + { + _providedDefaults.computeIfAbsent(name, k -> module.getName()); + } }); return module; @@ -285,6 +301,50 @@ public class Modules implements Iterable return enabled; } + public List getSortedAll() + { + List all = new ArrayList(_modules); + + TopologicalSort sort = new TopologicalSort<>(); + for (Module module : all) + { + Consumer add = name -> + { + Module dependency = _names.get(name); + if (dependency != null) + sort.addDependency(module, dependency); + + Set provided = _provided.get(name); + if (provided != null) + for (Module p : provided) + { + sort.addDependency(module, p); + } + }; + module.getDepends().forEach(add); + module.getOptional().forEach(add); + } + + sort.sort(all); + return all; + } + + public List getSortedNames(List enabledModules) + { + List all = getSortedAll(); + List order = new ArrayList<>(); + for (Module module : all) + { + String name = module.getName(); + if (enabledModules.contains(name)) + { + order.add(name); + } + } + + return order; + } + /** * Enable a module * @@ -305,11 +365,11 @@ public class Modules implements Iterable private void enable(Set newlyEnabled, Module module, String enabledFrom, boolean transitive) { - StartLog.debug("enable %s from %s transitive=%b", module, enabledFrom, transitive); + StartLog.debug("Enable [%s] from [%s] transitive=%b", module, enabledFrom, transitive); if (newlyEnabled.contains(module.getName())) { - StartLog.debug("Cycle at %s", module); + StartLog.debug("Already enabled [%s] from %s", module.getName(), module.getEnableSources()); return; } @@ -330,14 +390,13 @@ public class Modules implements Iterable throw new UsageException("Module %s provides %s, which is already provided by %s enabled in %s", module.getName(), name, p.getName(), p.getEnableSources()); } } - ; } } // Enable the module if (module.enable(enabledFrom, transitive)) { - StartLog.debug("enabled %s", module.getName()); + StartLog.debug("Enabled [%s]", module.getName()); newlyEnabled.add(module.getName()); // Expand module properties @@ -358,7 +417,7 @@ public class Modules implements Iterable } // Process module dependencies (always processed as may be dynamic) - StartLog.debug("Enabled module %s depends on %s", module.getName(), module.getDepends()); + StartLog.debug("Enabled module [%s] depends on %s", module.getName(), module.getDepends()); for (String dependsOnRaw : module.getDepends()) { boolean isRequired = Module.isRequiredDependency(dependsOnRaw); @@ -368,7 +427,7 @@ public class Modules implements Iterable // Look for modules that provide that dependency Set providers = getAvailableProviders(dependentModule); - StartLog.debug("Module %s depends on %s provided by %s", module, dependentModule, providers); + StartLog.debug("Module [%s] depends on [%s] provided by %s", module, dependentModule, providers); // If there are no known providers of the module if (providers.isEmpty()) @@ -403,24 +462,46 @@ public class Modules implements Iterable providers.stream().filter(m -> m.isEnabled() && !m.equals(module)).forEach(m -> enable(newlyEnabled, m, "transitive provider of " + dependentModule + " for " + module.getName(), true)); else { - // Is there an obvious default? - Optional dftProvider = (providers.size() == 1) - ? providers.stream().findFirst() - : providers.stream().filter(m -> m.getName().equals(dependentModule)).findFirst(); + Optional dftProvider = findDefaultProvider(providers, dependentModule); if (dftProvider.isPresent()) + { + StartLog.debug("Using [%s] provider as default for [%s]", dftProvider.get(), dependentModule); enable(newlyEnabled, dftProvider.get(), "transitive provider of " + dependentModule + " for " + module.getName(), true); - else if (StartLog.isDebugEnabled()) - StartLog.debug("Module %s requires a %s implementation from one of %s", module, dependentModule, providers); + } } } } + private Optional findDefaultProvider(Set providers, String dependsOn) + { + // Is it obvious? + if (providers.size() == 1) + return providers.stream().findFirst(); + + // If more then one provider impl, is there one specified as "default"? + if (providers.size() > 1) + { + // Was it specified with [provides] "name|default" ? + String defaultProviderName = _providedDefaults.get(dependsOn); + if (defaultProviderName != null) + { + return providers.stream().filter(m -> m.getName().equals(defaultProviderName)).findFirst(); + } + + // Or does a module exist with the same name as the [provides] "name" + return providers.stream().filter(m -> m.getName().equals(dependsOn)).findFirst(); + } + + // No default provider + return Optional.empty(); + } + private Set getAvailableProviders(String name) { // Get all available providers Set providers = _provided.get(name); - StartLog.debug("Providers of %s are %s", name, providers); + StartLog.debug("Providers of [%s] are %s", name, providers); if (providers == null || providers.isEmpty()) return Collections.emptySet(); @@ -455,7 +536,7 @@ public class Modules implements Iterable } } - StartLog.debug("Available providers of %s are %s", name, providers); + StartLog.debug("Available providers of [%s] are %s", name, providers); return providers; } @@ -496,7 +577,7 @@ public class Modules implements Iterable if (unsatisfied.length() > 0) unsatisfied.append(','); unsatisfied.append(m.getName()); - StartLog.error("Module %s requires a module providing %s from one of %s%n", m.getName(), d, providers); + StartLog.error("Module [%s] requires a module providing [%s] from one of %s%n", m.getName(), d, providers); } }); }); diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java index 92adf58535b..d1aeb53b54f 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java @@ -617,7 +617,7 @@ public class StartArgs } } jmodAdds.add("ALL-MODULE-PATH"); - StartLog.debug("Expanded JPMS directives:%nadd-modules: %s%npatch-modules: %s%nadd-opens: %s%nadd-exports: %s%nadd-reads: %s", + StartLog.debug("Expanded JPMS directives:%n add-modules: %s%n patch-modules: %s%n add-opens: %s%n add-exports: %s%n add-reads: %s", jmodAdds, jmodPatch, jmodOpens, jmodExports, jmodReads); } diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/StartLog.java b/jetty-start/src/main/java/org/eclipse/jetty/start/StartLog.java index df84d80a4d1..be876154e53 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/StartLog.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/StartLog.java @@ -44,11 +44,16 @@ public class StartLog private static volatile PrintStream logStream = System.err; private static final StartLog INSTANCE = new StartLog(); + private static void outLog(String level, String format, Object... args) + { + out.printf(level + ": " + format + "%n", args); + } + public static void debug(String format, Object... args) { if (INSTANCE.debug) { - out.printf(format + "%n", args); + outLog("DEBUG ", format, args); } } @@ -64,7 +69,7 @@ public class StartLog { if (INSTANCE.trace) { - out.printf("TRACE " + format + "%n", args); + outLog("TRACE ", format, args); } } diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java index 3ee887e088e..b39b23808ff 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java @@ -247,4 +247,45 @@ public class MainTest ConfigurationAssert.assertConfiguration(baseHome, args, "assert-home-with-spaces.txt"); } + + @Test + public void testProvidersUsingDefault() throws Exception + { + Path homePath = MavenTestingUtils.getTestResourceDir("providers-home").toPath().toRealPath(); + + List cmdLineArgs = new ArrayList<>(); + cmdLineArgs.add("user.dir=" + homePath); + cmdLineArgs.add("jetty.home=" + homePath); + cmdLineArgs.add("--module=server"); + + Main main = new Main(); + StartArgs args = main.processCommandLine(cmdLineArgs.toArray(new String[cmdLineArgs.size()])); + BaseHome baseHome = main.getBaseHome(); + + assertThat("jetty.home", baseHome.getHome(), is(homePath.toString())); + assertThat("jetty.base", baseHome.getBase(), is(homePath.toString())); + + ConfigurationAssert.assertConfiguration(baseHome, args, "assert-providers-default.txt"); + } + + @Test + public void testProvidersUsingSpecific() throws Exception + { + Path homePath = MavenTestingUtils.getTestResourceDir("providers-home").toPath().toRealPath(); + + List cmdLineArgs = new ArrayList<>(); + cmdLineArgs.add("user.dir=" + homePath); + cmdLineArgs.add("jetty.home=" + homePath); + cmdLineArgs.add("--module=server"); + cmdLineArgs.add("--module=logging-b"); + + Main main = new Main(); + StartArgs args = main.processCommandLine(cmdLineArgs.toArray(new String[cmdLineArgs.size()])); + BaseHome baseHome = main.getBaseHome(); + + assertThat("jetty.home", baseHome.getHome(), is(homePath.toString())); + assertThat("jetty.base", baseHome.getBase(), is(homePath.toString())); + + ConfigurationAssert.assertConfiguration(baseHome, args, "assert-providers-specific.txt"); + } } diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java b/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java index b156ca1cf2a..d8656bbbb76 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java @@ -24,7 +24,6 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.PrintStream; -import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; @@ -38,6 +37,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.stream.Collectors.toList; import static org.hamcrest.MatcherAssert.assertThat; @@ -83,19 +83,7 @@ public class TestUseCases PrintStream originalStream = StartLog.setStream(new PrintStream(out)); try { - // If there is a "{caseName}.prepare.txt" then use those - // lines as if you are calling start.jar once to setup - // the base directory. - List prepareArgs = lines(caseName + ".prepare.txt"); - if (!prepareArgs.isEmpty()) - { - Main main = new Main(); - List cmdLine = new ArrayList<>(); - cmdLine.add("--testing-mode"); - cmdLine.addAll(prepareArgs); - - main.start(main.processCommandLine(cmdLine)); - } + prepare(caseName); Main main = new Main(); List cmdLine = new ArrayList<>(); @@ -110,18 +98,23 @@ public class TestUseCases BaseHome baseHome = main.getBaseHome(); StartLog.setStream(originalStream); - String output = out.toString(StandardCharsets.UTF_8.name()); + String output = out.toString(UTF_8); ConfigurationAssert.assertConfiguration(baseHome, args, output, assertFile); } catch (Exception e) { - List exceptions = lines(assertFile).stream().filter(s -> s.startsWith("EX|")).collect(toList()); - if (exceptions.isEmpty()) + List expectedExceptions = lines(assertFile).stream().filter(s -> s.startsWith("EX|")).collect(toList()); + if (expectedExceptions.isEmpty()) throw e; - for (String ex : exceptions) + + for (String ex : expectedExceptions) { ex = ex.substring(3); - assertThat(e.toString(), Matchers.containsString(ex)); + if (!e.toString().contains(ex)) + { + System.err.println(out.toString(UTF_8)); + assertThat(e.toString(), Matchers.containsString(ex)); + } } } finally @@ -130,6 +123,23 @@ public class TestUseCases } } + private void prepare(String caseName) throws Exception + { + // If there is a "{caseName}.prepare.txt" then use those + // lines as if you are calling start.jar once to setup + // the base directory. + List prepareArgs = lines(caseName + ".prepare.txt"); + if (!prepareArgs.isEmpty()) + { + Main main = new Main(); + List cmdLine = new ArrayList<>(); + cmdLine.add("--testing-mode"); + cmdLine.addAll(prepareArgs); + + main.start(main.processCommandLine(cmdLine)); + } + } + private List lines(String filename) throws IOException { return lines(MavenTestingUtils.getTestResourcesPath().resolve("usecases" + File.separator + filename).toFile()); @@ -147,6 +157,8 @@ public class TestUseCases while ((line = buf.readLine()) != null) { line = line.trim(); + if (line.startsWith("#")) + continue; // skip this line if (line.length() > 0) { ret.add(line); diff --git a/jetty-start/src/test/resources/assert-providers-default.txt b/jetty-start/src/test/resources/assert-providers-default.txt new file mode 100644 index 00000000000..576efd12954 --- /dev/null +++ b/jetty-start/src/test/resources/assert-providers-default.txt @@ -0,0 +1,11 @@ +## The XMLs we expect (order is important) +XML|${jetty.base}/etc/logging-a.xml + +# The LIBs we expect (order is irrelevant) + +# The Properties we expect (order is irrelevant) +PROP|logging.prop=a +PROP|logging.a=true + +# Files / Directories to create + diff --git a/jetty-start/src/test/resources/assert-providers-specific.txt b/jetty-start/src/test/resources/assert-providers-specific.txt new file mode 100644 index 00000000000..b9132c3e0be --- /dev/null +++ b/jetty-start/src/test/resources/assert-providers-specific.txt @@ -0,0 +1,11 @@ +## The XMLs we expect (order is important) +XML|${jetty.base}/etc/logging-b.xml + +# The LIBs we expect (order is irrelevant) + +# The Properties we expect (order is irrelevant) +PROP|logging.prop=b +PROP|logging.b=true + +# Files / Directories to create + diff --git a/jetty-start/src/test/resources/providers-home/etc/logging-a.xml b/jetty-start/src/test/resources/providers-home/etc/logging-a.xml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/jetty-start/src/test/resources/providers-home/etc/logging-b.xml b/jetty-start/src/test/resources/providers-home/etc/logging-b.xml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/jetty-start/src/test/resources/providers-home/etc/logging-c.xml b/jetty-start/src/test/resources/providers-home/etc/logging-c.xml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/jetty-start/src/test/resources/providers-home/modules/logging-a.mod b/jetty-start/src/test/resources/providers-home/modules/logging-a.mod new file mode 100644 index 00000000000..28f8973a239 --- /dev/null +++ b/jetty-start/src/test/resources/providers-home/modules/logging-a.mod @@ -0,0 +1,12 @@ +[tag] +logging + +[provides] +logging|default + +[xml] +etc/logging-a.xml + +[ini] +logging.prop=a +logging.a=true \ No newline at end of file diff --git a/jetty-start/src/test/resources/providers-home/modules/logging-b.mod b/jetty-start/src/test/resources/providers-home/modules/logging-b.mod new file mode 100644 index 00000000000..704088c8e92 --- /dev/null +++ b/jetty-start/src/test/resources/providers-home/modules/logging-b.mod @@ -0,0 +1,12 @@ +[tag] +logging + +[provides] +logging + +[xml] +etc/logging-b.xml + +[ini] +logging.prop=b +logging.b=true diff --git a/jetty-start/src/test/resources/providers-home/modules/logging-c.mod b/jetty-start/src/test/resources/providers-home/modules/logging-c.mod new file mode 100644 index 00000000000..b054e3ad88d --- /dev/null +++ b/jetty-start/src/test/resources/providers-home/modules/logging-c.mod @@ -0,0 +1,12 @@ +[tag] +logging + +[provides] +logging + +[xml] +etc/logging-c.xml + +[ini] +logging.prop=c +logging.c=true \ No newline at end of file diff --git a/jetty-start/src/test/resources/providers-home/modules/server.mod b/jetty-start/src/test/resources/providers-home/modules/server.mod new file mode 100644 index 00000000000..c0f21bd5bd9 --- /dev/null +++ b/jetty-start/src/test/resources/providers-home/modules/server.mod @@ -0,0 +1,8 @@ +[tag] +server + +[provides] +server + +[depends] +logging diff --git a/jetty-start/src/test/resources/usecases/loop.prepare.txt b/jetty-start/src/test/resources/usecases/loop.prepare.txt index 535d63e02ec..944681ab93a 100644 --- a/jetty-start/src/test/resources/usecases/loop.prepare.txt +++ b/jetty-start/src/test/resources/usecases/loop.prepare.txt @@ -1,2 +1,3 @@ --create-startd +# tom -> dick -> harry -> tom == CyclicException --add-to-start=tom diff --git a/jetty-unixsocket/jetty-unixsocket-client/src/main/java/module-info.java b/jetty-unixsocket/jetty-unixsocket-client/src/main/java/module-info.java index 6b2f8bc1d2c..0c7f8bf8bed 100644 --- a/jetty-unixsocket/jetty-unixsocket-client/src/main/java/module-info.java +++ b/jetty-unixsocket/jetty-unixsocket-client/src/main/java/module-info.java @@ -24,4 +24,5 @@ module org.eclipse.jetty.unixsocket.client requires jnr.unixsocket; requires transitive org.eclipse.jetty.client; requires org.eclipse.jetty.unixsocket.common; + requires org.slf4j; } diff --git a/jetty-unixsocket/jetty-unixsocket-client/src/test/resources/jetty-logging.properties b/jetty-unixsocket/jetty-unixsocket-client/src/test/resources/jetty-logging.properties index f6dad82a697..e67317312a5 100644 --- a/jetty-unixsocket/jetty-unixsocket-client/src/test/resources/jetty-logging.properties +++ b/jetty-unixsocket/jetty-unixsocket-client/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.unixsocket.LEVEL=DEBUG diff --git a/jetty-unixsocket/jetty-unixsocket-common/src/main/java/module-info.java b/jetty-unixsocket/jetty-unixsocket-common/src/main/java/module-info.java index 7e9c3fdcd5e..97f725825de 100644 --- a/jetty-unixsocket/jetty-unixsocket-common/src/main/java/module-info.java +++ b/jetty-unixsocket/jetty-unixsocket-common/src/main/java/module-info.java @@ -22,4 +22,5 @@ module org.eclipse.jetty.unixsocket.common requires jnr.unixsocket; requires transitive org.eclipse.jetty.io; + requires org.slf4j; } diff --git a/jetty-unixsocket/jetty-unixsocket-server/src/main/java/module-info.java b/jetty-unixsocket/jetty-unixsocket-server/src/main/java/module-info.java index 98e3fd0a284..e7a7cf13625 100644 --- a/jetty-unixsocket/jetty-unixsocket-server/src/main/java/module-info.java +++ b/jetty-unixsocket/jetty-unixsocket-server/src/main/java/module-info.java @@ -24,4 +24,5 @@ module org.eclipse.jetty.unixsocket.server requires jnr.unixsocket; requires transitive org.eclipse.jetty.server; requires transitive org.eclipse.jetty.unixsocket.common; + requires org.slf4j; } diff --git a/jetty-unixsocket/jetty-unixsocket-server/src/test/resources/jetty-logging.properties b/jetty-unixsocket/jetty-unixsocket-server/src/test/resources/jetty-logging.properties index f6dad82a697..e67317312a5 100644 --- a/jetty-unixsocket/jetty-unixsocket-server/src/test/resources/jetty-logging.properties +++ b/jetty-unixsocket/jetty-unixsocket-server/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.unixsocket.LEVEL=DEBUG diff --git a/jetty-util-ajax/src/main/java/module-info.java b/jetty-util-ajax/src/main/java/module-info.java index 15e67f77178..e191453ed42 100644 --- a/jetty-util-ajax/src/main/java/module-info.java +++ b/jetty-util-ajax/src/main/java/module-info.java @@ -21,4 +21,5 @@ module org.eclipse.jetty.util.ajax exports org.eclipse.jetty.util.ajax; requires org.eclipse.jetty.util; + requires org.slf4j; } diff --git a/jetty-util/pom.xml b/jetty-util/pom.xml index a0188a09aab..90915e321cf 100644 --- a/jetty-util/pom.xml +++ b/jetty-util/pom.xml @@ -82,19 +82,10 @@ org.slf4j slf4j-api - provided - true - - org.slf4j - slf4j-jdk14 - ${slf4j.version} - test + org.eclipse.jetty + jetty-slf4j-impl diff --git a/jetty-util/src/main/config/etc/console-capture.xml b/jetty-util/src/main/config/etc/console-capture.xml index c8491fd31d8..439b0375241 100644 --- a/jetty-util/src/main/config/etc/console-capture.xml +++ b/jetty-util/src/main/config/etc/console-capture.xml @@ -1,26 +1,46 @@ - - - - - /yyyy_mm_dd.jetty.log - - - - - - - - - - - + + + + + /yyyy_mm_dd.jetty.log + + + + + + + + + + + + + + + + + + - - Console stderr/stdout captured to - - - + + org.eclipse.jetty + + Console stderr/stdout captured to + + + + + + + + + + + + + + diff --git a/jetty-util/src/main/config/modules/console-capture.mod b/jetty-util/src/main/config/modules/console-capture.mod index d9eaac43bef..f82d5316b58 100644 --- a/jetty-util/src/main/config/modules/console-capture.mod +++ b/jetty-util/src/main/config/modules/console-capture.mod @@ -7,6 +7,9 @@ including output from Jetty's default StdErrLog logging. [tags] logging +[depends] +logging + [xml] etc/console-capture.xml diff --git a/jetty-util/src/main/config/modules/jcl-slf4j.mod b/jetty-util/src/main/config/modules/jcl-slf4j.mod deleted file mode 100644 index cbe80839ca1..00000000000 --- a/jetty-util/src/main/config/modules/jcl-slf4j.mod +++ /dev/null @@ -1,25 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Provides a Java Commons Logging (JCL) binding to SLF4J logging. - -[tags] -logging -jcl -slf4j -internal - -[depends] -slf4j-api -slf4j-impl - -[provides] -jcl-api -jcl-impl -slf4j+jcl - -[files] -maven://org.slf4j/jcl-over-slf4j/${slf4j.version}|lib/slf4j/jcl-over-slf4j-${slf4j.version}.jar - -[lib] -lib/slf4j/jcl-over-slf4j-${slf4j.version}.jar diff --git a/jetty-util/src/main/config/modules/jul-impl.mod b/jetty-util/src/main/config/modules/jul-impl.mod deleted file mode 100644 index 7ac22f79fb2..00000000000 --- a/jetty-util/src/main/config/modules/jul-impl.mod +++ /dev/null @@ -1,20 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Configures the Java Util Logging mechanism - -[tags] -logging -jul -internal - -[provides] -jul-api -jul-impl - -[files] -basehome:modules/jul-impl - -[exec] --Djava.util.logging.config.file?=${jetty.base}/etc/java-util-logging.properties - diff --git a/jetty-util/src/main/config/modules/jul-impl/etc/java-util-logging.properties b/jetty-util/src/main/config/modules/jul-impl/etc/java-util-logging.properties deleted file mode 100644 index 867df054acb..00000000000 --- a/jetty-util/src/main/config/modules/jul-impl/etc/java-util-logging.properties +++ /dev/null @@ -1,12 +0,0 @@ -.level = INFO - -handlers = java.util.logging.ConsoleHandler -java.util.logging.ConsoleHandler.level = INFO -java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter - -#handlers = java.util.logging.FileHandler -#java.util.logging.FileHandler.pattern = ${jetty.logging.dir}/jetty%u.log -#java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter - -java.util.logging.SimpleFormatter.format=%4$s: %5$s [%1$tc]%n - diff --git a/jetty-util/src/main/config/modules/jul-slf4j.mod b/jetty-util/src/main/config/modules/jul-slf4j.mod deleted file mode 100644 index 3cd9757d4f7..00000000000 --- a/jetty-util/src/main/config/modules/jul-slf4j.mod +++ /dev/null @@ -1,28 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Provides a Java Util Logging binding to SLF4J logging. - -[tags] -logging -slf4j -internal - -[depends] -slf4j-api -slf4j-impl - -[provides] -jul-api -jul-impl -slf4j+jul - -[files] -maven://org.slf4j/jul-to-slf4j/${slf4j.version}|lib/slf4j/jul-to-slf4j-${slf4j.version}.jar -basehome:modules/jul-slf4j - -[lib] -lib/slf4j/jul-to-slf4j-${slf4j.version}.jar - -[exec] --Djava.util.logging.config.file?=${jetty.base}/etc/java-util-logging.properties diff --git a/jetty-util/src/main/config/modules/jul-slf4j/etc/java-util-logging.properties b/jetty-util/src/main/config/modules/jul-slf4j/etc/java-util-logging.properties deleted file mode 100644 index 9c03ec8420d..00000000000 --- a/jetty-util/src/main/config/modules/jul-slf4j/etc/java-util-logging.properties +++ /dev/null @@ -1,2 +0,0 @@ -handlers = org.slf4j.bridge.SLF4JBridgeHandler -.level = INFO diff --git a/jetty-util/src/main/config/modules/log4j-impl.mod b/jetty-util/src/main/config/modules/log4j-impl.mod deleted file mode 100644 index 5be5f77f385..00000000000 --- a/jetty-util/src/main/config/modules/log4j-impl.mod +++ /dev/null @@ -1,32 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Provides a Log4j v1.2 API and implementation. -To receive jetty logs enable the jetty-slf4j and slf4j-log4j modules. - -[tags] -logging -log4j -internal - -[depends] -resources - -[provides] -log4j-api -log4j-impl - -[files] -maven://log4j/log4j/${log4j.version}|lib/log4j/log4j-${log4j.version}.jar -basehome:modules/log4j-impl - -[lib] -lib/log4j/log4j-${log4j.version}.jar - -[license] -Log4j is released under the Apache 2.0 license. -http://www.apache.org/licenses/LICENSE-2.0.html - -[ini] -log4j.version?=1.2.17 -jetty.webapp.addServerClasses+=,${jetty.base.uri}/lib/log4j/ diff --git a/jetty-util/src/main/config/modules/log4j-impl/resources/log4j.xml b/jetty-util/src/main/config/modules/log4j-impl/resources/log4j.xml deleted file mode 100644 index 5e3d0a9ff95..00000000000 --- a/jetty-util/src/main/config/modules/log4j-impl/resources/log4j.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/jetty-util/src/main/config/modules/log4j2-api.mod b/jetty-util/src/main/config/modules/log4j2-api.mod deleted file mode 100644 index f9766f6f531..00000000000 --- a/jetty-util/src/main/config/modules/log4j2-api.mod +++ /dev/null @@ -1,28 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Provides the Log4j v2 API - -[tags] -logging -log4j2 -log4j -internal - -[provides] -log4j2-api - -[files] -maven://org.apache.logging.log4j/log4j-api/${log4j2.version}|lib/log4j2/log4j-api-${log4j2.version}.jar - -[lib] -lib/log4j2/log4j-api-${log4j2.version}.jar - -[license] -Log4j is released under the Apache 2.0 license. -http://www.apache.org/licenses/LICENSE-2.0.html - -[ini] -log4j2.version?=2.11.2 -disruptor.version=3.4.2 -jetty.webapp.addServerClasses+=,${jetty.base.uri}/lib/log4j2/ diff --git a/jetty-util/src/main/config/modules/log4j2-impl.mod b/jetty-util/src/main/config/modules/log4j2-impl.mod deleted file mode 100644 index d8997d971db..00000000000 --- a/jetty-util/src/main/config/modules/log4j2-impl.mod +++ /dev/null @@ -1,27 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Provides a Log4j v2 implementation. -To receive jetty logs enable the jetty-slf4j, slf4j-log4j and log4j-log4j2 modules. - -[tags] -logging -log4j2 -log4j -internal - -[depends] -log4j2-api -resources - -[provides] -log4j2-impl - -[files] -maven://org.apache.logging.log4j/log4j-core/${log4j2.version}|lib/log4j2/log4j-core-${log4j2.version}.jar -maven://com.lmax/disruptor/${disruptor.version}|lib/log4j2/disruptor-${disruptor.version}.jar -basehome:modules/log4j2-impl - -[lib] -lib/log4j2/*.jar - diff --git a/jetty-util/src/main/config/modules/log4j2-impl/resources/log4j2.xml b/jetty-util/src/main/config/modules/log4j2-impl/resources/log4j2.xml deleted file mode 100644 index 400c779cb5c..00000000000 --- a/jetty-util/src/main/config/modules/log4j2-impl/resources/log4j2.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - ${sys:jetty.logging.dir:-logs} - - - - - - %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n - - - - - - - %d [%t] %-5p %c %x - %m%n - - - - - - - - - - - - - - - - - - - diff --git a/jetty-util/src/main/config/modules/log4j2-slf4j.mod b/jetty-util/src/main/config/modules/log4j2-slf4j.mod deleted file mode 100644 index 6c351779b10..00000000000 --- a/jetty-util/src/main/config/modules/log4j2-slf4j.mod +++ /dev/null @@ -1,25 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Provides a Log4j v2 binding to SLF4J logging. - -[tags] -logging -log4j2 -log4j -slf4j -internal - -[depends] -log4j2-api -slf4j-api - -[provides] -log4j2-impl - -[files] -maven://org.apache.logging.log4j/log4j-to-slf4j/${log4j2.version}|lib/log4j2/log4j-to-slf4j-${log4j2.version}.jar - -[lib] -lib/log4j2/log4j-slf4j-to-${log4j2.version}.jar - diff --git a/jetty-util/src/main/config/modules/logback-impl.mod b/jetty-util/src/main/config/modules/logback-impl.mod deleted file mode 100644 index 18c067b4d3f..00000000000 --- a/jetty-util/src/main/config/modules/logback-impl.mod +++ /dev/null @@ -1,40 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Provides the logback core implementation -and logback-access - -[tags] -logging -internal - -[depends] -resources - -[files] -maven://ch.qos.logback/logback-core/${logback.version}|lib/logback/logback-core-${logback.version}.jar -basehome:modules/logback-impl - -[lib] -lib/logback/logback-core-${logback.version}.jar - -[license] -Logback: the reliable, generic, fast and flexible logging framework. -Copyright (C) 1999-2012, QOS.ch. All rights reserved. - -This program and the accompanying materials are dual-licensed under -either: - - the terms of the Eclipse Public License v1.0 - as published by the Eclipse Foundation: - http://www.eclipse.org/legal/epl-v10.html - -or (per the licensee's choosing) under - - the terms of the GNU Lesser General Public License version 2.1 - as published by the Free Software Foundation: - http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html - -[ini] -logback.version?=1.2.3 -jetty.webapp.addServerClasses+=,${jetty.base.uri}/lib/logback/ diff --git a/jetty-util/src/main/config/modules/logback-impl/resources/logback.xml b/jetty-util/src/main/config/modules/logback-impl/resources/logback.xml deleted file mode 100644 index 552845e3249..00000000000 --- a/jetty-util/src/main/config/modules/logback-impl/resources/logback.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - %-4relative [%thread] %-5level %logger{35} - %msg %n - - - - - - - - - - diff --git a/jetty-util/src/main/config/modules/logging-jetty.mod b/jetty-util/src/main/config/modules/logging-jetty.mod deleted file mode 100644 index 65f926d3a89..00000000000 --- a/jetty-util/src/main/config/modules/logging-jetty.mod +++ /dev/null @@ -1,17 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Configure jetty logging mechanism. -Provides a ${jetty.base}/resources/jetty-logging.properties. - -[tags] -logging - -[depends] -resources - -[provides] -logging - -[files] -basehome:modules/logging-jetty diff --git a/jetty-util/src/main/config/modules/logging-jetty/resources/jetty-logging.properties b/jetty-util/src/main/config/modules/logging-jetty/resources/jetty-logging.properties deleted file mode 100644 index 07e04350fed..00000000000 --- a/jetty-util/src/main/config/modules/logging-jetty/resources/jetty-logging.properties +++ /dev/null @@ -1,12 +0,0 @@ -## Force jetty logging implementation -#org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog - -## Set logging levels from: ALL, DEBUG, INFO, WARN, OFF -#org.eclipse.jetty.LEVEL=INFO -#com.example.LEVEL=INFO - -## Hide stacks traces in logs? -#com.example.STACKS=false - -## Show the source file of a log location? -#com.example.SOURCE=false diff --git a/jetty-util/src/main/config/modules/logging-jul.mod b/jetty-util/src/main/config/modules/logging-jul.mod deleted file mode 100644 index bc0d414ba73..00000000000 --- a/jetty-util/src/main/config/modules/logging-jul.mod +++ /dev/null @@ -1,18 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Configure jetty logging to use Java Util Logging (jul) -SLF4J is used as the core logging mechanism. - -[tags] -logging - -[depends] -slf4j-jul -jul-impl - -[provides] -logging - -[exec] --Dorg.eclipse.jetty.util.log.class?=org.eclipse.jetty.util.log.Slf4jLog diff --git a/jetty-util/src/main/config/modules/logging-log4j.mod b/jetty-util/src/main/config/modules/logging-log4j.mod deleted file mode 100644 index 75b2f29b36d..00000000000 --- a/jetty-util/src/main/config/modules/logging-log4j.mod +++ /dev/null @@ -1,18 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Configure jetty logging to use Log4j Logging -SLF4J is used as the core logging mechanism. - -[tags] -logging - -[depends] -slf4j-log4j -log4j-impl - -[provides] -logging - -[exec] --Dorg.eclipse.jetty.util.log.class?=org.eclipse.jetty.util.log.Slf4jLog diff --git a/jetty-util/src/main/config/modules/logging-log4j2.mod b/jetty-util/src/main/config/modules/logging-log4j2.mod deleted file mode 100644 index 34bea9b9be6..00000000000 --- a/jetty-util/src/main/config/modules/logging-log4j2.mod +++ /dev/null @@ -1,18 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Configure jetty logging to use log4j version 2 -SLF4J is used as the core logging mechanism. - -[tags] -logging - -[depends] -slf4j-log4j2 -log4j2-impl - -[provides] -logging - -[exec] --Dorg.eclipse.jetty.util.log.class?=org.eclipse.jetty.util.log.Slf4jLog diff --git a/jetty-util/src/main/config/modules/logging-logback.mod b/jetty-util/src/main/config/modules/logging-logback.mod deleted file mode 100644 index f6699c0257d..00000000000 --- a/jetty-util/src/main/config/modules/logging-logback.mod +++ /dev/null @@ -1,18 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Configure jetty logging to use Logback Logging. -SLF4J is used as the core logging mechanism. - -[tags] -logging - -[depends] -slf4j-logback -logback-impl - -[provides] -logging - -[exec] --Dorg.eclipse.jetty.util.log.class?=org.eclipse.jetty.util.log.Slf4jLog diff --git a/jetty-util/src/main/config/modules/logging-slf4j.mod b/jetty-util/src/main/config/modules/logging-slf4j.mod deleted file mode 100644 index aac12a87ef7..00000000000 --- a/jetty-util/src/main/config/modules/logging-slf4j.mod +++ /dev/null @@ -1,18 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Configure jetty logging to use slf4j. -Any slf4j-impl implementation is used - -[tags] -logging - -[depends] -slf4j-api -slf4j-impl - -[provides] -logging - -[exec] --Dorg.eclipse.jetty.util.log.class?=org.eclipse.jetty.util.log.Slf4jLog diff --git a/jetty-util/src/main/config/modules/slf4j-jul.mod b/jetty-util/src/main/config/modules/slf4j-jul.mod deleted file mode 100644 index a0e072daab2..00000000000 --- a/jetty-util/src/main/config/modules/slf4j-jul.mod +++ /dev/null @@ -1,22 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Provides a SLF4J binding to Java Util Logging (JUL) logging. - -[tags] -logging -slf4j -internal - -[depends] -slf4j-api - -[provides] -slf4j-impl -slf4j+jul - -[files] -maven://org.slf4j/slf4j-jdk14/${slf4j.version}|lib/slf4j/slf4j-jdk14-${slf4j.version}.jar - -[lib] -lib/slf4j/slf4j-jdk14-${slf4j.version}.jar diff --git a/jetty-util/src/main/config/modules/slf4j-log4j.mod b/jetty-util/src/main/config/modules/slf4j-log4j.mod deleted file mode 100644 index d61ded58678..00000000000 --- a/jetty-util/src/main/config/modules/slf4j-log4j.mod +++ /dev/null @@ -1,25 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Provides a SLF4J binding to the Log4j v1.2 API logging. - -[tags] -logging -log4j -slf4j -internal - -[depends] -slf4j-api -log4j-api -log4j-impl - -[provides] -slf4j-impl - -[files] -maven://org.slf4j/slf4j-log4j12/${slf4j.version}|lib/slf4j/slf4j-log4j12-${slf4j.version}.jar - -[lib] -lib/slf4j/slf4j-log4j12-${slf4j.version}.jar - diff --git a/jetty-util/src/main/config/modules/slf4j-log4j2.mod b/jetty-util/src/main/config/modules/slf4j-log4j2.mod deleted file mode 100644 index fa6ff70810f..00000000000 --- a/jetty-util/src/main/config/modules/slf4j-log4j2.mod +++ /dev/null @@ -1,25 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Provides a SLF4J binding to Log4j v2 logging. - -[tags] -logging -log4j2 -log4j -slf4j -internal - -[depends] -slf4j-api -log4j2-api -log4j2-impl - -[provides] -slf4j-impl - -[files] -maven://org.apache.logging.log4j/log4j-slf4j18-impl/${log4j2.version}|lib/log4j2/log4j-slf4j18-impl-${log4j2.version}.jar - -[lib] -lib/log4j2/log4j-slf4j18-impl-${log4j2.version}.jar diff --git a/jetty-util/src/main/config/modules/slf4j-logback.mod b/jetty-util/src/main/config/modules/slf4j-logback.mod deleted file mode 100644 index f9ebe8bfe1d..00000000000 --- a/jetty-util/src/main/config/modules/slf4j-logback.mod +++ /dev/null @@ -1,24 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Provides a SLF4J binding to Logback logging. - -[tags] -logging -slf4j -internal - -[depends] -slf4j-api -logback-impl -resources - -[provides] -slf4j-impl - -[files] -maven://ch.qos.logback/logback-classic/${logback.version}|lib/logback/logback-classic-${logback.version}.jar - -[lib] -lib/logback/logback-classic-${logback.version}.jar - diff --git a/jetty-util/src/main/config/modules/slf4j-simple-impl.mod b/jetty-util/src/main/config/modules/slf4j-simple-impl.mod deleted file mode 100644 index bc1b7fd92f8..00000000000 --- a/jetty-util/src/main/config/modules/slf4j-simple-impl.mod +++ /dev/null @@ -1,24 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Provides SLF4J simple logging implementation. -To receive jetty logs enable the jetty-slf4j module. - -[tags] -logging -slf4j -internal - -[depends] -slf4j-api -resources - -[provides] -slf4j-impl - -[files] -maven://org.slf4j/slf4j-simple/${slf4j.version}|lib/slf4j/slf4j-simple-${slf4j.version}.jar -basehome:modules/slf4j-simple-impl - -[lib] -lib/slf4j/slf4j-simple-${slf4j.version}.jar diff --git a/jetty-util/src/main/config/modules/slf4j-simple-impl/resources/simplelogger.properties b/jetty-util/src/main/config/modules/slf4j-simple-impl/resources/simplelogger.properties deleted file mode 100644 index 060cf1cb61e..00000000000 --- a/jetty-util/src/main/config/modules/slf4j-simple-impl/resources/simplelogger.properties +++ /dev/null @@ -1,6 +0,0 @@ -#org.slf4j.simpleLogger.logFile=logs/jetty.log -org.slf4j.simpleLogger.defaultLogLevel=info -org.slf4j.simpleLogger.showDateTime=true -org.slf4j.simpleLogger.showThreadName=true - -#org.slf4j.simpleLogger.log.org.eclipse.jetty=debug diff --git a/jetty-util/src/main/java/module-info.java b/jetty-util/src/main/java/module-info.java index b7853a2a030..1a175df1218 100644 --- a/jetty-util/src/main/java/module-info.java +++ b/jetty-util/src/main/java/module-info.java @@ -23,6 +23,7 @@ module org.eclipse.jetty.util exports org.eclipse.jetty.util; exports org.eclipse.jetty.util.annotation; exports org.eclipse.jetty.util.component; + exports org.eclipse.jetty.util.compression; exports org.eclipse.jetty.util.log; exports org.eclipse.jetty.util.preventers; exports org.eclipse.jetty.util.resource; @@ -31,10 +32,10 @@ module org.eclipse.jetty.util exports org.eclipse.jetty.util.statistic; exports org.eclipse.jetty.util.thread; exports org.eclipse.jetty.util.thread.strategy; - exports org.eclipse.jetty.util.compression; // Required by SSL code (for X509). requires transitive java.naming; + requires org.slf4j; // Only required if using AppContextLeakPreventer/AWTLeakPreventer. requires static java.desktop; @@ -44,8 +45,6 @@ module org.eclipse.jetty.util requires static java.sql; // Only required if using DOMLeakPreventer. requires static java.xml; - // Only required if using Slf4jLog. - requires static org.slf4j; uses CredentialProvider; } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/JavaVersion.java b/jetty-util/src/main/java/org/eclipse/jetty/util/JavaVersion.java index d8cb83f11a5..7d7a8ee716b 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/JavaVersion.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/JavaVersion.java @@ -24,6 +24,8 @@ package org.eclipse.jetty.util; */ public class JavaVersion { + // IMPORTANT NOTE: This class cannot use Logging, as this class is used by jetty-start + /** * Context attribute that can be set to target a different version of the jvm than the current runtime. * Acceptable values should correspond to those returned by JavaVersion.getPlatform(). diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ManifestUtils.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ManifestUtils.java index d4f0c9efba9..8c3dbecf155 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ManifestUtils.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ManifestUtils.java @@ -27,6 +27,8 @@ import java.util.jar.Manifest; public class ManifestUtils { + // IMPORTANT NOTE: This class cannot use Logging, as this class is used by jetty-start + private ManifestUtils() { } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/TopologicalSort.java b/jetty-util/src/main/java/org/eclipse/jetty/util/TopologicalSort.java index b75ada9bd54..96f8ae3a864 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/TopologicalSort.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/TopologicalSort.java @@ -47,6 +47,8 @@ import java.util.TreeSet; */ public class TopologicalSort { + // IMPORTANT NOTE: This class cannot use Logging, as this class is used by jetty-start + private final Map> _dependencies = new HashMap<>(); /** diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/AbstractLogger.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/AbstractLogger.java deleted file mode 100644 index cb69588f732..00000000000 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/AbstractLogger.java +++ /dev/null @@ -1,257 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.util.Properties; - -/** - * Abstract Logger. - * Manages the atomic registration of the logger by name. - */ -public abstract class AbstractLogger implements Logger -{ - public static final int LEVEL_DEFAULT = -1; - public static final int LEVEL_ALL = 0; - public static final int LEVEL_DEBUG = 1; - public static final int LEVEL_INFO = 2; - public static final int LEVEL_WARN = 3; - public static final int LEVEL_OFF = 10; - - @Override - public final Logger getLogger(String name) - { - if (isBlank(name)) - return this; - - final String basename = getName(); - final String fullname = (isBlank(basename) || Log.getRootLogger() == this) ? name : (basename + "." + name); - - Logger logger = Log.getLoggers().get(fullname); - if (logger == null) - { - Logger newlog = newLogger(fullname); - - logger = Log.getMutableLoggers().putIfAbsent(fullname, newlog); - if (logger == null) - logger = newlog; - } - - return logger; - } - - protected abstract Logger newLogger(String fullname); - - /** - * A more robust form of name blank test. Will return true for null names, and names that have only whitespace - * - * @param name the name to test - * @return true for null or blank name, false if any non-whitespace character is found. - */ - private static boolean isBlank(String name) - { - if (name == null) - { - return true; - } - int size = name.length(); - char c; - for (int i = 0; i < size; i++) - { - c = name.charAt(i); - if (!Character.isWhitespace(c)) - { - return false; - } - } - return true; - } - - /** - * Get the Logging Level for the provided log name. Using the FQCN first, then each package segment from longest to - * shortest. - * - * @param props the properties to check - * @param name the name to get log for - * @return the logging level - */ - public static int lookupLoggingLevel(Properties props, final String name) - { - if ((props == null) || (props.isEmpty()) || name == null) - return LEVEL_DEFAULT; - - // Calculate the level this named logger should operate under. - // Checking with FQCN first, then each package segment from longest to shortest. - String nameSegment = name; - - while ((nameSegment != null) && (nameSegment.length() > 0)) - { - String levelStr = props.getProperty(nameSegment + ".LEVEL"); - // System.err.printf("[StdErrLog.CONFIG] Checking for property [%s.LEVEL] = %s%n",nameSegment,levelStr); - int level = getLevelId(nameSegment + ".LEVEL", levelStr); - if (level != (-1)) - { - return level; - } - - // Trim and try again. - int idx = nameSegment.lastIndexOf('.'); - if (idx >= 0) - { - nameSegment = nameSegment.substring(0, idx); - } - else - { - nameSegment = null; - } - } - - // Default Logging Level - return LEVEL_DEFAULT; - } - - public static String getLoggingProperty(Properties props, String name, String property) - { - // Calculate the level this named logger should operate under. - // Checking with FQCN first, then each package segment from longest to shortest. - String nameSegment = name; - - while ((nameSegment != null) && (nameSegment.length() > 0)) - { - String s = props.getProperty(nameSegment + "." + property); - if (s != null) - return s; - - // Trim and try again. - int idx = nameSegment.lastIndexOf('.'); - nameSegment = (idx >= 0) ? nameSegment.substring(0, idx) : null; - } - - return null; - } - - protected static int getLevelId(String levelSegment, String levelName) - { - if (levelName == null) - { - return -1; - } - String levelStr = levelName.trim(); - if ("ALL".equalsIgnoreCase(levelStr)) - { - return LEVEL_ALL; - } - else if ("DEBUG".equalsIgnoreCase(levelStr)) - { - return LEVEL_DEBUG; - } - else if ("INFO".equalsIgnoreCase(levelStr)) - { - return LEVEL_INFO; - } - else if ("WARN".equalsIgnoreCase(levelStr)) - { - return LEVEL_WARN; - } - else if ("OFF".equalsIgnoreCase(levelStr)) - { - return LEVEL_OFF; - } - - System.err.println("Unknown StdErrLog level [" + levelSegment + "]=[" + levelStr + "], expecting only [ALL, DEBUG, INFO, WARN, OFF] as values."); - return -1; - } - - /** - * Condenses a classname by stripping down the package name to just the first character of each package name - * segment.Configured - * - *

-     * Examples:
-     * "org.eclipse.jetty.test.FooTest"           = "oejt.FooTest"
-     * "org.eclipse.jetty.server.logging.LogTest" = "orjsl.LogTest"
-     * 
- * - * @param classname the fully qualified class name - * @return the condensed name - */ - @SuppressWarnings("Duplicates") - protected static String condensePackageString(String classname) - { - if (classname == null || classname.isEmpty()) - { - return ""; - } - - int rawLen = classname.length(); - StringBuilder dense = new StringBuilder(rawLen); - boolean foundStart = false; - boolean hasPackage = false; - int startIdx = -1; - int endIdx = -1; - for (int i = 0; i < rawLen; i++) - { - char c = classname.charAt(i); - if (!foundStart) - { - foundStart = Character.isJavaIdentifierStart(c); - if (foundStart) - { - if (startIdx >= 0) - { - dense.append(classname.charAt(startIdx)); - hasPackage = true; - } - startIdx = i; - } - } - - if (foundStart) - { - if (!Character.isJavaIdentifierPart(c)) - { - foundStart = false; - } - else - { - endIdx = i; - } - } - } - // append remaining from startIdx - if ((startIdx >= 0) && (endIdx >= startIdx)) - { - if (hasPackage) - { - dense.append('.'); - } - dense.append(classname, startIdx, endIdx + 1); - } - - return dense.toString(); - } - - @Override - public void debug(String msg, long arg) - { - if (isDebugEnabled()) - { - debug(msg, new Object[]{arg}); - } - } -} diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/JavaUtilLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/JavaUtilLog.java deleted file mode 100644 index 4f82c45c3f9..00000000000 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/JavaUtilLog.java +++ /dev/null @@ -1,303 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.logging.Level; -import java.util.logging.LogManager; -import java.util.logging.LogRecord; - -import org.eclipse.jetty.util.Loader; - -/** - *

- * Implementation of Jetty {@link Logger} based on {@link java.util.logging.Logger}. - *

- * - *

- * You can also set the logger level using - * standard java.util.logging configuration. - *

- * - * Configuration Properties: - *
- *
${name|hierarchy}.LEVEL=(ALL|DEBUG|INFO|WARN|OFF)
- *
- * Sets the level that the Logger should log at.
- * Names can be a package name, or a fully qualified class name.
- * Default: The default from the java.util.logging mechanism/configuration - *
- *
org.eclipse.jetty.util.log.javautil.PROPERTIES=<property-resource-name>
- *
If set, it is used as a classpath resource name to find a java.util.logging - * property file. - *
- * Default: null - *
- *
org.eclipse.jetty.util.log.javautil.SOURCE=(true|false)
- *
Set the LogRecord source class and method for JavaUtilLog.
- * Default: true - *
- *
org.eclipse.jetty.util.log.SOURCE=(true|false)
- *
Set the LogRecord source class and method for all Loggers.
- * Default: depends on Logger class - *
- *
- */ -public class JavaUtilLog extends AbstractLogger -{ - private static final boolean SOURCE = - Boolean.parseBoolean(Log.getProperty("org.eclipse.jetty.util.log.SOURCE", - Log.getProperty("org.eclipse.jetty.util.log.javautil.SOURCE", "true"))); - - private static boolean __initialized = false; - - private Level _configuredLevel; - private java.util.logging.Logger _logger; - - public JavaUtilLog() - { - this("org.eclipse.jetty.util.log.javautil"); - } - - public JavaUtilLog(String name) - { - synchronized (JavaUtilLog.class) - { - if (!__initialized) - { - __initialized = true; - - final String properties = Log.getProperty("org.eclipse.jetty.util.log.javautil.PROPERTIES", null); - if (properties != null) - { - AccessController.doPrivileged(new PrivilegedAction() - { - @Override - public Object run() - { - try - { - URL props = Loader.getResource(properties); - if (props != null) - LogManager.getLogManager().readConfiguration(props.openStream()); - } - catch (Throwable e) - { - System.err.println("[WARN] Error loading logging config: " + properties); - e.printStackTrace(System.err); - } - - return null; - } - }); - } - } - } - - _logger = java.util.logging.Logger.getLogger(name); - - switch (lookupLoggingLevel(Log.getProperties(), name)) - { - case LEVEL_ALL: - _logger.setLevel(Level.ALL); - break; - case LEVEL_DEBUG: - _logger.setLevel(Level.FINE); - break; - case LEVEL_INFO: - _logger.setLevel(Level.INFO); - break; - case LEVEL_WARN: - _logger.setLevel(Level.WARNING); - break; - case LEVEL_OFF: - _logger.setLevel(Level.OFF); - break; - case LEVEL_DEFAULT: - default: - break; - } - - _configuredLevel = _logger.getLevel(); - } - - @Override - public String getName() - { - return _logger.getName(); - } - - protected void log(Level level, String msg, Throwable thrown) - { - LogRecord record = new LogRecord(level, msg); - if (thrown != null) - record.setThrown(thrown); - record.setLoggerName(_logger.getName()); - if (SOURCE) - { - StackTraceElement[] stack = new Throwable().getStackTrace(); - for (int i = 0; i < stack.length; i++) - { - StackTraceElement e = stack[i]; - if (!e.getClassName().equals(JavaUtilLog.class.getName())) - { - record.setSourceClassName(e.getClassName()); - record.setSourceMethodName(e.getMethodName()); - break; - } - } - } - _logger.log(record); - } - - @Override - public void warn(String msg, Object... args) - { - if (_logger.isLoggable(Level.WARNING)) - log(Level.WARNING, format(msg, args), null); - } - - @Override - public void warn(Throwable thrown) - { - if (_logger.isLoggable(Level.WARNING)) - log(Level.WARNING, "", thrown); - } - - @Override - public void warn(String msg, Throwable thrown) - { - if (_logger.isLoggable(Level.WARNING)) - log(Level.WARNING, msg, thrown); - } - - @Override - public void info(String msg, Object... args) - { - if (_logger.isLoggable(Level.INFO)) - log(Level.INFO, format(msg, args), null); - } - - @Override - public void info(Throwable thrown) - { - if (_logger.isLoggable(Level.INFO)) - log(Level.INFO, "", thrown); - } - - @Override - public void info(String msg, Throwable thrown) - { - if (_logger.isLoggable(Level.INFO)) - log(Level.INFO, msg, thrown); - } - - @Override - public boolean isDebugEnabled() - { - return _logger.isLoggable(Level.FINE); - } - - @Override - public void setDebugEnabled(boolean enabled) - { - if (enabled) - { - _configuredLevel = _logger.getLevel(); - _logger.setLevel(Level.FINE); - } - else - { - _logger.setLevel(_configuredLevel); - } - } - - @Override - public void debug(String msg, Object... args) - { - if (_logger.isLoggable(Level.FINE)) - log(Level.FINE, format(msg, args), null); - } - - @Override - public void debug(String msg, long arg) - { - if (_logger.isLoggable(Level.FINE)) - log(Level.FINE, format(msg, arg), null); - } - - @Override - public void debug(Throwable thrown) - { - if (_logger.isLoggable(Level.FINE)) - log(Level.FINE, "", thrown); - } - - @Override - public void debug(String msg, Throwable thrown) - { - if (_logger.isLoggable(Level.FINE)) - log(Level.FINE, msg, thrown); - } - - /** - * Create a Child Logger of this Logger. - */ - @Override - protected Logger newLogger(String fullname) - { - return new JavaUtilLog(fullname); - } - - @Override - public void ignore(Throwable ignored) - { - if (_logger.isLoggable(Level.FINEST)) - log(Level.FINEST, Log.IGNORED, ignored); - } - - private String format(String msg, Object... args) - { - msg = String.valueOf(msg); // Avoids NPE - String braces = "{}"; - StringBuilder builder = new StringBuilder(); - int start = 0; - for (Object arg : args) - { - int bracesIndex = msg.indexOf(braces, start); - if (bracesIndex < 0) - { - builder.append(msg.substring(start)); - builder.append(" "); - builder.append(arg); - start = msg.length(); - } - else - { - builder.append(msg.substring(start, bracesIndex)); - builder.append(String.valueOf(arg)); - start = bracesIndex + braces.length(); - } - } - builder.append(msg.substring(start)); - return builder.toString(); - } -} diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/JettyAwareLogger.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/JettyAwareLogger.java deleted file mode 100644 index f4021798185..00000000000 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/JettyAwareLogger.java +++ /dev/null @@ -1,446 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import org.slf4j.Marker; -import org.slf4j.helpers.FormattingTuple; -import org.slf4j.helpers.MessageFormatter; - -/** - * JettyAwareLogger is used to fix a FQCN bug that arises from how Jetty - * Log uses an indirect slf4j implementation. - * - * https://bugs.eclipse.org/bugs/show_bug.cgi?id=276670 - */ -class JettyAwareLogger implements org.slf4j.Logger -{ - private static final int DEBUG = org.slf4j.spi.LocationAwareLogger.DEBUG_INT; - private static final int ERROR = org.slf4j.spi.LocationAwareLogger.ERROR_INT; - private static final int INFO = org.slf4j.spi.LocationAwareLogger.INFO_INT; - private static final int TRACE = org.slf4j.spi.LocationAwareLogger.TRACE_INT; - private static final int WARN = org.slf4j.spi.LocationAwareLogger.WARN_INT; - - private static final String FQCN = Slf4jLog.class.getName(); - private final org.slf4j.spi.LocationAwareLogger _logger; - - public JettyAwareLogger(org.slf4j.spi.LocationAwareLogger logger) - { - _logger = logger; - } - - @Override - public void debug(String msg) - { - log(null, DEBUG, msg, null, null); - } - - @Override - public void debug(String format, Object arg) - { - log(null, DEBUG, format, new Object[]{arg}, null); - } - - @Override - public void debug(String format, Object arg1, Object arg2) - { - log(null, DEBUG, format, new Object[]{arg1, arg2}, null); - } - - @Override - public void debug(String format, Object[] argArray) - { - log(null, DEBUG, format, argArray, null); - } - - @Override - public void debug(String msg, Throwable t) - { - log(null, DEBUG, msg, null, t); - } - - @Override - public void debug(Marker marker, String msg) - { - log(marker, DEBUG, msg, null, null); - } - - @Override - public void debug(Marker marker, String format, Object arg) - { - log(marker, DEBUG, format, new Object[]{arg}, null); - } - - @Override - public void debug(Marker marker, String format, Object arg1, Object arg2) - { - log(marker, DEBUG, format, new Object[]{arg1, arg2}, null); - } - - @Override - public void debug(Marker marker, String format, Object[] argArray) - { - log(marker, DEBUG, format, argArray, null); - } - - @Override - public void debug(Marker marker, String msg, Throwable t) - { - log(marker, DEBUG, msg, null, t); - } - - @Override - public void error(String msg) - { - log(null, ERROR, msg, null, null); - } - - @Override - public void error(String format, Object arg) - { - log(null, ERROR, format, new Object[]{arg}, null); - } - - @Override - public void error(String format, Object arg1, Object arg2) - { - log(null, ERROR, format, new Object[]{arg1, arg2}, null); - } - - @Override - public void error(String format, Object[] argArray) - { - log(null, ERROR, format, argArray, null); - } - - @Override - public void error(String msg, Throwable t) - { - log(null, ERROR, msg, null, t); - } - - @Override - public void error(Marker marker, String msg) - { - log(marker, ERROR, msg, null, null); - } - - @Override - public void error(Marker marker, String format, Object arg) - { - log(marker, ERROR, format, new Object[]{arg}, null); - } - - @Override - public void error(Marker marker, String format, Object arg1, Object arg2) - { - log(marker, ERROR, format, new Object[]{arg1, arg2}, null); - } - - @Override - public void error(Marker marker, String format, Object[] argArray) - { - log(marker, ERROR, format, argArray, null); - } - - @Override - public void error(Marker marker, String msg, Throwable t) - { - log(marker, ERROR, msg, null, t); - } - - @Override - public String getName() - { - return _logger.getName(); - } - - @Override - public void info(String msg) - { - log(null, INFO, msg, null, null); - } - - @Override - public void info(String format, Object arg) - { - log(null, INFO, format, new Object[]{arg}, null); - } - - @Override - public void info(String format, Object arg1, Object arg2) - { - log(null, INFO, format, new Object[]{arg1, arg2}, null); - } - - @Override - public void info(String format, Object[] argArray) - { - log(null, INFO, format, argArray, null); - } - - @Override - public void info(String msg, Throwable t) - { - log(null, INFO, msg, null, t); - } - - @Override - public void info(Marker marker, String msg) - { - log(marker, INFO, msg, null, null); - } - - @Override - public void info(Marker marker, String format, Object arg) - { - log(marker, INFO, format, new Object[]{arg}, null); - } - - @Override - public void info(Marker marker, String format, Object arg1, Object arg2) - { - log(marker, INFO, format, new Object[]{arg1, arg2}, null); - } - - @Override - public void info(Marker marker, String format, Object[] argArray) - { - log(marker, INFO, format, argArray, null); - } - - @Override - public void info(Marker marker, String msg, Throwable t) - { - log(marker, INFO, msg, null, t); - } - - @Override - public boolean isDebugEnabled() - { - return _logger.isDebugEnabled(); - } - - @Override - public boolean isDebugEnabled(Marker marker) - { - return _logger.isDebugEnabled(marker); - } - - @Override - public boolean isErrorEnabled() - { - return _logger.isErrorEnabled(); - } - - @Override - public boolean isErrorEnabled(Marker marker) - { - return _logger.isErrorEnabled(marker); - } - - @Override - public boolean isInfoEnabled() - { - return _logger.isInfoEnabled(); - } - - @Override - public boolean isInfoEnabled(Marker marker) - { - return _logger.isInfoEnabled(marker); - } - - @Override - public boolean isTraceEnabled() - { - return _logger.isTraceEnabled(); - } - - @Override - public boolean isTraceEnabled(Marker marker) - { - return _logger.isTraceEnabled(marker); - } - - @Override - public boolean isWarnEnabled() - { - return _logger.isWarnEnabled(); - } - - @Override - public boolean isWarnEnabled(Marker marker) - { - return _logger.isWarnEnabled(marker); - } - - @Override - public String toString() - { - return _logger.toString(); - } - - @Override - public void trace(String msg) - { - log(null, TRACE, msg, null, null); - } - - @Override - public void trace(String format, Object arg) - { - log(null, TRACE, format, new Object[]{arg}, null); - } - - @Override - public void trace(String format, Object arg1, Object arg2) - { - log(null, TRACE, format, new Object[]{arg1, arg2}, null); - } - - @Override - public void trace(String format, Object[] argArray) - { - log(null, TRACE, format, argArray, null); - } - - @Override - public void trace(String msg, Throwable t) - { - log(null, TRACE, msg, null, t); - } - - @Override - public void trace(Marker marker, String msg) - { - log(marker, TRACE, msg, null, null); - } - - @Override - public void trace(Marker marker, String format, Object arg) - { - log(marker, TRACE, format, new Object[]{arg}, null); - } - - @Override - public void trace(Marker marker, String format, Object arg1, Object arg2) - { - log(marker, TRACE, format, new Object[]{arg1, arg2}, null); - } - - @Override - public void trace(Marker marker, String format, Object[] argArray) - { - log(marker, TRACE, format, argArray, null); - } - - @Override - public void trace(Marker marker, String msg, Throwable t) - { - log(marker, TRACE, msg, null, t); - } - - @Override - public void warn(String msg) - { - log(null, WARN, msg, null, null); - } - - @Override - public void warn(String format, Object arg) - { - log(null, WARN, format, new Object[]{arg}, null); - } - - @Override - public void warn(String format, Object[] argArray) - { - log(null, WARN, format, argArray, null); - } - - @Override - public void warn(String format, Object arg1, Object arg2) - { - log(null, WARN, format, new Object[]{arg1, arg2}, null); - } - - @Override - public void warn(String msg, Throwable t) - { - log(null, WARN, msg, null, t); - } - - @Override - public void warn(Marker marker, String msg) - { - log(marker, WARN, msg, null, null); - } - - @Override - public void warn(Marker marker, String format, Object arg) - { - log(marker, WARN, format, new Object[]{arg}, null); - } - - @Override - public void warn(Marker marker, String format, Object arg1, Object arg2) - { - log(marker, WARN, format, new Object[]{arg1, arg2}, null); - } - - @Override - public void warn(Marker marker, String format, Object[] argArray) - { - log(marker, WARN, format, argArray, null); - } - - @Override - public void warn(Marker marker, String msg, Throwable t) - { - log(marker, WARN, msg, null, t); - } - - private void log(Marker marker, int level, String msg, Object[] argArray, Throwable t) - { - if (argArray == null) - { - // Simple SLF4J Message (no args) - _logger.log(marker, FQCN, level, msg, null, t); - } - else - { - int loggerLevel = _logger.isTraceEnabled() - ? TRACE - : _logger.isDebugEnabled() - ? DEBUG - : _logger.isInfoEnabled() - ? INFO - : _logger.isWarnEnabled() - ? WARN - : ERROR; - if (loggerLevel <= level) - { - // Don't assume downstream handles argArray properly. - // Do it the SLF4J way here to eliminate that as a bug. - FormattingTuple ft = MessageFormatter.arrayFormat(msg, argArray); - _logger.log(marker, FQCN, level, ft.getMessage(), null, t); - } - } - } -} diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/JettyLogHandler.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/JettyLogHandler.java deleted file mode 100644 index c7cdcf8cf60..00000000000 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/JettyLogHandler.java +++ /dev/null @@ -1,198 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.text.MessageFormat; -import java.util.ResourceBundle; -import java.util.logging.Level; -import java.util.logging.LogManager; -import java.util.logging.LogRecord; -import java.util.regex.Pattern; - -/** - * Redirect java.util.logging events to Jetty Log - */ -public class JettyLogHandler extends java.util.logging.Handler -{ - public static void config() - { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - URL url = cl.getResource("logging.properties"); - if (url != null) - { - System.err.printf("Initializing java.util.logging from %s%n", url); - try (InputStream in = url.openStream()) - { - LogManager.getLogManager().readConfiguration(in); - } - catch (IOException e) - { - e.printStackTrace(System.err); - } - } - else - { - System.err.printf("WARNING: java.util.logging failed to initialize: logging.properties not found%n"); - } - - System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Jdk14Logger"); - } - - public JettyLogHandler() - { - if (Boolean.parseBoolean(Log.getProperty("org.eclipse.jetty.util.log.DEBUG", "false"))) - { - setLevel(Level.FINEST); - } - - if (Boolean.parseBoolean(Log.getProperty("org.eclipse.jetty.util.log.IGNORED", "false"))) - { - setLevel(Level.ALL); - } - - System.err.printf("%s Initialized at level [%s]%n", this.getClass().getName(), getLevel().getName()); - } - - private synchronized String formatMessage(LogRecord record) - { - String msg = getMessage(record); - - try - { - Object[] params = record.getParameters(); - if ((params == null) || (params.length == 0)) - { - return msg; - } - - if (Pattern.compile("\\{\\d+\\}").matcher(msg).find()) - { - return MessageFormat.format(msg, params); - } - - return msg; - } - catch (Exception ex) - { - return msg; - } - } - - private String getMessage(LogRecord record) - { - ResourceBundle bundle = record.getResourceBundle(); - if (bundle != null) - { - try - { - return bundle.getString(record.getMessage()); - } - catch (java.util.MissingResourceException ignored) - { - } - } - - return record.getMessage(); - } - - @Override - public void publish(LogRecord record) - { - org.eclipse.jetty.util.log.Logger jettyLogger = getJettyLogger(record.getLoggerName()); - - int level = record.getLevel().intValue(); - if (level >= Level.OFF.intValue()) - { - // nothing to log, skip it. - return; - } - - Throwable cause = record.getThrown(); - String msg = formatMessage(record); - - if (level >= Level.WARNING.intValue()) - { - // log at warn - if (cause != null) - { - jettyLogger.warn(msg, cause); - } - else - { - jettyLogger.warn(msg); - } - return; - } - - if (level >= Level.INFO.intValue()) - { - // log at info - if (cause != null) - { - jettyLogger.info(msg, cause); - } - else - { - jettyLogger.info(msg); - } - return; - } - - if (level >= Level.FINEST.intValue()) - { - // log at debug - if (cause != null) - { - jettyLogger.debug(msg, cause); - } - else - { - jettyLogger.debug(msg); - } - return; - } - - if (level >= Level.ALL.intValue()) - { - // only corresponds with ignore (in jetty speak) - jettyLogger.ignore(cause); - return; - } - } - - private Logger getJettyLogger(String loggerName) - { - return org.eclipse.jetty.util.log.Log.getLogger(loggerName); - } - - @Override - public void flush() - { - // ignore - } - - @Override - public void close() throws SecurityException - { - // ignore - } -} diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java index 756076c2743..2491f058438 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java @@ -18,296 +18,45 @@ package org.eclipse.jetty.util.log; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Method; -import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Collections; -import java.util.Enumeration; -import java.util.Locale; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - -import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.Uptime; -import org.eclipse.jetty.util.annotation.ManagedAttribute; +import org.slf4j.LoggerFactory; /** - * Logging. - * This class provides a static logging interface. If an instance of the - * org.slf4j.Logger class is found on the classpath, the static log methods - * are directed to a slf4j logger for "org.eclipse.log". Otherwise the logs - * are directed to stderr. - *

- * The "org.eclipse.jetty.util.log.class" system property can be used - * to select a specific logging implementation. - *

- * If the system property org.eclipse.jetty.util.log.IGNORED is set, - * then ignored exceptions are logged in detail. + * Legacy bridge API to Slf4j * - * @see StdErrLog - * @see Slf4jLog + * @deprecated */ public class Log { - public static final String EXCEPTION = "EXCEPTION "; - public static final String IGNORED = "IGNORED EXCEPTION "; - /** - * The {@link Logger} implementation class name - */ - public static String __logClass; - /** - * Legacy flag indicating if {@link Logger#ignore(Throwable)} methods produce any output in the {@link Logger}s - */ - public static boolean __ignored; - /** - * Logging Configuration Properties - */ - protected static final Properties PROPS = new Properties(); - private static final ConcurrentMap LOGGERS = new ConcurrentHashMap<>(); - private static boolean __initialized; - private static Logger LOG; + @Deprecated + public static final String EXCEPTION = "EXCEPTION"; - static + @Deprecated + public static org.eclipse.jetty.util.log.Logger getLogger(Class clazz) { - AccessController.doPrivileged(new PrivilegedAction() - { - @Override - public Object run() - { - // First see if the jetty-logging.properties object exists in the classpath. - // * This is an optional feature used by embedded mode use, and test cases to allow for early - // * configuration of the Log class in situations where access to the System.properties are - // * either too late or just impossible. - loadProperties("jetty-logging.properties", PROPS); - - // Next see if an OS specific jetty-logging.properties object exists in the classpath. - // This really for setting up test specific logging behavior based on OS. - String osName = System.getProperty("os.name"); - if (osName != null && osName.length() > 0) - { - // NOTE: cannot use jetty-util's StringUtil.replace() as it may initialize logging itself. - osName = osName.toLowerCase(Locale.ENGLISH).replace(' ', '-'); - loadProperties("jetty-logging-" + osName + ".properties", PROPS); - } - - // Now load the System.properties as-is into the __props, - // these values will override any key conflicts in __props. - @SuppressWarnings("unchecked") - Enumeration systemKeyEnum = (Enumeration)System.getProperties().propertyNames(); - while (systemKeyEnum.hasMoreElements()) - { - String key = systemKeyEnum.nextElement(); - String val = System.getProperty(key); - // Protect against application code insertion of non-String values (returned as null). - if (val != null) - PROPS.setProperty(key, val); - } - - // Now use the configuration properties to configure the Log statics. - __logClass = PROPS.getProperty("org.eclipse.jetty.util.log.class", "org.eclipse.jetty.util.log.Slf4jLog"); - __ignored = Boolean.parseBoolean(PROPS.getProperty("org.eclipse.jetty.util.log.IGNORED", "false")); - return null; - } - }); + return new Slf4jLogger(LoggerFactory.getLogger(clazz)); } - private static void loadProperties(String resourceName, Properties props) + @Deprecated + public static org.eclipse.jetty.util.log.Logger getLogger(String name) { - URL testProps = Loader.getResource(resourceName); - if (testProps != null) - { - try (InputStream in = testProps.openStream()) - { - Properties p = new Properties(); - p.load(in); - for (Object key : p.keySet()) - { - Object value = p.get(key); - if (value != null) - props.put(key, value); - } - } - catch (IOException e) - { - System.err.println("[WARN] Error loading logging config: " + testProps); - e.printStackTrace(); - } - } + return new Slf4jLogger(LoggerFactory.getLogger(name)); } - public static void initialized() + @Deprecated + public static org.eclipse.jetty.util.log.Logger getRootLogger() { - synchronized (Log.class) - { - if (__initialized) - return; - __initialized = true; - - boolean announce = Boolean.parseBoolean(PROPS.getProperty("org.eclipse.jetty.util.log.announce", "true")); - try - { - Class logClass = Loader.loadClass(Log.class, __logClass); - if (LOG == null || !LOG.getClass().equals(logClass)) - { - LOG = (Logger)logClass.getDeclaredConstructor().newInstance(); - if (announce) - LOG.debug("Logging to {} via {}", LOG, logClass.getName()); - } - } - catch (Throwable e) - { - // Unable to load specified Logger implementation, default to standard logging. - initStandardLogging(e); - } - - if (announce && LOG != null) - LOG.info(String.format("Logging initialized @%dms to %s", Uptime.getUptime(), LOG.getClass().getName())); - } + return new Slf4jLogger(LoggerFactory.getLogger("")); } - private static void initStandardLogging(Throwable e) + @Deprecated + public static org.eclipse.jetty.util.log.Logger getLog() { - if (__ignored) - e.printStackTrace(); - - if (LOG == null) - LOG = new StdErrLog(); + return getRootLogger(); } - public static Logger getLog() + @Deprecated + public static void setLog(org.eclipse.jetty.util.log.Logger log) { - initialized(); - return LOG; - } - - /** - * Set the root logger. - *

- * Note that if any classes have statically obtained their logger instance prior to this call, their Logger will not - * be affected by this call. - * - * @param log the root logger implementation to set - */ - public static void setLog(Logger log) - { - Log.LOG = log; - __logClass = null; - } - - /** - * Get the root logger. - * - * @return the root logger - */ - public static Logger getRootLogger() - { - initialized(); - return LOG; - } - - static boolean isIgnored() - { - return __ignored; - } - - /** - * Set Log to parent Logger. - *

- * If there is a different Log class available from a parent classloader, - * call {@link #getLogger(String)} on it and construct a {@link LoggerLog} instance - * as this Log's Logger, so that logging is delegated to the parent Log. - *

- * This should be used if a webapp is using Log, but wishes the logging to be - * directed to the containers log. - *

- * If there is not parent Log, then this call is equivalent to

-     *   Log.setLog(Log.getLogger(name));
-     * 
- * - * @param name Logger name - */ - public static void setLogToParent(String name) - { - ClassLoader loader = Log.class.getClassLoader(); - if (loader != null && loader.getParent() != null) - { - try - { - Class uberlog = loader.getParent().loadClass("org.eclipse.jetty.util.log.Log"); - Method getLogger = uberlog.getMethod("getLogger", new Class[]{String.class}); - Object logger = getLogger.invoke(null, name); - setLog(new LoggerLog(logger)); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - else - { - setLog(getLogger(name)); - } - } - - /** - * Obtain a named Logger based on the fully qualified class name. - * - * @param clazz the class to base the Logger name off of - * @return the Logger with the given name - */ - public static Logger getLogger(Class clazz) - { - return getLogger(clazz.getName()); - } - - /** - * Obtain a named Logger or the default Logger if null is passed. - * - * @param name the Logger name - * @return the Logger with the given name - */ - public static Logger getLogger(String name) - { - initialized(); - - if (name == null) - return LOG; - - Logger logger = LOGGERS.get(name); - if (logger == null) - logger = LOG.getLogger(name); - - return logger; - } - - static ConcurrentMap getMutableLoggers() - { - return LOGGERS; - } - - /** - * Get a map of all configured {@link Logger} instances. - * - * @return a map of all configured {@link Logger} instances - */ - @ManagedAttribute("list of all instantiated loggers") - public static Map getLoggers() - { - return Collections.unmodifiableMap(LOGGERS); - } - - public static Properties getProperties() - { - return PROPS; - } - - public static String getProperty(String key, String defaultValue) - { - return PROPS.getProperty(key, defaultValue); + // does nothing } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Logger.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Logger.java index 6def16bb013..928d30507fe 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Logger.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Logger.java @@ -19,8 +19,11 @@ package org.eclipse.jetty.util.log; /** - * A simple logging facade that is intended simply to capture the style of logging as used by Jetty. + * Legacy Bridge API to Slf4j + * + * @deprecated */ +@Deprecated public interface Logger { /** diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/LoggerLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/LoggerLog.java deleted file mode 100644 index 5cc57fcdb48..00000000000 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/LoggerLog.java +++ /dev/null @@ -1,243 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.lang.reflect.Method; - -/** - * - */ -public class LoggerLog extends AbstractLogger -{ - private final Object _logger; - private final Method _debugMT; - private final Method _debugMAA; - private final Method _infoMT; - private final Method _infoMAA; - private final Method _warnMT; - private final Method _warnMAA; - private final Method _setDebugEnabledE; - private final Method _getLoggerN; - private final Method _getName; - private volatile boolean _debug; - - public LoggerLog(Object logger) - { - try - { - _logger = logger; - final Class lc = logger.getClass(); - _debugMT = lc.getMethod("debug", new Class[]{String.class, Throwable.class}); - _debugMAA = lc.getMethod("debug", new Class[]{String.class, Object[].class}); - _infoMT = lc.getMethod("info", new Class[]{String.class, Throwable.class}); - _infoMAA = lc.getMethod("info", new Class[]{String.class, Object[].class}); - _warnMT = lc.getMethod("warn", new Class[]{String.class, Throwable.class}); - _warnMAA = lc.getMethod("warn", new Class[]{String.class, Object[].class}); - final Method isDebugEnabled = lc.getMethod("isDebugEnabled"); - _setDebugEnabledE = lc.getMethod("setDebugEnabled", new Class[]{Boolean.TYPE}); - _getLoggerN = lc.getMethod("getLogger", new Class[]{String.class}); - _getName = lc.getMethod("getName"); - - _debug = (Boolean)isDebugEnabled.invoke(_logger); - } - catch (Exception x) - { - throw new IllegalStateException(x); - } - } - - @Override - public String getName() - { - try - { - return (String)_getName.invoke(_logger); - } - catch (Exception e) - { - e.printStackTrace(); - return null; - } - } - - @Override - public void warn(String msg, Object... args) - { - try - { - _warnMAA.invoke(_logger, args); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - @Override - public void warn(Throwable thrown) - { - warn("", thrown); - } - - @Override - public void warn(String msg, Throwable thrown) - { - try - { - _warnMT.invoke(_logger, msg, thrown); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - @Override - public void info(String msg, Object... args) - { - try - { - _infoMAA.invoke(_logger, args); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - @Override - public void info(Throwable thrown) - { - info("", thrown); - } - - @Override - public void info(String msg, Throwable thrown) - { - try - { - _infoMT.invoke(_logger, msg, thrown); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - @Override - public boolean isDebugEnabled() - { - return _debug; - } - - @Override - public void setDebugEnabled(boolean enabled) - { - try - { - _setDebugEnabledE.invoke(_logger, enabled); - _debug = enabled; - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - @Override - public void debug(String msg, Object... args) - { - if (!_debug) - return; - - try - { - _debugMAA.invoke(_logger, args); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - @Override - public void debug(Throwable thrown) - { - debug("", thrown); - } - - @Override - public void debug(String msg, Throwable th) - { - if (!_debug) - return; - - try - { - _debugMT.invoke(_logger, msg, th); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - @Override - public void debug(String msg, long value) - { - if (!_debug) - return; - - try - { - _debugMAA.invoke(_logger, new Object[]{value}); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - @Override - public void ignore(Throwable ignored) - { - if (Log.isIgnored()) - { - debug(Log.IGNORED, ignored); - } - } - - /** - * Create a Child Logger of this Logger. - */ - @Override - protected Logger newLogger(String fullname) - { - try - { - Object logger = _getLoggerN.invoke(_logger, fullname); - return new LoggerLog(logger); - } - catch (Exception e) - { - e.printStackTrace(); - return this; - } - } -} diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java deleted file mode 100644 index 51a5cfc618f..00000000000 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java +++ /dev/null @@ -1,152 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -/** - * Slf4jLog Logger - */ -public class Slf4jLog extends AbstractLogger -{ - private final org.slf4j.Logger _logger; - - public Slf4jLog() throws Exception - { - this("org.eclipse.jetty.util.log"); - } - - public Slf4jLog(String name) - { - //NOTE: if only an slf4j-api jar is on the classpath, slf4j will use a NOPLogger - org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(name); - - // Fix LocationAwareLogger use to indicate FQCN of this class - - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=276670 - if (logger instanceof org.slf4j.spi.LocationAwareLogger) - { - _logger = new JettyAwareLogger((org.slf4j.spi.LocationAwareLogger)logger); - } - else - { - _logger = logger; - } - } - - @Override - public String getName() - { - return _logger.getName(); - } - - @Override - public void warn(String msg, Object... args) - { - _logger.warn(msg, args); - } - - @Override - public void warn(Throwable thrown) - { - warn("", thrown); - } - - @Override - public void warn(String msg, Throwable thrown) - { - _logger.warn(msg, thrown); - } - - @Override - public void info(String msg, Object... args) - { - _logger.info(msg, args); - } - - @Override - public void info(Throwable thrown) - { - info("", thrown); - } - - @Override - public void info(String msg, Throwable thrown) - { - _logger.info(msg, thrown); - } - - @Override - public void debug(String msg, Object... args) - { - _logger.debug(msg, args); - } - - @Override - public void debug(String msg, long arg) - { - if (isDebugEnabled()) - _logger.debug(msg, new Object[]{arg}); - } - - @Override - public void debug(Throwable thrown) - { - debug("", thrown); - } - - @Override - public void debug(String msg, Throwable thrown) - { - _logger.debug(msg, thrown); - } - - @Override - public boolean isDebugEnabled() - { - return _logger.isDebugEnabled(); - } - - @Override - public void setDebugEnabled(boolean enabled) - { - warn("setDebugEnabled not implemented", null, null); - } - - /** - * Create a Child Logger of this Logger. - */ - @Override - protected Logger newLogger(String fullname) - { - return new Slf4jLog(fullname); - } - - @Override - public void ignore(Throwable ignored) - { - if (Log.isIgnored()) - { - debug(Log.IGNORED, ignored); - } - } - - @Override - public String toString() - { - return _logger.toString(); - } -} diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLogger.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLogger.java new file mode 100644 index 00000000000..95d966ba856 --- /dev/null +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLogger.java @@ -0,0 +1,123 @@ +// +// ======================================================================== +// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. +// +// This program and the accompanying materials are made available under +// the terms of the Eclipse Public License 2.0 which is available at +// https://www.eclipse.org/legal/epl-2.0 +// +// This Source Code may also be made available under the following +// Secondary Licenses when the conditions for such availability set +// forth in the Eclipse Public License, v. 2.0 are satisfied: +// the Apache License v2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0 +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// ======================================================================== +// + +package org.eclipse.jetty.util.log; + +import org.slf4j.LoggerFactory; + +@Deprecated +class Slf4jLogger implements org.eclipse.jetty.util.log.Logger +{ + private final org.slf4j.Logger logger; + + Slf4jLogger(org.slf4j.Logger logger) + { + this.logger = logger; + } + + @Override + public void debug(String format, Object... args) + { + logger.debug(format, args); + } + + @Override + public void debug(String msg, long value) + { + logger.debug(msg, value); + } + + @Override + public void debug(Throwable cause) + { + logger.debug(cause.getMessage(), cause); + } + + @Override + public void debug(String msg, Throwable thrown) + { + logger.debug(msg, thrown); + } + + @Override + public org.eclipse.jetty.util.log.Logger getLogger(String name) + { + return new Slf4jLogger(LoggerFactory.getLogger(getName() + name)); + } + + @Override + public void ignore(Throwable cause) + { + logger.trace("IGNORED", cause); + } + + @Override + public void info(String format, Object... args) + { + logger.info(format, args); + } + + @Override + public void info(Throwable cause) + { + logger.info(cause.getMessage(), cause); + } + + @Override + public void info(String msg, Throwable thrown) + { + logger.info(msg, thrown); + } + + @Override + public boolean isDebugEnabled() + { + return logger.isDebugEnabled(); + } + + @Override + @Deprecated + public void setDebugEnabled(boolean enabled) + { + // NOT SUPPORTED + } + + @Override + public void warn(Throwable cause) + { + logger.warn(cause.getMessage(), cause); + } + + @Override + public void warn(String msg, Throwable cause) + { + logger.warn(msg, cause); + } + + @Override + public String getName() + { + return logger.getName(); + } + + @Override + public void warn(String format, Object... args) + { + logger.warn(format, args); + } +} diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/StacklessLogging.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/StacklessLogging.java deleted file mode 100644 index d51bba04a0e..00000000000 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/StacklessLogging.java +++ /dev/null @@ -1,86 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.util.HashSet; -import java.util.Set; - -/** - * A try-with-resources compatible layer for {@link StdErrLog#setHideStacks(boolean) hiding stacktraces} within the scope of the try block when - * logging with {@link StdErrLog} implementation. - *

- * Use of other logging implementation cause no effect when using this class - *

- * Example: - * - *

- * try (StacklessLogging scope = new StacklessLogging(EventDriver.class,Noisy.class))
- * {
- *     doActionThatCausesStackTraces();
- * }
- * 
- */ -public class StacklessLogging implements AutoCloseable -{ - private final Set squelched = new HashSet<>(); - - public StacklessLogging(Class... classesToSquelch) - { - for (Class clazz : classesToSquelch) - { - Logger log = Log.getLogger(clazz); - // only operate on loggers that are of type StdErrLog - if (log instanceof StdErrLog && !log.isDebugEnabled()) - { - StdErrLog stdErrLog = ((StdErrLog)log); - if (!stdErrLog.isHideStacks()) - { - stdErrLog.setHideStacks(true); - squelched.add(stdErrLog); - } - } - } - } - - public StacklessLogging(Logger... logs) - { - for (Logger log : logs) - { - // only operate on loggers that are of type StdErrLog - if (log instanceof StdErrLog && !log.isDebugEnabled()) - { - StdErrLog stdErrLog = ((StdErrLog)log); - if (!stdErrLog.isHideStacks()) - { - stdErrLog.setHideStacks(true); - squelched.add(stdErrLog); - } - } - } - } - - @Override - public void close() - { - for (StdErrLog log : squelched) - { - log.setHideStacks(false); - } - } -} diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java deleted file mode 100644 index b1dc543745c..00000000000 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java +++ /dev/null @@ -1,688 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.io.PrintStream; -import java.security.AccessControlException; -import java.util.Properties; - -import org.eclipse.jetty.util.DateCache; -import org.eclipse.jetty.util.annotation.ManagedAttribute; -import org.eclipse.jetty.util.annotation.ManagedObject; - -/** - * StdErr Logging implementation. - *

- * A Jetty {@link Logger} that sends all logs to STDERR ({@link System#err}) with basic formatting. - *

- * Supports named loggers, and properties based configuration. - *

- * Configuration Properties: - *

- *
${name|hierarchy}.LEVEL=(ALL|DEBUG|INFO|WARN|OFF)
- *
- * Sets the level that the Logger should log at.
- * Names can be a package name, or a fully qualified class name.
- * Default: INFO
- *
- * Examples: - *
- *
org.eclipse.jetty.LEVEL=WARN
- *
indicates that all of the jetty specific classes, in any package that - * starts with org.eclipse.jetty should log at level WARN.
- *
org.eclipse.jetty.io.ChannelEndPoint.LEVEL=ALL
- *
indicates that the specific class, ChannelEndPoint, should log all - * logging events that it can generate, including DEBUG, INFO, WARN (and even special - * internally ignored exception cases).
- *
- *
- * - *
${name}.SOURCE=(true|false)
- *
- * Logger specific, attempt to print the java source file name and line number - * where the logging event originated from.
- * Name must be a fully qualified class name (package name hierarchy is not supported - * by this configurable)
- * Warning: this is a slow operation and will have an impact on performance!
- * Default: false - *
- * - *
${name}.STACKS=(true|false)
- *
- * Logger specific, control the display of stacktraces.
- * Name must be a fully qualified class name (package name hierarchy is not supported - * by this configurable)
- * Default: true - *
- * - *
org.eclipse.jetty.util.log.stderr.SOURCE=(true|false)
- *
Special Global Configuration, attempt to print the java source file name and line number - * where the logging event originated from.
- * Default: false - *
- * - *
org.eclipse.jetty.util.log.stderr.LONG=(true|false)
- *
Special Global Configuration, when true, output logging events to STDERR using - * long form, fully qualified class names. when false, use abbreviated package names
- * Default: false - *
- *
org.eclipse.jetty.util.log.stderr.ESCAPE=(true|false)
- *
Global Configuration, when true output logging events to STDERR are always - * escaped so that control characters are replaced with '?"; '\r' with '<' and '\n' replaced '|'
- * Default: true - *
- *
- */ -@ManagedObject("Jetty StdErr Logging Implementation") -public class StdErrLog extends AbstractLogger -{ - private static final String EOL = System.lineSeparator(); - private static final Object[] EMPTY_ARGS = new Object[0]; - // Do not change output format lightly, people rely on this output format now. - private static int __threadNamePadding = Integer.parseInt(Log.getProperty("org.eclipse.jetty.util.log.StdErrLog.TAG_PAD", "0")); - private static DateCache _dateCache; - - private static final boolean SOURCE = Boolean.parseBoolean( - Log.getProperty("org.eclipse.jetty.util.log.SOURCE", - Log.getProperty("org.eclipse.jetty.util.log.stderr.SOURCE", "false"))); - private static final boolean LONG_CLASSNAMES = Boolean.parseBoolean(Log.getProperty("org.eclipse.jetty.util.log.stderr.LONG", "false")); - private static final boolean ESCAPE_CONTROL_CHARS = Boolean.parseBoolean(Log.getProperty("org.eclipse.jetty.util.log.stderr.ESCAPE", "true")); - - static - { - try - { - _dateCache = new DateCache("yyyy-MM-dd HH:mm:ss"); - } - catch (Exception x) - { - x.printStackTrace(System.err); - } - } - - public static void setTagPad(int pad) - { - __threadNamePadding = pad; - } - - private int _level; - // Level that this Logger was configured as (remembered in special case of .setDebugEnabled()) - private int _configuredLevel; - // The alternate stream to print to (if set) - private PrintStream _altStream; - private boolean _source; - // Print the long form names, otherwise use abbreviated - private boolean _printLongNames = LONG_CLASSNAMES; - // The full log name, as provided by the system. - private final String _name; - // The abbreviated log name (used by default, unless _printLongNames is specified) - protected final String _abbrevname; - private boolean _hideStacks = false; - - public static int getLoggingLevel(Properties props, String name) - { - int level = lookupLoggingLevel(props, name); - if (level == LEVEL_DEFAULT) - { - level = lookupLoggingLevel(props, "log"); - if (level == LEVEL_DEFAULT) - level = LEVEL_INFO; - } - return level; - } - - /** - * Obtain a StdErrLog reference for the specified class, a convenience method used most often during testing to allow for control over a specific logger. - *

- * Must be actively using StdErrLog as the Logger implementation. - * - * @param clazz the Class reference for the logger to use. - * @return the StdErrLog logger - * @throws RuntimeException if StdErrLog is not the active Logger implementation. - */ - public static StdErrLog getLogger(Class clazz) - { - Logger log = Log.getLogger(clazz); - if (log instanceof StdErrLog) - { - return (StdErrLog)log; - } - throw new RuntimeException("Logger for " + clazz + " is not of type StdErrLog"); - } - - /** - * Construct an anonymous StdErrLog (no name). - *

- * NOTE: Discouraged usage! - */ - public StdErrLog() - { - this(null); - } - - /** - * Construct a named StdErrLog using the {@link Log} defined properties - * - * @param name the name of the logger - */ - public StdErrLog(String name) - { - this(name, null); - } - - /** - * Construct a named Logger using the provided properties to configure logger. - * - * @param name the name of the logger - * @param props the configuration properties - */ - public StdErrLog(String name, Properties props) - { - @SuppressWarnings("ReferenceEquality") - boolean sameObject = (props != Log.PROPS); - if (props != null && sameObject) - Log.PROPS.putAll(props); - _name = name == null ? "" : name; - _abbrevname = condensePackageString(this._name); - _level = getLoggingLevel(Log.PROPS, this._name); - _configuredLevel = _level; - - try - { - String source = getLoggingProperty(Log.PROPS, _name, "SOURCE"); - _source = source == null ? SOURCE : Boolean.parseBoolean(source); - } - catch (AccessControlException ace) - { - _source = SOURCE; - } - - try - { - // allow stacktrace display to be controlled by properties as well - String stacks = getLoggingProperty(Log.PROPS, _name, "STACKS"); - _hideStacks = stacks != null && !Boolean.parseBoolean(stacks); - } - catch (AccessControlException ignore) - { - /* ignore */ - } - } - - @Override - public String getName() - { - return _name; - } - - public void setPrintLongNames(boolean printLongNames) - { - this._printLongNames = printLongNames; - } - - public boolean isPrintLongNames() - { - return this._printLongNames; - } - - public boolean isHideStacks() - { - return _hideStacks; - } - - public void setHideStacks(boolean hideStacks) - { - _hideStacks = hideStacks; - } - - /** - * Is the source of a log, logged - * - * @return true if the class, method, file and line number of a log is logged. - */ - public boolean isSource() - { - return _source; - } - - /** - * Set if a log source is logged. - * - * @param source true if the class, method, file and line number of a log is logged. - */ - public void setSource(boolean source) - { - _source = source; - } - - @Override - public void warn(String msg, Object... args) - { - if (_level <= LEVEL_WARN) - { - StringBuilder builder = new StringBuilder(64); - format(builder, ":WARN:", msg, args); - println(builder); - } - } - - @Override - public void warn(Throwable thrown) - { - warn("", thrown); - } - - @Override - public void warn(String msg, Throwable thrown) - { - if (_level <= LEVEL_WARN) - { - StringBuilder builder = new StringBuilder(64); - format(builder, ":WARN:", msg, thrown); - println(builder); - } - } - - @Override - public void info(String msg, Object... args) - { - if (_level <= LEVEL_INFO) - { - StringBuilder builder = new StringBuilder(64); - format(builder, ":INFO:", msg, args); - println(builder); - } - } - - @Override - public void info(Throwable thrown) - { - info("", thrown); - } - - @Override - public void info(String msg, Throwable thrown) - { - if (_level <= LEVEL_INFO) - { - StringBuilder builder = new StringBuilder(64); - format(builder, ":INFO:", msg, thrown); - println(builder); - } - } - - @ManagedAttribute("is debug enabled for root logger Log.LOG") - @Override - public boolean isDebugEnabled() - { - return (_level <= LEVEL_DEBUG); - } - - /** - * Legacy interface where a programmatic configuration of the logger level - * is done as a wholesale approach. - */ - @Override - public void setDebugEnabled(boolean enabled) - { - int level = enabled ? LEVEL_DEBUG : this.getConfiguredLevel(); - this.setLevel(level); - - String name = getName(); - for (Logger log : Log.getLoggers().values()) - { - if (log.getName().startsWith(name) && log instanceof StdErrLog) - { - StdErrLog logger = (StdErrLog)log; - level = enabled ? LEVEL_DEBUG : logger.getConfiguredLevel(); - logger.setLevel(level); - } - } - } - - private int getConfiguredLevel() - { - return _configuredLevel; - } - - public int getLevel() - { - return _level; - } - - /** - * Set the level for this logger. - *

- * Available values ({@link StdErrLog#LEVEL_ALL}, {@link StdErrLog#LEVEL_DEBUG}, {@link StdErrLog#LEVEL_INFO}, - * {@link StdErrLog#LEVEL_WARN}) - * - * @param level the level to set the logger to - */ - public void setLevel(int level) - { - this._level = level; - } - - /** - * The alternate stream to use for STDERR. - * - * @param stream the stream of choice, or {@code null} to use {@link System#err} - */ - public void setStdErrStream(PrintStream stream) - { - this._altStream = stream; - } - - @Override - public void debug(String msg, Object... args) - { - if (isDebugEnabled()) - { - StringBuilder builder = new StringBuilder(64); - format(builder, ":DBUG:", msg, args); - println(builder); - } - } - - @Override - public void debug(String msg, long arg) - { - if (isDebugEnabled()) - { - StringBuilder builder = new StringBuilder(64); - format(builder, ":DBUG:", msg, arg); - println(builder); - } - } - - @Override - public void debug(Throwable thrown) - { - debug("", thrown); - } - - @Override - public void debug(String msg, Throwable thrown) - { - if (isDebugEnabled()) - { - StringBuilder builder = new StringBuilder(64); - format(builder, ":DBUG:", msg, thrown); - println(builder); - } - } - - private void println(StringBuilder builder) - { - if (_altStream != null) - _altStream.println(builder); - else - { - // We always use the PrintStream stored in System.err, - // just in case someone has replaced it with a call to System.setErr(PrintStream) - System.err.println(builder); - } - } - - private void format(StringBuilder builder, String level, String msg, Object... inArgs) - { - long now = System.currentTimeMillis(); - int ms = (int)(now % 1000); - String d = _dateCache.formatNow(now); - tag(builder, d, ms, level); - - Object[] msgArgs = EMPTY_ARGS; - int msgArgsLen = 0; - Throwable cause = null; - - if (inArgs != null) - { - msgArgs = inArgs; - msgArgsLen = inArgs.length; - if (msgArgsLen > 0 && inArgs[msgArgsLen - 1] instanceof Throwable) - { - cause = (Throwable)inArgs[msgArgsLen - 1]; - msgArgsLen--; - } - } - - if (msg == null) - { - msg = "{} ".repeat(msgArgsLen); - } - String braces = "{}"; - int start = 0; - for (int i = 0; i < msgArgsLen; i++) - { - Object arg = msgArgs[i]; - int bracesIndex = msg.indexOf(braces, start); - if (bracesIndex < 0) - { - escape(builder, msg.substring(start)); - builder.append(" "); - if (arg != null) - builder.append(arg); - start = msg.length(); - } - else - { - escape(builder, msg.substring(start, bracesIndex)); - if (arg != null) - builder.append(arg); - start = bracesIndex + braces.length(); - } - } - escape(builder, msg.substring(start)); - - if (cause != null) - { - if (isHideStacks()) - { - builder.append(": ").append(cause); - } - else - { - formatCause(builder, cause, ""); - } - } - } - - private void formatCause(StringBuilder builder, Throwable cause, String indent) - { - builder.append(EOL).append(indent); - escape(builder, cause.toString()); - StackTraceElement[] elements = cause.getStackTrace(); - for (int i = 0; elements != null && i < elements.length; i++) - { - builder.append(EOL).append(indent).append("\tat "); - escape(builder, elements[i].toString()); - } - - for (Throwable suppressed : cause.getSuppressed()) - { - builder.append(EOL).append(indent).append("Suppressed: "); - formatCause(builder, suppressed, "\t|" + indent); - } - - Throwable by = cause.getCause(); - if (by != null && by != cause) - { - builder.append(EOL).append(indent).append("Caused by: "); - formatCause(builder, by, indent); - } - } - - private void escape(StringBuilder builder, String str) - { - if (ESCAPE_CONTROL_CHARS) - { - for (int i = 0; i < str.length(); ++i) - { - char c = str.charAt(i); - if (Character.isISOControl(c)) - { - if (c == '\n') - { - builder.append('|'); - } - else if (c == '\r') - { - builder.append('<'); - } - else - { - builder.append('?'); - } - } - else - { - builder.append(c); - } - } - } - else - builder.append(str); - } - - private void tag(StringBuilder builder, String d, int ms, String tag) - { - builder.setLength(0); - builder.append(d); - if (ms > 99) - { - builder.append('.'); - } - else if (ms > 9) - { - builder.append(".0"); - } - else - { - builder.append(".00"); - } - builder.append(ms).append(tag); - - String name = _printLongNames ? _name : _abbrevname; - String tname = Thread.currentThread().getName(); - - int p = __threadNamePadding > 0 ? (name.length() + tname.length() - __threadNamePadding) : 0; - - if (p < 0) - { - builder - .append(name) - .append(':') - .append(" ", 0, -p) - .append(tname); - } - else if (p == 0) - { - builder.append(name).append(':').append(tname); - } - builder.append(':'); - - if (_source) - { - Throwable source = new Throwable(); - StackTraceElement[] frames = source.getStackTrace(); - for (final StackTraceElement frame : frames) - { - String clazz = frame.getClassName(); - if (clazz.equals(StdErrLog.class.getName()) || clazz.equals(Log.class.getName())) - { - continue; - } - if (!_printLongNames && clazz.startsWith("org.eclipse.jetty.")) - { - builder.append(condensePackageString(clazz)); - } - else - { - builder.append(clazz); - } - builder.append('#').append(frame.getMethodName()); - if (frame.getFileName() != null) - { - builder.append('(').append(frame.getFileName()).append(':').append(frame.getLineNumber()).append(')'); - } - builder.append(':'); - break; - } - } - - builder.append(' '); - } - - /** - * Create a Child Logger of this Logger. - */ - @Override - protected Logger newLogger(String fullname) - { - StdErrLog logger = new StdErrLog(fullname); - // Preserve configuration for new loggers configuration - logger.setPrintLongNames(_printLongNames); - logger._altStream = this._altStream; - - // Force the child to have any programmatic configuration - if (_level != _configuredLevel) - logger._level = _level; - - return logger; - } - - @Override - public String toString() - { - StringBuilder s = new StringBuilder(); - s.append("StdErrLog:"); - s.append(_name); - s.append(":LEVEL="); - switch (_level) - { - case LEVEL_ALL: - s.append("ALL"); - break; - case LEVEL_DEBUG: - s.append("DEBUG"); - break; - case LEVEL_INFO: - s.append("INFO"); - break; - case LEVEL_WARN: - s.append("WARN"); - break; - default: - s.append("?"); - break; - } - return s.toString(); - } - - @Override - public void ignore(Throwable ignored) - { - if (_level <= LEVEL_ALL) - { - StringBuilder builder = new StringBuilder(64); - format(builder, ":IGNORED:", "", ignored); - println(builder); - } - } -} diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/component/LifeCycleListenerTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/component/LifeCycleListenerTest.java index e9f16cba8c4..8e0f7656391 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/component/LifeCycleListenerTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/component/LifeCycleListenerTest.java @@ -20,7 +20,7 @@ package org.eclipse.jetty.util.component; import java.util.concurrent.TimeUnit; -import org.eclipse.jetty.util.log.StacklessLogging; +import org.eclipse.jetty.logging.StacklessLogging; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Blue.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Blue.java deleted file mode 100644 index ee1409610d9..00000000000 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Blue.java +++ /dev/null @@ -1,32 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -public class Blue -{ - private static final Logger LOG = Log.getLogger(Blue.class); - - public void generateLogs() - { - LOG.debug("My color is {}", Blue.class.getSimpleName()); - LOG.info("I represent the emotion Admiration"); - LOG.warn("I can also mean Disgust"); - LOG.ignore(new RuntimeException("Yawn")); - } -} diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/CapturingJULHandler.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/CapturingJULHandler.java deleted file mode 100644 index bb6c4267c2f..00000000000 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/CapturingJULHandler.java +++ /dev/null @@ -1,87 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.logging.Handler; -import java.util.logging.LogRecord; - -import org.eclipse.jetty.util.IO; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; - -public class CapturingJULHandler extends Handler -{ - private static final String LN = System.getProperty("line.separator"); - private StringBuilder output = new StringBuilder(); - - @Override - public void publish(LogRecord record) - { - StringBuilder buf = new StringBuilder(); - buf.append(record.getLevel().getName()).append("|"); - buf.append(record.getLoggerName()).append("|"); - buf.append(record.getMessage()); - - output.append(buf); - if (record.getMessage().length() > 0) - { - output.append(LN); - } - - if (record.getThrown() != null) - { - StringWriter sw = new StringWriter(128); - PrintWriter capture = new PrintWriter(sw); - record.getThrown().printStackTrace(capture); - capture.flush(); - output.append(sw.toString()); - IO.close(capture); - } - } - - public void clear() - { - output.setLength(0); - } - - @Override - public void flush() - { - /* do nothing */ - } - - @Override - public void close() throws SecurityException - { - /* do nothing */ - } - - public void dump() - { - System.out.println(output); - } - - public void assertContainsLine(String line) - { - assertThat(output.toString(), containsString(line)); - } -} diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Green.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Green.java deleted file mode 100644 index fb929ee7987..00000000000 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Green.java +++ /dev/null @@ -1,32 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -public class Green -{ - private static final Logger LOG = Log.getLogger(Green.class); - - public void generateLogs() - { - LOG.debug("My color is {}", Green.class.getSimpleName()); - LOG.info("I represent the emotion Trust"); - LOG.warn("I can also mean Fear"); - LOG.ignore(new RuntimeException("Ick")); - } -} diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/JavaUtilLogTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/JavaUtilLogTest.java deleted file mode 100644 index 2d8d1a655b2..00000000000 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/JavaUtilLogTest.java +++ /dev/null @@ -1,243 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.logging.Handler; -import java.util.logging.Level; -import java.util.logging.LogManager; - -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - -public class JavaUtilLogTest -{ - private static Handler[] originalHandlers; - private static CapturingJULHandler jul; - - @BeforeAll - public static void setJUL() - { - LogManager lmgr = LogManager.getLogManager(); - java.util.logging.Logger root = lmgr.getLogger(""); - // Remember original handlers - originalHandlers = root.getHandlers(); - // Remove original handlers - for (Handler existing : originalHandlers) - { - root.removeHandler(existing); - } - // Set test/capturing handler - jul = new CapturingJULHandler(); - root.addHandler(jul); - } - - @AfterAll - public static void restoreJUL() - { - LogManager lmgr = LogManager.getLogManager(); - java.util.logging.Logger root = lmgr.getLogger(""); - // Remove test handlers - for (Handler existing : root.getHandlers()) - { - root.removeHandler(existing); - } - // Restore original handlers - for (Handler original : originalHandlers) - { - root.addHandler(original); - } - } - - @Test - public void testNamedLogger() - { - jul.clear(); - JavaUtilLog log = new JavaUtilLog("test"); - log.info("Info test"); - - jul.assertContainsLine("INFO|test|Info test"); - - JavaUtilLog loglong = new JavaUtilLog("test.a.long.name"); - loglong.info("Long test"); - - jul.assertContainsLine("INFO|test.a.long.name|Long test"); - } - - @Test - public void testDebugOutput() - { - jul.clear(); - - // Common Throwable (for test) - Throwable th = new Throwable("Message"); - - // Capture raw string form - StringWriter tout = new StringWriter(); - th.printStackTrace(new PrintWriter(tout)); - String ths = tout.toString(); - - // Tests - JavaUtilLog log = new JavaUtilLog("test.de.bug"); - setJulLevel("test.de.bug", Level.FINE); - - log.debug("Simple debug"); - log.debug("Debug with {} parameter", 1); - log.debug("Debug with {} {} parameters", 2, "spiffy"); - log.debug("Debug with throwable", th); - log.debug(th); - - // jul.dump(); - - jul.assertContainsLine("FINE|test.de.bug|Simple debug"); - jul.assertContainsLine("FINE|test.de.bug|Debug with 1 parameter"); - jul.assertContainsLine("FINE|test.de.bug|Debug with 2 spiffy parameters"); - jul.assertContainsLine("FINE|test.de.bug|Debug with throwable"); - jul.assertContainsLine(ths); - } - - @Test - public void testInfoOutput() - { - jul.clear(); - - // Common Throwable (for test) - Throwable th = new Throwable("Message"); - - // Capture raw string form - StringWriter tout = new StringWriter(); - th.printStackTrace(new PrintWriter(tout)); - String ths = tout.toString(); - - // Tests - JavaUtilLog log = new JavaUtilLog("test.in.fo"); - setJulLevel("test.in.fo", Level.INFO); - - log.info("Simple info"); - log.info("Info with {} parameter", 1); - log.info("Info with {} {} parameters", 2, "spiffy"); - log.info("Info with throwable", th); - log.info(th); - - // jul.dump(); - - jul.assertContainsLine("INFO|test.in.fo|Simple info"); - jul.assertContainsLine("INFO|test.in.fo|Info with 1 parameter"); - jul.assertContainsLine("INFO|test.in.fo|Info with 2 spiffy parameters"); - jul.assertContainsLine("INFO|test.in.fo|Info with throwable"); - jul.assertContainsLine(ths); - } - - @Test - public void testWarnOutput() - { - jul.clear(); - - // Common Throwable (for test) - Throwable th = new Throwable("Message"); - - // Capture raw string form - StringWriter tout = new StringWriter(); - th.printStackTrace(new PrintWriter(tout)); - String ths = tout.toString(); - - // Tests - JavaUtilLog log = new JavaUtilLog("test.wa.rn"); - setJulLevel("test.wa.rn", Level.WARNING); - - log.warn("Simple warn"); - log.warn("Warn with {} parameter", 1); - log.warn("Warn with {} {} parameters", 2, "spiffy"); - log.warn("Warn with throwable", th); - log.warn(th); - - // jul.dump(); - - jul.assertContainsLine("WARNING|test.wa.rn|Simple warn"); - jul.assertContainsLine("WARNING|test.wa.rn|Warn with 1 parameter"); - jul.assertContainsLine("WARNING|test.wa.rn|Warn with 2 spiffy parameters"); - jul.assertContainsLine("WARNING|test.wa.rn|Warn with throwable"); - jul.assertContainsLine(ths); - } - - @Test - public void testFormattingWithNulls() - { - jul.clear(); - - JavaUtilLog log = new JavaUtilLog("test.nu.ll"); - setJulLevel("test.nu.ll", Level.INFO); - - log.info("Testing info(msg,null,null) - {} {}", "arg0", "arg1"); - log.info("Testing info(msg,null,null) - {}/{}", null, null); - log.info("Testing info(msg,null,null) > {}", null, null); - log.info("Testing info(msg,null,null)", null, null); - log.info(null, "Testing", "info(null,arg0,arg1)"); - log.info(null, null, null); - - //jul.dump(); - - jul.assertContainsLine("INFO|test.nu.ll|Testing info(msg,null,null) - null/null"); - jul.assertContainsLine("INFO|test.nu.ll|Testing info(msg,null,null) > null null"); - jul.assertContainsLine("INFO|test.nu.ll|Testing info(msg,null,null) null null"); - jul.assertContainsLine("INFO|test.nu.ll|null Testing info(null,arg0,arg1)"); - jul.assertContainsLine("INFO|test.nu.ll|null null null"); - } - - @Test - public void testIsDebugEnabled() - { - JavaUtilLog log = new JavaUtilLog("test.legacy"); - - setJulLevel("test.legacy", Level.ALL); - assertThat("log.level(all).isDebugEnabled", log.isDebugEnabled(), is(true)); - - setJulLevel("test.legacy", Level.FINEST); - assertThat("log.level(finest).isDebugEnabled", log.isDebugEnabled(), is(true)); - - setJulLevel("test.legacy", Level.FINER); - assertThat("log.level(finer).isDebugEnabled", log.isDebugEnabled(), is(true)); - - setJulLevel("test.legacy", Level.FINE); - assertThat("log.level(fine).isDebugEnabled", log.isDebugEnabled(), is(true)); - - setJulLevel("test.legacy", Level.INFO); - assertThat("log.level(info).isDebugEnabled", log.isDebugEnabled(), is(false)); - - setJulLevel("test.legacy", Level.WARNING); - assertThat("log.level(warn).isDebugEnabled", log.isDebugEnabled(), is(false)); - - log.setDebugEnabled(true); - assertThat("log.isDebugEnabled", log.isDebugEnabled(), is(true)); - - log.setDebugEnabled(false); - assertThat("log.isDebugEnabled", log.isDebugEnabled(), is(false)); - } - - private void setJulLevel(String name, Level lvl) - { - java.util.logging.Logger log = java.util.logging.Logger.getLogger(name); - log.setLevel(lvl); - } -} diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java deleted file mode 100644 index ffc77ad0cff..00000000000 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java +++ /dev/null @@ -1,141 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.util.HashMap; -import java.util.Map; -import java.util.stream.Stream; - -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class LogTest -{ - // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck - private static Logger originalLogger; - private static Map originalLoggers; - - @BeforeAll - public static void rememberOriginalLogger() - { - originalLogger = Log.getLog(); - originalLoggers = new HashMap<>(Log.getLoggers()); - Log.getMutableLoggers().clear(); - } - - @AfterAll - public static void restoreOriginalLogger() - { - Log.setLog(originalLogger); - Log.getMutableLoggers().clear(); - Log.getMutableLoggers().putAll(originalLoggers); - } - - @Test - public void testDefaultLogging() - { - Logger log = Log.getLogger(LogTest.class); - log.info("Test default logging"); - } - - @Test - public void testNamedLogNamedStdErrLog() - { - Log.setLog(new StdErrLog()); - - assertNamedLogging(Red.class); - assertNamedLogging(Blue.class); - assertNamedLogging(Green.class); - } - - @Test - public void testNamedLogNamedJUL() - { - Log.setLog(new JavaUtilLog()); - - assertNamedLogging(Red.class); - assertNamedLogging(Blue.class); - assertNamedLogging(Green.class); - } - - @Test - public void testNamedLogNamedSlf4J() throws Exception - { - Log.setLog(new Slf4jLog()); - - assertNamedLogging(Red.class); - assertNamedLogging(Blue.class); - assertNamedLogging(Green.class); - } - - private void assertNamedLogging(Class clazz) - { - Logger lc = Log.getLogger(clazz); - assertEquals(lc.getName(), clazz.getName(), "Named logging (impl=" + Log.getLog().getClass().getName() + ")"); - } - - public static Stream packageCases() - { - return Stream.of( - // null entry - Arguments.of(null, ""), - // empty entry - Arguments.of("", ""), - // all whitespace entry - Arguments.of(" \t ", ""), - // bad / invalid characters - Arguments.of("org.eclipse.Foo.\u0000", "oe.Foo"), - Arguments.of("org.eclipse.\u20ac.Euro", "oe\u20ac.Euro"), - // bad package segments - Arguments.of(".foo", "foo"), - Arguments.of(".bar.Foo", "b.Foo"), - Arguments.of("org...bar..Foo", "ob.Foo"), - Arguments.of("org . . . bar . . Foo ", "ob.Foo"), - Arguments.of("org . . . bar . . Foo ", "ob.Foo"), - // long-ish classname - Arguments.of("org.eclipse.jetty.websocket.common.extensions.compress.DeflateFrameExtension", "oejwcec.DeflateFrameExtension"), - // internal class - Arguments.of("org.eclipse.jetty.foo.Bar$Internal", "oejf.Bar$Internal") - ); - } - - @ParameterizedTest - @MethodSource("packageCases") - public void testCondensePackageViaLogger(String input, String expected) - { - StdErrLog log = new StdErrLog(); - StdErrLog logger = (StdErrLog)log.newLogger(input); - assertThat("log[" + input + "] condenses to name", logger._abbrevname, is(expected)); - } - - @ParameterizedTest - @MethodSource("packageCases") - public void testCondensePackageDirect(String input, String expected) - { - assertThat("log[" + input + "] condenses to name", AbstractLogger.condensePackageString(input), is(expected)); - } -} diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/NamedLogTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/NamedLogTest.java deleted file mode 100644 index ffbdd878007..00000000000 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/NamedLogTest.java +++ /dev/null @@ -1,59 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import org.junit.jupiter.api.Test; - -public class NamedLogTest -{ - @Test - public void testNamedLogging() - { - Red red = new Red(); - Green green = new Green(); - Blue blue = new Blue(); - - StdErrCapture output = new StdErrCapture(); - - setLoggerOptions(Red.class, output); - setLoggerOptions(Green.class, output); - setLoggerOptions(Blue.class, output); - - red.generateLogs(); - green.generateLogs(); - blue.generateLogs(); - - output.assertContains(Red.class.getName()); - output.assertContains(Green.class.getName()); - output.assertContains(Blue.class.getName()); - } - - private void setLoggerOptions(Class clazz, StdErrCapture output) - { - Logger logger = Log.getLogger(clazz); - logger.setDebugEnabled(true); - - if (logger instanceof StdErrLog) - { - StdErrLog sel = (StdErrLog)logger; - sel.setPrintLongNames(true); - output.capture(sel); - } - } -} diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Red.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Red.java deleted file mode 100644 index 6bb0a4fc658..00000000000 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Red.java +++ /dev/null @@ -1,32 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -public class Red -{ - private static final Logger LOG = Log.getLogger(Red.class); - - public void generateLogs() - { - LOG.debug("My color is {}", Red.class.getSimpleName()); - LOG.info("I represent the emotion Love"); - LOG.warn("I can also mean Anger"); - LOG.ignore(new RuntimeException("Nom")); - } -} diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Slf4jHelper.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Slf4jHelper.java deleted file mode 100644 index 1261961b9dd..00000000000 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Slf4jHelper.java +++ /dev/null @@ -1,61 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.io.File; -import java.io.FileFilter; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; - -import org.eclipse.jetty.toolchain.test.MavenTestingUtils; - -import static org.junit.jupiter.api.Assumptions.assumeTrue; - -public final class Slf4jHelper -{ - public static ClassLoader createTestClassLoader(ClassLoader parentClassLoader) throws MalformedURLException - { - File testJarDir = MavenTestingUtils.getTargetFile("test-jars"); - assumeTrue(testJarDir.exists()); // trigger @Ignore if dir not there - - File[] jarfiles = testJarDir.listFiles(new FileFilter() - { - public boolean accept(File path) - { - if (!path.isFile()) - { - return false; - } - return path.getName().endsWith(".jar"); - } - }); - - assumeTrue(jarfiles.length > 0); // trigger @Ignore if no jar files. - - URL[] urls = new URL[jarfiles.length]; - for (int i = 0; i < jarfiles.length; i++) - { - urls[i] = jarfiles[i].toURI().toURL(); - // System.out.println("Adding test-jar => " + urls[i]); - } - - return new URLClassLoader(urls, parentClassLoader); - } -} diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java deleted file mode 100644 index 05d31b10fb2..00000000000 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java +++ /dev/null @@ -1,862 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.PrintStream; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.nio.charset.StandardCharsets; -import java.util.Properties; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.is; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotSame; -import static org.junit.jupiter.api.Assertions.assertSame; - -/** - * Tests for StdErrLog - */ -public class StdErrLogTest -{ - static - { - StdErrLog.setTagPad(0); - } - - @BeforeEach - public void before() - { - Thread.currentThread().setName("tname"); - } - - @Test - public void testStdErrLogFormat() - { - StdErrLog log = new StdErrLog(LogTest.class.getName(), new Properties()); - StdErrCapture output = new StdErrCapture(log); - - log.info("testing:{},{}", "test", "format1"); - log.info("testing:{}", "test", "format2"); - log.info("testing", "test", "format3"); - log.info("testing:{},{}", "test", null); - log.info("testing {} {}", null, null); - log.info("testing:{}", null, null); - log.info("testing", null, null); - - System.err.println(output); - output.assertContains("INFO:oejul.LogTest:tname: testing:test,format1"); - output.assertContains("INFO:oejul.LogTest:tname: testing:test format2"); - output.assertContains("INFO:oejul.LogTest:tname: testing test format3"); - output.assertContains("INFO:oejul.LogTest:tname: testing:test,"); - output.assertContains("INFO:oejul.LogTest:tname: testing"); - output.assertContains("INFO:oejul.LogTest:tname: testing:"); - output.assertContains("INFO:oejul.LogTest:tname: testing"); - } - - @Test - public void testStdErrLogDebug() - { - StdErrLog log = new StdErrLog("xxx", new Properties()); - StdErrCapture output = new StdErrCapture(log); - - log.setLevel(StdErrLog.LEVEL_DEBUG); - log.debug("testing {} {}", "test", "debug"); - log.info("testing {} {}", "test", "info"); - log.warn("testing {} {}", "test", "warn"); - log.setLevel(StdErrLog.LEVEL_INFO); - log.debug("YOU SHOULD NOT SEE THIS!", null, null); - - // Test for backward compat with old (now deprecated) method - Logger before = log.getLogger("before"); - log.setDebugEnabled(true); - Logger after = log.getLogger("after"); - before.debug("testing {} {}", "test", "debug-before"); - log.debug("testing {} {}", "test", "debug-deprecated"); - after.debug("testing {} {}", "test", "debug-after"); - - log.setDebugEnabled(false); - before.debug("testing {} {}", "test", "debug-before-false"); - log.debug("testing {} {}", "test", "debug-deprecated-false"); - after.debug("testing {} {}", "test", "debug-after-false"); - - output.assertContains("DBUG:xxx:tname: testing test debug"); - output.assertContains("INFO:xxx:tname: testing test info"); - output.assertContains("WARN:xxx:tname: testing test warn"); - output.assertNotContains("YOU SHOULD NOT SEE THIS!"); - output.assertContains("DBUG:x.before:tname: testing test debug-before"); - output.assertContains("DBUG:xxx:tname: testing test debug-deprecated"); - output.assertContains("DBUG:x.after:tname: testing test debug-after"); - output.assertNotContains("DBUG:x.before:tname: testing test debug-before-false"); - output.assertNotContains("DBUG:xxx:tname: testing test debug-deprecated-false"); - output.assertNotContains("DBUG:x.after:tname: testing test debug-after-false"); - } - - @Test - public void testStdErrLogName() - { - StdErrLog log = new StdErrLog("testX", new Properties()); - log.setPrintLongNames(true); - StdErrCapture output = new StdErrCapture(log); - - assertThat("Log.name", log.getName(), is("testX")); - Logger next = log.getLogger("next"); - assertThat("Log.name(child)", next.getName(), is("testX.next")); - next.info("testing {} {}", "next", "info"); - - output.assertContains(":testX.next:tname: testing next info"); - } - - @Test - public void testStdErrMsgThrowable() - { - // The test Throwable - Throwable th = new Throwable("Message"); - - // Initialize Logger - StdErrLog log = new StdErrLog("testX", new Properties()); - StdErrCapture output = new StdErrCapture(log); - - // Test behavior - log.warn("ex", th); // Behavior here is being tested - output.assertContains(asString(th)); - } - - @SuppressWarnings("ConstantConditions") - @Test - public void testStdErrMsgThrowableNull() - { - // Initialize Logger - StdErrLog log = new StdErrLog("testX", new Properties()); - StdErrCapture output = new StdErrCapture(log); - - // Test behavior - Throwable th = null; - log.warn("ex", th); - output.assertContains("testX"); - output.assertNotContains("null"); - } - - @Test - public void testStdErrThrowable() - { - // The test Throwable - Throwable th = new Throwable("Message"); - - // Initialize Logger - StdErrLog log = new StdErrLog("testX", new Properties()); - StdErrCapture output = new StdErrCapture(log); - - // Test behavior - log.warn(th); - output.assertContains(asString(th)); - } - - @Test - public void testStdErrThrowableNull() - { - // Initialize Logger - StdErrLog log = new StdErrLog("testX", new Properties()); - StdErrCapture output = new StdErrCapture(log); - - // Test behavior - Throwable th = null; - log.warn(th); // Behavior here is being tested - output.assertContains("testX"); - output.assertNotContains("null"); - } - - @Test - public void testStdErrFormatArgsThrowable() - { - // The test throwable - Throwable th = new Throwable("Reasons Explained"); - - // Initialize Logger - StdErrLog log = new StdErrLog("testX", new Properties()); - StdErrCapture output = new StdErrCapture(log); - - // Test behavior - log.warn("Ex {}", "Reasons", th); - output.assertContains("Reasons"); - output.assertContains(asString(th)); - } - - @SuppressWarnings("ConstantConditions") - @Test - public void testStdErrFormatArgsThrowableNull() - { - // The test throwable - Throwable th = null; - - // Initialize Logger - StdErrLog log = new StdErrLog("testX", new Properties()); - StdErrCapture output = new StdErrCapture(log); - - // Test behavior - log.warn("Ex {}", "Reasons", th); - output.assertContains("Reasons"); - output.assertNotContains("null"); - } - - @Test - public void testStdErrMsgThrowableWithControlChars() - { - // The test throwable, using "\b" (backspace) character - Throwable th = new Throwable("Message with \b backspace"); - - // Initialize Logger - StdErrLog log = new StdErrLog("testX", new Properties()); - StdErrCapture output = new StdErrCapture(log); - - // Test behavior - log.warn("ex", th); - output.assertNotContains("Message with \b backspace"); - output.assertContains("Message with ? backspace"); - } - - @Test - public void testStdErrMsgStringThrowableWithControlChars() - { - // The test throwable, using "\b" (backspace) character - Throwable th = new Throwable("Message with \b backspace"); - - // Initialize Logger - StdErrLog log = new StdErrLog("testX", new Properties()); - StdErrCapture output = new StdErrCapture(log); - - // Test behavior - log.info(th.toString()); - output.assertNotContains("Message with \b backspace"); - output.assertContains("Message with ? backspace"); - } - - private String asString(Throwable cause) - { - StringWriter tout = new StringWriter(); - cause.printStackTrace(new PrintWriter(tout)); - return tout.toString(); - } - - /** - * Test to make sure that using a Null parameter on parameterized messages does not result in a NPE - */ - @Test - public void testParameterizedMessageNullValues() - { - StdErrLog log = new StdErrLog(StdErrLogTest.class.getName(), new Properties()); - log.setLevel(StdErrLog.LEVEL_DEBUG); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - log.info("Testing info(msg,null,null) - {} {}", "arg0", "arg1"); - log.info("Testing info(msg,null,null) - {} {}", null, null); - log.info("Testing info(msg,null,null) - {}", null, null); - log.info("Testing info(msg,null,null)", null, null); - log.info(null, "Testing", "info(null,arg0,arg1)"); - log.info(null, null, null); - - log.debug("Testing debug(msg,null,null) - {} {}", "arg0", "arg1"); - log.debug("Testing debug(msg,null,null) - {} {}", null, null); - log.debug("Testing debug(msg,null,null) - {}", null, null); - log.debug("Testing debug(msg,null,null)", null, null); - log.debug(null, "Testing", "debug(null,arg0,arg1)"); - log.debug(null, null, null); - - log.debug("Testing debug(msg,null)"); - log.debug(null, new Throwable("Testing debug(null,thrw)").fillInStackTrace()); - - log.warn("Testing warn(msg,null,null) - {} {}", "arg0", "arg1"); - log.warn("Testing warn(msg,null,null) - {} {}", null, null); - log.warn("Testing warn(msg,null,null) - {}", null, null); - log.warn("Testing warn(msg,null,null)", null, null); - log.warn(null, "Testing", "warn(msg,arg0,arg1)"); - log.warn(null, null, null); - - log.warn("Testing warn(msg,null)"); - log.warn(null, new Throwable("Testing warn(msg,thrw)").fillInStackTrace()); - } - } - - @Test - public void testGetLoggingLevelDefault() - { - Properties props = new Properties(); - - // Default Levels - assertEquals(StdErrLog.LEVEL_INFO, StdErrLog.getLoggingLevel(props, null), "Default Logging Level"); - assertEquals(StdErrLog.LEVEL_INFO, StdErrLog.getLoggingLevel(props, ""), "Default Logging Level"); - assertEquals(StdErrLog.LEVEL_INFO, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty"), "Default Logging Level"); - assertEquals(StdErrLog.LEVEL_INFO, StdErrLog.getLoggingLevel(props, StdErrLogTest.class.getName()), "Default Logging Level"); - } - - @Test - public void testGetLoggingLevelBad() - { - Properties props = new Properties(); - props.setProperty("log.LEVEL", "WARN"); - props.setProperty("org.eclipse.jetty.bad.LEVEL", "EXPECTED_BAD_LEVEL"); - - // Default Level (because of bad level value) - assertEquals(StdErrLog.LEVEL_WARN, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty.bad"), "Bad Logging Level"); - } - - @Test - public void testGetLoggingLevelLowercase() - { - Properties props = new Properties(); - props.setProperty("log.LEVEL", "warn"); - props.setProperty("org.eclipse.jetty.util.LEVEL", "info"); - - // Default Level - assertEquals(StdErrLog.LEVEL_WARN, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty"), "Lowercase Level"); - // Specific Level - assertEquals(StdErrLog.LEVEL_INFO, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty.util"), "Lowercase Level"); - } - - @Test - public void testGetLoggingLevelRoot() - { - Properties props = new Properties(); - props.setProperty("log.LEVEL", "DEBUG"); - - // Default Levels - assertEquals(StdErrLog.LEVEL_DEBUG, StdErrLog.getLoggingLevel(props, null), "Default Logging Level"); - assertEquals(StdErrLog.LEVEL_DEBUG, StdErrLog.getLoggingLevel(props, ""), "Default Logging Level"); - assertEquals(StdErrLog.LEVEL_DEBUG, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty"), "Default Logging Level"); - assertEquals(StdErrLog.LEVEL_DEBUG, StdErrLog.getLoggingLevel(props, StdErrLogTest.class.getName()), "Default Logging Level"); - } - - @Test - public void testGetLoggingLevelFQCN() - { - String name = StdErrLogTest.class.getName(); - Properties props = new Properties(); - props.setProperty(name + ".LEVEL", "ALL"); - - // Default Levels - assertEquals(StdErrLog.LEVEL_INFO, StdErrLog.getLoggingLevel(props, null)); - assertEquals(StdErrLog.LEVEL_INFO, StdErrLog.getLoggingLevel(props, "")); - assertEquals(StdErrLog.LEVEL_INFO, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty")); - - // Specified Level - assertEquals(StdErrLog.LEVEL_ALL, StdErrLog.getLoggingLevel(props, name)); - } - - @Test - public void testGetLoggingLevelUtilLevel() - { - Properties props = new Properties(); - props.setProperty("org.eclipse.jetty.util.LEVEL", "DEBUG"); - - // Default Levels - assertEquals(StdErrLog.LEVEL_INFO, StdErrLog.getLoggingLevel(props, null)); - assertEquals(StdErrLog.LEVEL_INFO, StdErrLog.getLoggingLevel(props, "")); - assertEquals(StdErrLog.LEVEL_INFO, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty")); - assertEquals(StdErrLog.LEVEL_INFO, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty.server.BogusObject")); - - // Configured Level - assertEquals(StdErrLog.LEVEL_DEBUG, StdErrLog.getLoggingLevel(props, StdErrLogTest.class.getName())); - assertEquals(StdErrLog.LEVEL_DEBUG, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty.util.Bogus")); - assertEquals(StdErrLog.LEVEL_DEBUG, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty.util")); - assertEquals(StdErrLog.LEVEL_DEBUG, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty.util.resource.PathResource")); - } - - @Test - public void testGetLoggingLevelMixedLevels() - { - Properties props = new Properties(); - props.setProperty("log.LEVEL", "DEBUG"); - props.setProperty("org.eclipse.jetty.util.LEVEL", "WARN"); - props.setProperty("org.eclipse.jetty.util.ConcurrentHashMap.LEVEL", "ALL"); - - // Default Levels - assertEquals(StdErrLog.LEVEL_DEBUG, StdErrLog.getLoggingLevel(props, null)); - assertEquals(StdErrLog.LEVEL_DEBUG, StdErrLog.getLoggingLevel(props, "")); - assertEquals(StdErrLog.LEVEL_DEBUG, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty")); - assertEquals(StdErrLog.LEVEL_DEBUG, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty.server.ServerObject")); - - // Configured Level - assertEquals(StdErrLog.LEVEL_WARN, StdErrLog.getLoggingLevel(props, StdErrLogTest.class.getName())); - assertEquals(StdErrLog.LEVEL_WARN, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty.util.MagicUtil")); - assertEquals(StdErrLog.LEVEL_WARN, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty.util")); - assertEquals(StdErrLog.LEVEL_WARN, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty.util.resource.PathResource")); - assertEquals(StdErrLog.LEVEL_ALL, StdErrLog.getLoggingLevel(props, "org.eclipse.jetty.util.ConcurrentHashMap")); - } - - /** - * Tests StdErrLog.warn() methods with level filtering. - *

- * Should always see WARN level messages, regardless of set level. - */ - @Test - public void testWarnFiltering() - { - StdErrLog log = new StdErrLog(StdErrLogTest.class.getName(), new Properties()); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - StdErrCapture output = new StdErrCapture(log); - - // Start with default level - log.warn("See Me"); - - // Set to debug level - log.setLevel(StdErrLog.LEVEL_DEBUG); - log.warn("Hear Me"); - - // Set to warn level - log.setLevel(StdErrLog.LEVEL_WARN); - log.warn("Cheer Me"); - - log.warn("", new Throwable("out of focus")); - log.warn(new Throwable("scene lost")); - - // Validate Output - // System.err.print(output); - output.assertContains("See Me"); - output.assertContains("Hear Me"); - output.assertContains("Cheer Me"); - - // Validate Stack Traces - output.assertContains(".StdErrLogTest:tname: "); - output.assertContains("java.lang.Throwable: out of focus"); - output.assertContains("java.lang.Throwable: scene lost"); - } - } - - /** - * Tests StdErrLog.info() methods with level filtering. - *

- * Should only see INFO level messages when level is set to {@link StdErrLog#LEVEL_INFO} and below. - */ - @Test - public void testInfoFiltering() - { - StdErrLog log = new StdErrLog(StdErrLogTest.class.getName(), new Properties()); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - StdErrCapture output = new StdErrCapture(log); - - // Normal/Default behavior - log.info("I will not buy"); - - // Level Debug - log.setLevel(StdErrLog.LEVEL_DEBUG); - log.info("this record"); - - // Level All - log.setLevel(StdErrLog.LEVEL_ALL); - log.info("it is scratched."); - - log.info("", new Throwable("out of focus")); - log.info(new Throwable("scene lost")); - - // Level Warn - log.setLevel(StdErrLog.LEVEL_WARN); - log.info("sorry?"); - log.info("", new Throwable("on editing room floor")); - - // Validate Output - output.assertContains("I will not buy"); - output.assertContains("this record"); - output.assertContains("it is scratched."); - output.assertNotContains("sorry?"); - - // Validate Stack Traces - output.assertNotContains(""); - output.assertNotContains("on editing room floor"); - - output.assertContains(".StdErrLogTest:tname: "); - output.assertContains("java.lang.Throwable: out of focus"); - output.assertContains("java.lang.Throwable: scene lost"); - } - } - - /** - * Tests {@link StdErrLog#LEVEL_OFF} filtering. - */ - @Test - public void testOffFiltering() - { - StdErrLog log = new StdErrLog(StdErrLogTest.class.getName(), new Properties()); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - log.setLevel(StdErrLog.LEVEL_OFF); - - StdErrCapture output = new StdErrCapture(log); - - // Various logging events - log.debug("Squelch"); - log.debug("Squelch", new RuntimeException("Squelch")); - log.info("Squelch"); - log.info("Squelch", new IllegalStateException("Squelch")); - log.warn("Squelch"); - log.warn("Squelch", new Exception("Squelch")); - log.ignore(new Throwable("Squelch")); - - // Validate Output - output.assertNotContains("Squelch"); - } - } - - /** - * Tests StdErrLog.debug() methods with level filtering. - *

- * Should only see DEBUG level messages when level is set to {@link StdErrLog#LEVEL_DEBUG} and below. - */ - @Test - public void testDebugFiltering() - { - StdErrLog log = new StdErrLog(StdErrLogTest.class.getName(), new Properties()); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - StdErrCapture output = new StdErrCapture(log); - - // Normal/Default behavior - log.debug("Tobacconist"); - log.debug("", new Throwable("on editing room floor")); - - // Level Debug - log.setLevel(StdErrLog.LEVEL_DEBUG); - log.debug("my hovercraft is"); - - log.debug("", new Throwable("out of focus")); - log.debug(new Throwable("scene lost")); - - // Level All - log.setLevel(StdErrLog.LEVEL_ALL); - log.debug("full of eels."); - - // Level Warn - log.setLevel(StdErrLog.LEVEL_WARN); - log.debug("what?"); - - // Validate Output - // System.err.print(output); - output.assertNotContains("Tobacconist"); - output.assertContains("my hovercraft is"); - output.assertContains("full of eels."); - output.assertNotContains("what?"); - - // Validate Stack Traces - output.assertNotContains(""); - output.assertNotContains("on editing room floor"); - - output.assertContains(".StdErrLogTest:tname: "); - output.assertContains("java.lang.Throwable: out of focus"); - output.assertContains("java.lang.Throwable: scene lost"); - } - } - - /** - * Tests StdErrLog with {@link Logger#ignore(Throwable)} use. - *

- * Should only see IGNORED level messages when level is set to {@link StdErrLog#LEVEL_ALL}. - */ - @Test - public void testIgnores() - { - StdErrLog log = new StdErrLog(StdErrLogTest.class.getName(), new Properties()); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - StdErrCapture output = new StdErrCapture(log); - - // Normal/Default behavior - log.ignore(new Throwable("IGNORE ME")); - - // Show Ignored - log.setLevel(StdErrLog.LEVEL_ALL); - log.ignore(new Throwable("Don't ignore me")); - - // Set to Debug level - log.setLevel(StdErrLog.LEVEL_DEBUG); - log.ignore(new Throwable("Debug me")); - - // Validate Output - // System.err.print(output); - output.assertNotContains("IGNORE ME"); - output.assertContains("Don't ignore me"); - output.assertNotContains("Debug me"); - } - } - - @Test - public void testIsDebugEnabled() - { - StdErrLog log = new StdErrLog(StdErrLogTest.class.getName(), new Properties()); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - log.setLevel(StdErrLog.LEVEL_ALL); - assertThat("log.level(all).isDebugEnabled", log.isDebugEnabled(), is(true)); - - log.setLevel(StdErrLog.LEVEL_DEBUG); - assertThat("log.level(debug).isDebugEnabled", log.isDebugEnabled(), is(true)); - - log.setLevel(StdErrLog.LEVEL_INFO); - assertThat("log.level(info).isDebugEnabled", log.isDebugEnabled(), is(false)); - - log.setLevel(StdErrLog.LEVEL_WARN); - assertThat("log.level(warn).isDebugEnabled", log.isDebugEnabled(), is(false)); - - log.setLevel(StdErrLog.LEVEL_OFF); - assertThat("log.level(off).isDebugEnabled", log.isDebugEnabled(), is(false)); - } - } - - @Test - public void testSetGetLevel() - { - StdErrLog log = new StdErrLog(StdErrLogTest.class.getName(), new Properties()); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - log.setLevel(StdErrLog.LEVEL_ALL); - assertThat("log.level(all).getLevel()", log.getLevel(), is(StdErrLog.LEVEL_ALL)); - - log.setLevel(StdErrLog.LEVEL_DEBUG); - assertThat("log.level(debug).getLevel()", log.getLevel(), is(StdErrLog.LEVEL_DEBUG)); - - log.setLevel(StdErrLog.LEVEL_INFO); - assertThat("log.level(info).getLevel()", log.getLevel(), is(StdErrLog.LEVEL_INFO)); - - log.setLevel(StdErrLog.LEVEL_WARN); - assertThat("log.level(warn).getLevel()", log.getLevel(), is(StdErrLog.LEVEL_WARN)); - - log.setLevel(StdErrLog.LEVEL_OFF); - assertThat("log.level(off).getLevel()", log.getLevel(), is(StdErrLog.LEVEL_OFF)); - } - } - - @Test - public void testGetChildLoggerSimple() - { - String baseName = "jetty"; - StdErrLog log = new StdErrLog(baseName, new Properties()); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - assertThat("Logger.name", log.getName(), is("jetty")); - - Logger log2 = log.getLogger("child"); - assertThat("Logger.child.name", log2.getName(), is("jetty.child")); - } - } - - @Test - public void testGetChildLoggerDeep() - { - String baseName = "jetty"; - StdErrLog log = new StdErrLog(baseName, new Properties()); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - assertThat("Logger.name", log.getName(), is("jetty")); - - Logger log2 = log.getLogger("child.of.the.sixties"); - assertThat("Logger.child.name", log2.getName(), is("jetty.child.of.the.sixties")); - } - } - - @Test - public void testGetChildLoggerNull() - { - String baseName = "jetty"; - StdErrLog log = new StdErrLog(baseName, new Properties()); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - assertThat("Logger.name", log.getName(), is("jetty")); - - // Pass null as child reference, should return parent logger - Logger log2 = log.getLogger((String)null); - assertThat("Logger.child.name", log2.getName(), is("jetty")); - assertSame(log2, log, "Should have returned same logger"); - } - } - - @Test - public void testGetChildLoggerEmptyName() - { - String baseName = "jetty"; - StdErrLog log = new StdErrLog(baseName, new Properties()); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - assertThat("Logger.name", log.getName(), is("jetty")); - - // Pass empty name as child reference, should return parent logger - Logger log2 = log.getLogger(""); - assertThat("Logger.child.name", log2.getName(), is("jetty")); - assertSame(log2, log, "Should have returned same logger"); - } - } - - @Test - public void testGetChildLoggerEmptyNameSpaces() - { - String baseName = "jetty"; - StdErrLog log = new StdErrLog(baseName, new Properties()); - try (StacklessLogging ignored = new StacklessLogging(log)) - { - assertThat("Logger.name", log.getName(), is("jetty")); - - // Pass empty name as child reference, should return parent logger - Logger log2 = log.getLogger(" "); - assertThat("Logger.child.name", log2.getName(), is("jetty")); - assertSame(log2, log, "Should have returned same logger"); - } - } - - @Test - public void testGetChildLoggerNullParent() - { - AbstractLogger log = new StdErrLog(null, new Properties()); - - assertThat("Logger.name", log.getName(), is("")); - - Logger log2 = log.getLogger("jetty"); - assertThat("Logger.child.name", log2.getName(), is("jetty")); - assertNotSame(log2, log, "Should have returned same logger"); - } - - @Test - public void testToString() - { - StdErrLog log = new StdErrLog("jetty", new Properties()); - - log.setLevel(StdErrLog.LEVEL_ALL); - assertThat("Logger.toString", log.toString(), is("StdErrLog:jetty:LEVEL=ALL")); - - log.setLevel(StdErrLog.LEVEL_DEBUG); - assertThat("Logger.toString", log.toString(), is("StdErrLog:jetty:LEVEL=DEBUG")); - - log.setLevel(StdErrLog.LEVEL_INFO); - assertThat("Logger.toString", log.toString(), is("StdErrLog:jetty:LEVEL=INFO")); - - log.setLevel(StdErrLog.LEVEL_WARN); - assertThat("Logger.toString", log.toString(), is("StdErrLog:jetty:LEVEL=WARN")); - - log.setLevel(99); // intentionally bogus level - assertThat("Logger.toString", log.toString(), is("StdErrLog:jetty:LEVEL=?")); - } - - @Test - public void testPrintSource() - { - Properties props = new Properties(); - props.put("test.SOURCE", "true"); - StdErrLog log = new StdErrLog("test", props); - log.setLevel(StdErrLog.LEVEL_DEBUG); - - ByteArrayOutputStream test = new ByteArrayOutputStream(); - PrintStream err = new PrintStream(test); - log.setStdErrStream(err); - - log.debug("Show me the source!"); - - String output = new String(test.toByteArray(), StandardCharsets.UTF_8); - // System.err.print(output); - - assertThat(output, containsString(".StdErrLogTest#testPrintSource(StdErrLogTest.java:")); - - props.put("test.SOURCE", "false"); - } - - @Test - public void testConfiguredAndSetDebugEnabled() - { - Properties props = new Properties(); - props.setProperty("org.eclipse.jetty.util.LEVEL", "WARN"); - props.setProperty("org.eclipse.jetty.io.LEVEL", "WARN"); - - StdErrLog root = new StdErrLog("", props); - assertLevel(root, StdErrLog.LEVEL_INFO); // default - - StdErrLog log = (StdErrLog)root.getLogger(StdErrLogTest.class.getName()); - assertThat("Log.isDebugEnabled()", log.isDebugEnabled(), is(false)); - assertLevel(log, StdErrLog.LEVEL_WARN); // as configured - - // Boot stomp it all to debug - root.setDebugEnabled(true); - assertThat("Log.isDebugEnabled()", log.isDebugEnabled(), is(true)); - assertLevel(log, StdErrLog.LEVEL_DEBUG); // as stomped - - // Restore configured - root.setDebugEnabled(false); - assertThat("Log.isDebugEnabled()", log.isDebugEnabled(), is(false)); - assertLevel(log, StdErrLog.LEVEL_WARN); // as configured - } - - @Test - public void testSuppressed() - { - StdErrLog log = new StdErrLog("xxx", new Properties()); - StdErrCapture output = new StdErrCapture(log); - - Exception inner = new Exception("inner"); - inner.addSuppressed(new IllegalStateException() - { - { - addSuppressed(new Exception("branch0")); - } - }); - IOException outer = new IOException("outer", inner); - - outer.addSuppressed(new IllegalStateException() - { - { - addSuppressed(new Exception("branch1")); - } - }); - outer.addSuppressed(new IllegalArgumentException() - { - { - addSuppressed(new Exception("branch2")); - } - }); - - log.warn("problem", outer); - - output.assertContains("\t|\t|java.lang.Exception: branch2"); - output.assertContains("\t|\t|java.lang.Exception: branch1"); - output.assertContains("\t|\t|java.lang.Exception: branch0"); - } - - private void assertLevel(StdErrLog log, int expectedLevel) - { - assertThat("Log[" + log.getName() + "].level", levelToString(log.getLevel()), is(levelToString(expectedLevel))); - } - - private String levelToString(int level) - { - switch (level) - { - case StdErrLog.LEVEL_ALL: - return "ALL"; - case StdErrLog.LEVEL_DEBUG: - return "DEBUG"; - case StdErrLog.LEVEL_INFO: - return "INFO"; - case StdErrLog.LEVEL_WARN: - return "WARN"; - default: - return Integer.toString(level); - } - } -} diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java index 680601b7b28..15d8228f427 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java @@ -28,8 +28,8 @@ import java.util.stream.Stream; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.resource.Resource; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/EatWhatYouKillTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/EatWhatYouKillTest.java index 77c5fe3f36f..3db735633ac 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/EatWhatYouKillTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/EatWhatYouKillTest.java @@ -24,7 +24,7 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -import org.eclipse.jetty.util.log.StacklessLogging; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.util.thread.strategy.EatWhatYouKill; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java index 488cf728e0c..521f31f05e7 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java @@ -23,9 +23,9 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.thread.ThreadPool.SizedThreadPool; import org.junit.jupiter.api.Test; diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/SchedulerTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/SchedulerTest.java index 327a80b9573..dee33a0351d 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/SchedulerTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/SchedulerTest.java @@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Stream; -import org.eclipse.jetty.util.log.StacklessLogging; +import org.eclipse.jetty.logging.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.params.ParameterizedTest; diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/SweeperTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/SweeperTest.java index 0e48f207a20..7dda9d36263 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/SweeperTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/SweeperTest.java @@ -21,7 +21,7 @@ package org.eclipse.jetty.util.thread; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import org.eclipse.jetty.util.log.StacklessLogging; +import org.eclipse.jetty.logging.StacklessLogging; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/jetty-util/src/test/resources/jetty-logging.properties b/jetty-util/src/test/resources/jetty-logging.properties index 7367559fac9..c82f81c0424 100644 --- a/jetty-util/src/test/resources/jetty-logging.properties +++ b/jetty-util/src/test/resources/jetty-logging.properties @@ -1,5 +1,5 @@ # Setup default logging implementation for during testing -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.util.LEVEL=DEBUG #org.eclipse.jetty.util.PathWatcher.LEVEL=DEBUG #org.eclipse.jetty.util.thread.QueuedThreadPool.LEVEL=DEBUG diff --git a/jetty-webapp/src/main/java/module-info.java b/jetty-webapp/src/main/java/module-info.java index e31775ebe26..fc1fd191d5a 100644 --- a/jetty-webapp/src/main/java/module-info.java +++ b/jetty-webapp/src/main/java/module-info.java @@ -25,6 +25,7 @@ module org.eclipse.jetty.webapp requires transitive java.instrument; requires transitive org.eclipse.jetty.servlet; requires transitive org.eclipse.jetty.xml; + requires org.slf4j; uses Configuration; diff --git a/jetty-webapp/src/test/resources/jetty-logging.properties b/jetty-webapp/src/test/resources/jetty-logging.properties index 9e7b0a45e6d..3d9406bcb9b 100644 --- a/jetty-webapp/src/test/resources/jetty-logging.properties +++ b/jetty-webapp/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl # org.eclipse.jetty.LEVEL=DEBUG # org.eclipse.jetty.webapp.LEVEL=DEBUG # org.eclipse.jetty.util.LEVEL=DEBUG diff --git a/jetty-websocket/websocket-core/src/main/java/module-info.java b/jetty-websocket/websocket-core/src/main/java/module-info.java index 7c8772d9563..c2fa64dda77 100644 --- a/jetty-websocket/websocket-core/src/main/java/module-info.java +++ b/jetty-websocket/websocket-core/src/main/java/module-info.java @@ -33,6 +33,7 @@ module org.eclipse.jetty.websocket.core requires jetty.servlet.api; requires transitive org.eclipse.jetty.client; requires transitive org.eclipse.jetty.server; + requires org.slf4j; // Only required if using XmlHttpClientProvider. requires static org.eclipse.jetty.xml; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadCloseStatusCodesTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadCloseStatusCodesTest.java index ed607ea7cb1..6fe3e60b6c5 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadCloseStatusCodesTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadCloseStatusCodesTest.java @@ -23,8 +23,8 @@ import java.util.stream.Stream; import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.io.MappedByteBufferPool; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.websocket.core.exception.ProtocolException; import org.eclipse.jetty.websocket.core.internal.Parser; import org.junit.jupiter.params.ParameterizedTest; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadOpCodesTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadOpCodesTest.java index 261d48281ef..a0dfcd2167a 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadOpCodesTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadOpCodesTest.java @@ -23,8 +23,8 @@ import java.util.stream.Stream; import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.io.MappedByteBufferPool; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.websocket.core.exception.ProtocolException; import org.eclipse.jetty.websocket.core.internal.Parser; import org.junit.jupiter.params.ParameterizedTest; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserReservedBitTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserReservedBitTest.java index 2ce09923b9d..de95ce6a109 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserReservedBitTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserReservedBitTest.java @@ -23,8 +23,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.websocket.core.exception.ProtocolException; import org.eclipse.jetty.websocket.core.internal.Generator; import org.eclipse.jetty.websocket.core.internal.Parser; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java index 2ede334dacd..4a47c433aaf 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java @@ -27,6 +27,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.NetworkConnector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; @@ -37,7 +38,6 @@ import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketNegotiationTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketNegotiationTest.java index 78fe389f140..5f9e5482426 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketNegotiationTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketNegotiationTest.java @@ -33,10 +33,10 @@ import org.eclipse.jetty.client.HttpRequest; import org.eclipse.jetty.client.HttpResponse; import org.eclipse.jetty.http.HttpFields; import org.eclipse.jetty.http.HttpHeader; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest; import org.eclipse.jetty.websocket.core.client.UpgradeListener; import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java index 3c10794880e..4d3b32a0600 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java @@ -23,10 +23,10 @@ import java.util.concurrent.Exchanger; import java.util.concurrent.TimeUnit; import java.util.function.BiFunction; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.websocket.core.internal.Parser; import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession; import org.junit.jupiter.api.AfterEach; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxyTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxyTest.java index 3a6f381614b..ea7a478f93f 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxyTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxyTest.java @@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.HttpStatus; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; @@ -37,7 +38,6 @@ import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.CoreSession; diff --git a/jetty-websocket/websocket-core/src/test/resources/jetty-logging.properties b/jetty-websocket/websocket-core/src/test/resources/jetty-logging.properties index c38077cdd6f..9034a88c25a 100644 --- a/jetty-websocket/websocket-core/src/test/resources/jetty-logging.properties +++ b/jetty-websocket/websocket-core/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl # org.eclipse.jetty.LEVEL=DEBUG # org.eclipse.jetty.io.LEVEL=DEBUG # org.eclipse.jetty.websocket.core.LEVEL=DEBUG diff --git a/jetty-websocket/websocket-javax-client/src/test/resources/jetty-logging.properties b/jetty-websocket/websocket-javax-client/src/test/resources/jetty-logging.properties index 536192ce715..a67f4bd5675 100644 --- a/jetty-websocket/websocket-javax-client/src/test/resources/jetty-logging.properties +++ b/jetty-websocket/websocket-javax-client/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl org.eclipse.jetty.LEVEL=INFO # org.eclipse.jetty.websocket.LEVEL=DEBUG # org.eclipse.jetty.server.AbstractConnector.LEVEL=DEBUG diff --git a/jetty-websocket/websocket-javax-common/src/main/java/module-info.java b/jetty-websocket/websocket-javax-common/src/main/java/module-info.java index 89d937226be..08b85dda862 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/module-info.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/module-info.java @@ -28,4 +28,5 @@ module org.eclipse.jetty.websocket.javax.common requires transitive org.eclipse.jetty.io; requires transitive org.eclipse.jetty.websocket.core; requires transitive org.eclipse.jetty.websocket.util; + requires org.slf4j; } diff --git a/jetty-websocket/websocket-javax-common/src/test/resources/jetty-logging.properties b/jetty-websocket/websocket-javax-common/src/test/resources/jetty-logging.properties index ef7003a8baa..274e97067c1 100644 --- a/jetty-websocket/websocket-javax-common/src/test/resources/jetty-logging.properties +++ b/jetty-websocket/websocket-javax-common/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl # org.eclipse.jetty.LEVEL=DEBUG # org.eclipse.jetty.util.log.stderr.LONG=true # org.eclipse.jetty.server.AbstractConnector.LEVEL=DEBUG diff --git a/jetty-websocket/websocket-javax-server/src/main/java/module-info.java b/jetty-websocket/websocket-javax-server/src/main/java/module-info.java index 5f22863fa27..2fa8b121f48 100644 --- a/jetty-websocket/websocket-javax-server/src/main/java/module-info.java +++ b/jetty-websocket/websocket-javax-server/src/main/java/module-info.java @@ -31,6 +31,7 @@ module org.eclipse.jetty.websocket.javax.server requires transitive org.eclipse.jetty.webapp; requires transitive org.eclipse.jetty.websocket.javax.client; requires org.eclipse.jetty.websocket.servlet; + requires org.slf4j; provides ServletContainerInitializer with JavaxWebSocketServletContainerInitializer; provides ServerEndpointConfig.Configurator with ContainerDefaultConfigurator; diff --git a/jetty-websocket/websocket-javax-server/src/test/resources/jetty-logging.properties b/jetty-websocket/websocket-javax-server/src/test/resources/jetty-logging.properties index cfafdb369a4..67577df4375 100644 --- a/jetty-websocket/websocket-javax-server/src/test/resources/jetty-logging.properties +++ b/jetty-websocket/websocket-javax-server/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl # org.eclipse.jetty.LEVEL=DEBUG # org.eclipse.jetty.websocket.LEVEL=DEBUG # org.eclipse.jetty.websocket.LEVEL=INFO diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/misbehaving/MisbehavingClassTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/misbehaving/MisbehavingClassTest.java index 7182540c054..d59fa0d0648 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/misbehaving/MisbehavingClassTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/misbehaving/MisbehavingClassTest.java @@ -22,7 +22,7 @@ import java.util.concurrent.TimeUnit; import javax.websocket.ContainerProvider; import javax.websocket.WebSocketContainer; -import org.eclipse.jetty.util.log.StacklessLogging; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession; import org.eclipse.jetty.websocket.javax.tests.CoreServer; import org.junit.jupiter.api.AfterEach; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/IdleTimeoutTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/IdleTimeoutTest.java index 9dc378e99ea..4948dc66515 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/IdleTimeoutTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/IdleTimeoutTest.java @@ -26,8 +26,8 @@ import java.util.concurrent.TimeUnit; import com.acme.websocket.IdleTimeoutContextListener; import com.acme.websocket.IdleTimeoutOnOpenEndpoint; import com.acme.websocket.IdleTimeoutOnOpenSocket; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Frame; diff --git a/jetty-websocket/websocket-javax-tests/src/test/resources/jetty-logging.properties b/jetty-websocket/websocket-javax-tests/src/test/resources/jetty-logging.properties index d60b503ca8b..7485b6d2a83 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/resources/jetty-logging.properties +++ b/jetty-websocket/websocket-javax-tests/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl # org.eclipse.jetty.LEVEL=DEBUG # org.eclipse.jetty.util.log.stderr.LONG=true # org.eclipse.jetty.server.AbstractConnector.LEVEL=DEBUG diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java b/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java index 5285a8ab1bc..3ce30e0ec89 100644 --- a/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java +++ b/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java @@ -23,4 +23,5 @@ module org.eclipse.jetty.websocket.jetty.client requires transitive org.eclipse.jetty.client; requires org.eclipse.jetty.websocket.core; requires transitive org.eclipse.jetty.websocket.jetty.common; + requires org.slf4j; } diff --git a/jetty-websocket/websocket-jetty-client/src/test/resources/jetty-logging.properties b/jetty-websocket/websocket-jetty-client/src/test/resources/jetty-logging.properties index b88f6f45f02..8816a29ffa1 100644 --- a/jetty-websocket/websocket-jetty-client/src/test/resources/jetty-logging.properties +++ b/jetty-websocket/websocket-jetty-client/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl # org.eclipse.jetty.LEVEL=DEBUG # org.eclipse.jetty.io.LEVEL=INFO # org.eclipse.jetty.client.LEVEL=DEBUG diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java b/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java index b8ecb8308b0..18f6fe37564 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java @@ -26,6 +26,7 @@ module org.eclipse.jetty.websocket.jetty.common requires transitive org.eclipse.jetty.websocket.core; requires transitive org.eclipse.jetty.websocket.util; requires transitive org.eclipse.jetty.websocket.jetty.api; + requires org.slf4j; provides ExtensionConfig.Parser with ExtensionConfigParser; } diff --git a/jetty-websocket/websocket-jetty-common/src/test/resources/jetty-logging.properties b/jetty-websocket/websocket-jetty-common/src/test/resources/jetty-logging.properties index 07faa86dbce..376b9b6babb 100644 --- a/jetty-websocket/websocket-jetty-common/src/test/resources/jetty-logging.properties +++ b/jetty-websocket/websocket-jetty-common/src/test/resources/jetty-logging.properties @@ -1 +1 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog \ No newline at end of file +# Jetty Logging using jetty-slf4j-impl diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/module-info.java b/jetty-websocket/websocket-jetty-server/src/main/java/module-info.java index 74b6da4183c..62969c6d386 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/java/module-info.java +++ b/jetty-websocket/websocket-jetty-server/src/main/java/module-info.java @@ -31,6 +31,7 @@ module org.eclipse.jetty.websocket.jetty.server requires transitive org.eclipse.jetty.webapp; requires transitive org.eclipse.jetty.websocket.jetty.common; requires transitive org.eclipse.jetty.websocket.servlet; + requires org.slf4j; // Only required if using JMX. requires static org.eclipse.jetty.jmx; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/ErrorCloseTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/ErrorCloseTest.java index 7f0ee5e8f37..0e077b8d7ff 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/ErrorCloseTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/ErrorCloseTest.java @@ -28,10 +28,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import javax.servlet.DispatcherType; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.WebSocketSessionListener; import org.eclipse.jetty.websocket.api.annotations.WebSocket; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/JettyWebSocketNegotiationTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/JettyWebSocketNegotiationTest.java index 622307f8374..2c7efe059b0 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/JettyWebSocketNegotiationTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/JettyWebSocketNegotiationTest.java @@ -23,11 +23,11 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.UpgradeRequest; import org.eclipse.jetty.websocket.client.ClientUpgradeRequest; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/WebSocketOverHTTP2Test.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/WebSocketOverHTTP2Test.java index 0de62611fe9..46353096544 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/WebSocketOverHTTP2Test.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/WebSocketOverHTTP2Test.java @@ -43,6 +43,7 @@ import org.eclipse.jetty.http2.server.HTTP2CServerConnectionFactory; import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory; import org.eclipse.jetty.io.ClientConnectionFactory; import org.eclipse.jetty.io.ClientConnector; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpConnectionFactory; @@ -53,7 +54,6 @@ import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.SslConnectionFactory; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.websocket.api.Session; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/FrameAnnotationTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/FrameAnnotationTest.java index 0943a335e6e..c79c67582f5 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/FrameAnnotationTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/FrameAnnotationTest.java @@ -24,6 +24,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.Future; import java.util.concurrent.LinkedBlockingQueue; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.DefaultHandler; @@ -31,7 +32,6 @@ import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.websocket.api.Frame; import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/FrameListenerTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/FrameListenerTest.java index 0085c468a65..dc2107f2727 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/FrameListenerTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/FrameListenerTest.java @@ -24,6 +24,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.Future; import java.util.concurrent.LinkedBlockingQueue; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.DefaultHandler; @@ -31,7 +32,6 @@ import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.websocket.api.Frame; import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/PartialListenerTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/PartialListenerTest.java index 5733c87d828..1c2804d59f4 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/PartialListenerTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/PartialListenerTest.java @@ -25,6 +25,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.Future; import java.util.concurrent.LinkedBlockingQueue; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.DefaultHandler; @@ -32,7 +33,6 @@ import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.WebSocketPartialListener; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerCloseTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerCloseTest.java index 8870a9868d2..3277da8b00c 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerCloseTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerCloseTest.java @@ -23,13 +23,13 @@ import java.nio.channels.ClosedChannelException; import java.time.Duration; import java.util.concurrent.Future; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.DefaultHandler; import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.StatusCode; import org.eclipse.jetty.websocket.api.util.WSURI; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/resources/jetty-logging.properties b/jetty-websocket/websocket-jetty-tests/src/test/resources/jetty-logging.properties index 41e1bef3cd0..f53242c83bf 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/resources/jetty-logging.properties +++ b/jetty-websocket/websocket-jetty-tests/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl # org.eclipse.jetty.LEVEL=DEBUG # org.eclipse.jetty.websocket.LEVEL=DEBUG # org.eclipse.jetty.websocket.test.LEVEL=DEBUG diff --git a/jetty-websocket/websocket-servlet/src/main/java/module-info.java b/jetty-websocket/websocket-servlet/src/main/java/module-info.java index 7c70a9feeff..93715204b9d 100644 --- a/jetty-websocket/websocket-servlet/src/main/java/module-info.java +++ b/jetty-websocket/websocket-servlet/src/main/java/module-info.java @@ -22,4 +22,5 @@ module org.eclipse.jetty.websocket.servlet requires transitive org.eclipse.jetty.servlet; requires transitive org.eclipse.jetty.websocket.core; + requires org.slf4j; } diff --git a/jetty-websocket/websocket-util/src/main/java/module-info.java b/jetty-websocket/websocket-util/src/main/java/module-info.java index 06dadf1a9a5..183e1fd2715 100644 --- a/jetty-websocket/websocket-util/src/main/java/module-info.java +++ b/jetty-websocket/websocket-util/src/main/java/module-info.java @@ -21,5 +21,6 @@ module org.eclipse.jetty.websocket.util exports org.eclipse.jetty.websocket.util; exports org.eclipse.jetty.websocket.util.messages; + requires org.slf4j; requires transitive org.eclipse.jetty.websocket.core; } diff --git a/jetty-websocket/websocket-util/src/test/resources/jetty-logging.properties b/jetty-websocket/websocket-util/src/test/resources/jetty-logging.properties index 07faa86dbce..376b9b6babb 100644 --- a/jetty-websocket/websocket-util/src/test/resources/jetty-logging.properties +++ b/jetty-websocket/websocket-util/src/test/resources/jetty-logging.properties @@ -1 +1 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog \ No newline at end of file +# Jetty Logging using jetty-slf4j-impl diff --git a/jetty-xml/src/main/java/module-info.java b/jetty-xml/src/main/java/module-info.java index 4a6c797c183..6c26b215b96 100644 --- a/jetty-xml/src/main/java/module-info.java +++ b/jetty-xml/src/main/java/module-info.java @@ -24,6 +24,7 @@ module org.eclipse.jetty.xml requires transitive java.xml; requires transitive org.eclipse.jetty.util; + requires org.slf4j; uses ConfigurationProcessorFactory; } diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java index 8c5219be3b9..cbf7f2ab28d 100644 --- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java +++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java @@ -36,22 +36,25 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; +import org.eclipse.jetty.logging.JettyLogger; +import org.eclipse.jetty.logging.StdErrAppender; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension; import org.eclipse.jetty.util.annotation.Name; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StdErrLog; import org.eclipse.jetty.util.resource.PathResource; import org.eclipse.jetty.util.resource.Resource; import org.hamcrest.Matchers; +import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.RepeatedTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.event.Level; import org.xml.sax.SAXException; import static java.nio.charset.StandardCharsets.UTF_8; @@ -1389,23 +1392,20 @@ public class XmlConfigurationTest " \n" + ""); - Logger logger = Log.getLogger(XmlConfiguration.class); - assertTrue(logger instanceof StdErrLog); - StdErrLog stdErrLog = (StdErrLog)logger; - ByteArrayOutputStream logBytes = new ByteArrayOutputStream(); - stdErrLog.setStdErrStream(new PrintStream(logBytes)); + ByteArrayOutputStream logBytes = captureLoggingBytes(() -> + { + Map idMap = mimicXmlConfigurationMain(xmlFoo, xmlBar); + Object obj = idMap.get("bar"); + assertThat("BarNamed instance created", obj, instanceOf(BarNamed.class)); + BarNamed bar = (BarNamed)obj; + assertThat("BarNamed has foo", bar.getFoo(), is("foozball")); + }); - Map idMap = mimicXmlConfigurationMain(xmlFoo, xmlBar); - Object obj = idMap.get("bar"); - assertThat("BarNamed instance created", obj, instanceOf(BarNamed.class)); - BarNamed bar = (BarNamed)obj; - assertThat("BarNamed has foo", bar.getFoo(), is("foozball")); - - List warnLogs = Arrays.stream(logBytes.toString(UTF_8.name()).split(System.lineSeparator())) + List warnings = Arrays.stream(logBytes.toString(UTF_8.name()).split(System.lineSeparator())) .filter(line -> line.contains(":WARN")) .collect(Collectors.toList()); - assertThat("WARN logs size", warnLogs.size(), is(0)); + assertThat("WARN logs size", warnings.size(), is(0)); } @Test @@ -1422,23 +1422,20 @@ public class XmlConfigurationTest " \n" + // no name specified ""); - Logger logger = Log.getLogger(XmlConfiguration.class); - assertTrue(logger instanceof StdErrLog); - StdErrLog stdErrLog = (StdErrLog)logger; - ByteArrayOutputStream logBytes = new ByteArrayOutputStream(); - stdErrLog.setStdErrStream(new PrintStream(logBytes)); + ByteArrayOutputStream logBytes = captureLoggingBytes(() -> + { + Map idMap = mimicXmlConfigurationMain(xmlFoo, xmlBar); + Object obj = idMap.get("bar"); + assertThat("BarNamed instance created", obj, instanceOf(BarNamed.class)); + BarNamed bar = (BarNamed)obj; + assertThat("BarNamed has foo", bar.getFoo(), is("foozball")); + }); - Map idMap = mimicXmlConfigurationMain(xmlFoo, xmlBar); - Object obj = idMap.get("bar"); - assertThat("BarNamed instance created", obj, instanceOf(BarNamed.class)); - BarNamed bar = (BarNamed)obj; - assertThat("BarNamed has foo", bar.getFoo(), is("foozball")); - - List warnLogs = Arrays.stream(logBytes.toString(UTF_8.name()).split(System.lineSeparator())) - .filter(line -> line.contains(":WARN")) + List warnings = Arrays.stream(logBytes.toString(UTF_8.name()).split(System.lineSeparator())) + .filter(line -> line.contains(":WARN :")) .collect(Collectors.toList()); - assertThat("WARN logs size", warnLogs.size(), is(0)); + assertThat("WARN logs size", warnings.size(), is(0)); } @Test @@ -1491,30 +1488,25 @@ public class XmlConfigurationTest " \n" + ""); + ByteArrayOutputStream logBytes = captureLoggingBytes(() -> + { + Map idMap = mimicXmlConfigurationMain(xmlFoo, xmlBar, xmlAddZed); + Object obj = idMap.get("bar"); + assertThat("BarNamed instance created", obj, instanceOf(BarNamed.class)); + BarNamed bar = (BarNamed)obj; + assertThat("BarNamed has foo", bar.getFoo(), is("foozball")); + List zeds = bar.getZeds(); + assertThat("BarNamed has zeds", zeds, not(empty())); + assertThat("Zeds[0]", zeds.get(0), is("plain-zero")); + }); - Logger logger = Log.getLogger(XmlConfiguration.class); - assertTrue(logger instanceof StdErrLog); - StdErrLog stdErrLog = (StdErrLog)logger; - ByteArrayOutputStream logBytes = new ByteArrayOutputStream(); - stdErrLog.setStdErrStream(new PrintStream(logBytes)); - - Map idMap = mimicXmlConfigurationMain(xmlFoo, xmlBar, xmlAddZed); - Object obj = idMap.get("bar"); - assertThat("BarNamed instance created", obj, instanceOf(BarNamed.class)); - BarNamed bar = (BarNamed)obj; - assertThat("BarNamed has foo", bar.getFoo(), is("foozball")); - List zeds = bar.getZeds(); - assertThat("BarNamed has zeds", zeds, not(empty())); - assertThat("Zeds[0]", zeds.get(0), is("plain-zero")); - - - List warnLogs = Arrays.stream(logBytes.toString(UTF_8.name()).split(System.lineSeparator())) - .filter(line -> line.contains(":WARN")) + List warnings = Arrays.stream(logBytes.toString(UTF_8.name()).split(System.lineSeparator())) + .filter(line -> line.contains(":WARN :")) .collect(Collectors.toList()); - assertThat("WARN logs count", warnLogs.size(), is(1)); + assertThat("WARN logs count", warnings.size(), is(1)); - String actualWarn = warnLogs.get(0); + String actualWarn = warnings.get(0); assertThat("WARN logs", actualWarn, allOf(containsString("Ignored arg " + ""); - ByteArrayOutputStream logBytes = null; - Logger logger = Log.getLogger(XmlConfiguration.class); - logger.setDebugEnabled(true); - if (logger instanceof StdErrLog) - { - StdErrLog stdErrLog = (StdErrLog)logger; - logBytes = new ByteArrayOutputStream(); - stdErrLog.setStdErrStream(new PrintStream(logBytes)); - } + ByteArrayOutputStream logBytes = captureLoggingBytes(xmlConfiguration::configure); - xmlConfiguration.configure(); + String[] lines = logBytes.toString(UTF_8.name()).split(System.lineSeparator()); + List warnings = Arrays.stream(lines) + .filter(line -> line.contains(":WARN :")) + .filter(line -> line.contains(testClass.getSimpleName())) + .collect(Collectors.toList()); + // 1. Deprecated constructor + // 2. Deprecated method + // 3. Deprecated method + // 4. Deprecated method + // 5. Deprecated field + // 6. Deprecated field + assertEquals(6, warnings.size()); + } - logger.setDebugEnabled(false); - if (logBytes != null) + private ByteArrayOutputStream captureLoggingBytes(ThrowableAction action) throws Exception + { + Logger slf4jLogger = LoggerFactory.getLogger(XmlConfiguration.class); + Assumptions.assumeTrue(slf4jLogger instanceof JettyLogger); + + ByteArrayOutputStream logBytes = new ByteArrayOutputStream(); + JettyLogger jettyLogger = (JettyLogger)slf4jLogger; + StdErrAppender appender = (StdErrAppender)jettyLogger.getAppender(); + PrintStream oldStream = appender.getStream(); + int oldLevel = jettyLogger.getLevel(); + try { - String[] lines = logBytes.toString(UTF_8.name()).split(System.lineSeparator()); - List warnings = Arrays.stream(lines) - .filter(line -> line.contains(":WARN:")) - .filter(line -> line.contains(testClass.getSimpleName())) - .collect(Collectors.toList()); - // 1. Deprecated constructor - // 2. Deprecated method - // 3. Deprecated method - // 4. Deprecated method - // 5. Deprecated field - // 6. Deprecated field - assertEquals(6, warnings.size()); + // capture events + appender.setStream(new PrintStream(logBytes, true)); + // make sure we are seeing WARN level events + jettyLogger.setLevel(Level.WARN); + + action.run(); } + finally + { + appender.setStream(oldStream); + jettyLogger.setLevel(oldLevel); + } + return logBytes; + } + + private interface ThrowableAction + { + void run() throws Exception; } } diff --git a/jetty-xml/src/test/resources/jetty-logging.properties b/jetty-xml/src/test/resources/jetty-logging.properties index 1759774266b..263223fbcc0 100644 --- a/jetty-xml/src/test/resources/jetty-logging.properties +++ b/jetty-xml/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl org.eclipse.jetty.xml.LEVEL=WARN org.eclipse.jetty.util.LEVEL=WARN \ No newline at end of file diff --git a/pom.xml b/pom.xml index 51dbde7619f..e277e48e165 100644 --- a/pom.xml +++ b/pom.xml @@ -19,9 +19,9 @@ UTF-8 1.4 8.20 - 1.8.0-beta2 - 2.11.2 - 1.3.0-alpha4 + 2.0.0-alpha1 + 2.13.0 + 1.3.0-alpha5 5.1.1.RELEASE 1.2 4.0.3 @@ -90,6 +90,7 @@ build-resources + jetty-slf4j-impl jetty-ant jetty-util jetty-jmx @@ -476,6 +477,7 @@ ${compiler.source} ${compiler.target} ${compiler.release} + true -Xlint:exports @@ -951,6 +953,11 @@ + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + org.eclipse.jetty.toolchain jetty-servlet-api @@ -1339,7 +1346,6 @@ true false true - Tag for release: jetty-${project.version} jetty-documentation/.* examples/.* diff --git a/tests/jetty-jmh/src/main/java/org/eclipse/jetty/util/logs/LogCondensePackageStringBenchmark.java b/tests/jetty-jmh/src/main/java/org/eclipse/jetty/util/logs/LogCondensePackageStringBenchmark.java deleted file mode 100644 index dff79ec4f61..00000000000 --- a/tests/jetty-jmh/src/main/java/org/eclipse/jetty/util/logs/LogCondensePackageStringBenchmark.java +++ /dev/null @@ -1,65 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. -// -// This program and the accompanying materials are made available under -// the terms of the Eclipse Public License 2.0 which is available at -// https://www.eclipse.org/legal/epl-2.0 -// -// This Source Code may also be made available under the following -// Secondary Licenses when the conditions for such availability set -// forth in the Eclipse Public License, v. 2.0 are satisfied: -// the Apache License v2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0 -// -// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.util.concurrent.TimeUnit; - -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.Fork; -import org.openjdk.jmh.annotations.Measurement; -import org.openjdk.jmh.annotations.Param; -import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.State; -import org.openjdk.jmh.annotations.Warmup; -import org.openjdk.jmh.infra.Blackhole; -import org.openjdk.jmh.profile.GCProfiler; -import org.openjdk.jmh.runner.Runner; -import org.openjdk.jmh.runner.RunnerException; -import org.openjdk.jmh.runner.options.Options; -import org.openjdk.jmh.runner.options.OptionsBuilder; - -@Fork(value = 5) -@State(Scope.Benchmark) - -@Warmup(iterations = 4, time = 5, timeUnit = TimeUnit.SECONDS) -@Measurement(iterations = 4, time = 5, timeUnit = TimeUnit.SECONDS) -public class LogCondensePackageStringBenchmark -{ - @Param({ - "com.acme.Dump", - "org.eclipse.jetty.websocket.common.extensions.compress.DeflateFrameExtension$Pool" - }) - String fqClassName; - - @Benchmark - public void testCondensePackage(Blackhole blackhole) - { - blackhole.consume(AbstractLogger.condensePackageString(fqClassName)); - } - - public static void main(String[] args) throws RunnerException - { - Options opt = new OptionsBuilder() - .include(LogCondensePackageStringBenchmark.class.getSimpleName()) - .addProfiler(GCProfiler.class) - .build(); - - new Runner(opt).run(); - } -} diff --git a/tests/jetty-jmh/src/main/resources/jetty-logging.properties b/tests/jetty-jmh/src/main/resources/jetty-logging.properties index 799aa62aed3..ab545e4ab63 100644 --- a/tests/jetty-jmh/src/main/resources/jetty-logging.properties +++ b/tests/jetty-jmh/src/main/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.server.LEVEL=DEBUG #org.eclipse.jetty.http.LEVEL=DEBUG diff --git a/tests/test-distribution/pom.xml b/tests/test-distribution/pom.xml index 226903f6e5b..91f1ee72cfb 100644 --- a/tests/test-distribution/pom.xml +++ b/tests/test-distribution/pom.xml @@ -14,10 +14,6 @@ - - org.slf4j - slf4j-simple - org.eclipse.jetty jetty-util diff --git a/tests/test-distribution/src/main/java/org/eclipse/jetty/tests/distribution/DistributionTester.java b/tests/test-distribution/src/main/java/org/eclipse/jetty/tests/distribution/DistributionTester.java index 1e2ea636175..aae25684091 100644 --- a/tests/test-distribution/src/main/java/org/eclipse/jetty/tests/distribution/DistributionTester.java +++ b/tests/test-distribution/src/main/java/org/eclipse/jetty/tests/distribution/DistributionTester.java @@ -65,8 +65,8 @@ import org.eclipse.aether.transport.http.HttpTransporterFactory; import org.eclipse.jetty.toolchain.test.FS; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Helper class to test the Jetty Distribution

. @@ -108,7 +108,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class DistributionTester { - private static final Logger LOGGER = Log.getLogger(DistributionTester.class); + private static final Logger LOGGER = LoggerFactory.getLogger(DistributionTester.class); private Config config; @@ -528,7 +528,7 @@ public class DistributionTester String line; while ((line = reader.readLine()) != null && !stop) { - LOGGER.info("{}", line); + LOGGER.info(line); logs.add(line); } } diff --git a/tests/test-distribution/src/test/resources/jetty-logging.properties b/tests/test-distribution/src/test/resources/jetty-logging.properties index d96a696f82e..56cc73e5d68 100644 --- a/tests/test-distribution/src/test/resources/jetty-logging.properties +++ b/tests/test-distribution/src/test/resources/jetty-logging.properties @@ -1,2 +1,2 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG diff --git a/tests/test-distribution/src/test/resources/test-realm.xml b/tests/test-distribution/src/test/resources/test-realm.xml index 72c6de06d68..0b4cf7f7c31 100644 --- a/tests/test-distribution/src/test/resources/test-realm.xml +++ b/tests/test-distribution/src/test/resources/test-realm.xml @@ -1,24 +1,29 @@ - + - - - - - - - - - - - Test Realm - - false - - - + + + + + + + + + + + Test Realm + + + + false + + + - - demo test-realm is deployed. DO NOT USE IN PRODUCTION! - + + org.eclipse.jetty + + demo test-realm is deployed. DO NOT USE IN PRODUCTION! + + diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/AsyncIOServletTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/AsyncIOServletTest.java index 87bfdb5b1b1..c1bd4f8b925 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/AsyncIOServletTest.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/AsyncIOServletTest.java @@ -62,6 +62,7 @@ import org.eclipse.jetty.http2.HTTP2Session; import org.eclipse.jetty.http2.api.Session; import org.eclipse.jetty.http2.client.http.HttpConnectionOverHTTP2; import org.eclipse.jetty.io.Connection; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.HttpInput; @@ -71,7 +72,6 @@ import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ContextHandler.Context; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.FuturePromise; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Tag; diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ServerTimeoutsTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ServerTimeoutsTest.java index 1b46c984746..5d45defd73b 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ServerTimeoutsTest.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ServerTimeoutsTest.java @@ -44,6 +44,7 @@ import org.eclipse.jetty.http.BadMessageException; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http2.FlowControlStrategy; import org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.Request; @@ -51,7 +52,6 @@ import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ArgumentsSource; diff --git a/tests/test-http-client-transport/src/test/resources/jetty-logging.properties b/tests/test-http-client-transport/src/test/resources/jetty-logging.properties index 2f142761dd2..2d990e2cc40 100644 --- a/tests/test-http-client-transport/src/test/resources/jetty-logging.properties +++ b/tests/test-http-client-transport/src/test/resources/jetty-logging.properties @@ -1,4 +1,4 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.client.LEVEL=DEBUG #org.eclipse.jetty.fcgi.LEVEL=DEBUG diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/DeploymentErrorTest.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/DeploymentErrorTest.java index c75b8079737..8d823d125c9 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/DeploymentErrorTest.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/DeploymentErrorTest.java @@ -40,6 +40,7 @@ import org.eclipse.jetty.deploy.providers.WebAppProvider; import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.io.RuntimeIOException; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; @@ -52,7 +53,6 @@ import org.eclipse.jetty.toolchain.test.IO; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.resource.PathResource; import org.eclipse.jetty.webapp.AbstractConfiguration; import org.eclipse.jetty.webapp.Configuration; diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/FailedSelectorTest.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/FailedSelectorTest.java index f44460d2f26..685b940ec00 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/FailedSelectorTest.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/FailedSelectorTest.java @@ -47,6 +47,7 @@ import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.ManagedSelector; import org.eclipse.jetty.io.SelectorManager; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.DefaultHandler; @@ -56,7 +57,6 @@ import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.Scheduler; import org.junit.jupiter.api.AfterEach; diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/rfcs/RFC2616BaseTest.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/rfcs/RFC2616BaseTest.java index b184f26d93d..3517b2a2229 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/rfcs/RFC2616BaseTest.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/rfcs/RFC2616BaseTest.java @@ -32,6 +32,7 @@ import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpParser; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http.tools.HttpTester; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.test.support.StringUtil; import org.eclipse.jetty.test.support.XmlBasedJettyServer; import org.eclipse.jetty.test.support.rawhttp.HttpSocket; @@ -39,7 +40,6 @@ import org.eclipse.jetty.test.support.rawhttp.HttpTesting; import org.eclipse.jetty.toolchain.test.FS; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.toolchain.test.StringAssert; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeEach; diff --git a/tests/test-integration/src/test/resources/jetty-logging.properties b/tests/test-integration/src/test/resources/jetty-logging.properties index f076e496439..c3b261ea39e 100644 --- a/tests/test-integration/src/test/resources/jetty-logging.properties +++ b/tests/test-integration/src/test/resources/jetty-logging.properties @@ -1,5 +1,5 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog -#org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog +# Jetty Logging using jetty-slf4j-impl +## Jetty Logging using jetty-slf4j-impl org.eclipse.jetty.LEVEL=WARN #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.websocket.LEVEL=DEBUG diff --git a/tests/test-loginservice/src/test/resources/jetty-logging.properties b/tests/test-loginservice/src/test/resources/jetty-logging.properties index adf68c7c337..54cd5fb2936 100644 --- a/tests/test-loginservice/src/test/resources/jetty-logging.properties +++ b/tests/test-loginservice/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG #org.eclipse.jetty.server.LEVEL=DEBUG diff --git a/tests/test-quickstart/src/test/resources/jetty-logging.properties b/tests/test-quickstart/src/test/resources/jetty-logging.properties index aec748c60f8..f0e97400975 100644 --- a/tests/test-quickstart/src/test/resources/jetty-logging.properties +++ b/tests/test-quickstart/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl org.eclipse.jetty.LEVEL=INFO # org.eclipse.jetty.quickstart.AttributeNormalizer.LEVEL=DEBUG diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReloadedSessionMissingClassTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReloadedSessionMissingClassTest.java index af69255e30c..17bcb26cb33 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReloadedSessionMissingClassTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReloadedSessionMissingClassTest.java @@ -27,11 +27,10 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.WebAppContext; import org.junit.jupiter.api.AfterEach; @@ -100,7 +99,7 @@ public class ReloadedSessionMissingClassTest webApp.addServlet("Bar", "/bar"); server1.start(); int port1 = server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(ReloadedSessionMissingClassTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/resources/jetty-logging.properties b/tests/test-sessions/test-mongodb-sessions/src/test/resources/jetty-logging.properties index fd2d21f9748..253433cae3a 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/resources/jetty-logging.properties +++ b/tests/test-sessions/test-mongodb-sessions/src/test/resources/jetty-logging.properties @@ -1,4 +1,3 @@ # Setup default logging implementation for during testing -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog - +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.server.LEVEL=DEBUG \ No newline at end of file diff --git a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/AbstractSessionCacheTest.java b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/AbstractSessionCacheTest.java index cc8965e2d9d..31704601f43 100644 --- a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/AbstractSessionCacheTest.java +++ b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/AbstractSessionCacheTest.java @@ -20,17 +20,15 @@ package org.eclipse.jetty.server.session; import java.util.Collections; import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionActivationListener; import javax.servlet.http.HttpSessionEvent; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -150,7 +148,7 @@ public abstract class AbstractSessionCacheTest context.getSessionHandler().setSessionCache(cache); server.start(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(AbstractSessionCacheTest.class.getPackage())) { //check that session 1234 cannot be read, ie returns null AND //that it is deleted in the datastore diff --git a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/AsyncTest.java b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/AsyncTest.java index 56de86cd0ba..06fb0b7872d 100644 --- a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/AsyncTest.java +++ b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/AsyncTest.java @@ -33,10 +33,9 @@ import javax.servlet.http.HttpSession; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -73,7 +72,7 @@ public class AsyncTest server.start(); int port = server.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(AsyncTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); @@ -125,7 +124,7 @@ public class AsyncTest server.start(); int port = server.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(AsyncTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); @@ -181,7 +180,7 @@ public class AsyncTest server.start(); int port = server.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(AsyncTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); @@ -234,7 +233,7 @@ public class AsyncTest server.start(); int port = server.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(AsyncTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); @@ -290,10 +289,10 @@ public class AsyncTest server.start(); int port = server.getPort(); HttpClient client = new HttpClient(); - - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + + try (StacklessLogging stackless = new StacklessLogging(AsyncTest.class.getPackage())) { - + client.start(); String url = "http://localhost:" + port + "/ctxA/test?action=asyncComplete"; diff --git a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/CreationTest.java b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/CreationTest.java index 00e661db79f..a675afa5a10 100644 --- a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/CreationTest.java +++ b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/CreationTest.java @@ -33,11 +33,10 @@ import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.http.HttpHeader; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; @@ -83,7 +82,7 @@ public class CreationTest server1.start(); int port1 = server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(CreationTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); @@ -152,7 +151,7 @@ public class CreationTest server1.start(); int port1 = server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(CreationTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); @@ -204,7 +203,7 @@ public class CreationTest server1.start(); int port1 = server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(CreationTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); @@ -252,7 +251,7 @@ public class CreationTest server1.start(); int port1 = server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(CreationTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); @@ -307,7 +306,7 @@ public class CreationTest server1.start(); int port1 = server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(CreationTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); @@ -362,7 +361,7 @@ public class CreationTest server1.start(); int port1 = server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(CreationTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); diff --git a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/DeleteUnloadableSessionTest.java b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/DeleteUnloadableSessionTest.java index b8aa43e5398..02c1e3edeee 100644 --- a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/DeleteUnloadableSessionTest.java +++ b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/DeleteUnloadableSessionTest.java @@ -31,10 +31,9 @@ import javax.servlet.http.HttpSession; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -155,7 +154,7 @@ public class DeleteUnloadableSessionTest ServletHolder holder = new ServletHolder(servlet); context.addServlet(holder, servletMapping); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(DeleteUnloadableSessionTest.class.getPackage())) { server.start(); int port = server.getPort(); diff --git a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/DuplicateCookieTest.java b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/DuplicateCookieTest.java index a28212f864f..ff4d3f1b5f8 100644 --- a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/DuplicateCookieTest.java +++ b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/DuplicateCookieTest.java @@ -29,11 +29,10 @@ import javax.servlet.http.HttpSession; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -62,13 +61,13 @@ public class DuplicateCookieTest server1.start(); int port1 = server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(DuplicateCookieTest.class.getPackage())) { //create a valid session createUnExpiredSession(contextHandler.getSessionHandler().getSessionCache(), contextHandler.getSessionHandler().getSessionCache().getSessionDataStore(), "4422"); - + client = new HttpClient(); client.start(); @@ -105,7 +104,7 @@ public class DuplicateCookieTest server1.start(); int port1 = server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(DuplicateCookieTest.class.getPackage())) { //create a valid session createUnExpiredSession(contextHandler.getSessionHandler().getSessionCache(), @@ -152,7 +151,7 @@ public class DuplicateCookieTest server1.start(); int port1 = server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(DuplicateCookieTest.class.getPackage())) { //create some of unexpired sessions createUnExpiredSession(contextHandler.getSessionHandler().getSessionCache(), diff --git a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/IdleSessionTest.java b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/IdleSessionTest.java index a84d0e7b210..a1b91471d98 100644 --- a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/IdleSessionTest.java +++ b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/IdleSessionTest.java @@ -30,10 +30,9 @@ import javax.servlet.http.HttpSession; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.eclipse.jetty.util.thread.AutoLock; import org.junit.jupiter.api.Test; @@ -84,7 +83,7 @@ public class IdleSessionTest _server1.start(); int port1 = _server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(IdleSessionTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); @@ -210,7 +209,7 @@ public class IdleSessionTest _server1.start(); int port1 = _server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(IdleSessionTest.class.getPackage())) { HttpClient client = new HttpClient(); client.start(); diff --git a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/SaveOptimizeTest.java b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/SaveOptimizeTest.java index 13429da6391..ef210fcc9d3 100644 --- a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/SaveOptimizeTest.java +++ b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/SaveOptimizeTest.java @@ -29,11 +29,10 @@ import javax.servlet.http.HttpSession; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Test; import static org.hamcrest.MatcherAssert.assertThat; @@ -81,7 +80,7 @@ public class SaveOptimizeTest _server1.start(); int port1 = _server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(SaveOptimizeTest.class.getPackage())) { HttpClient client = new HttpClient(); try @@ -131,7 +130,7 @@ public class SaveOptimizeTest _server1.start(); int port1 = _server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(SaveOptimizeTest.class.getPackage())) { HttpClient client = new HttpClient(); try @@ -214,7 +213,7 @@ public class SaveOptimizeTest _server1.start(); int port1 = _server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(SaveOptimizeTest.class.getPackage())) { HttpClient client = new HttpClient(); try @@ -304,7 +303,7 @@ public class SaveOptimizeTest _server1.start(); int port1 = _server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(SaveOptimizeTest.class.getPackage())) { HttpClient client = new HttpClient(); try @@ -399,7 +398,7 @@ public class SaveOptimizeTest _server1.start(); int port1 = _server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(SaveOptimizeTest.class.getPackage())) { HttpClient client = new HttpClient(); try @@ -478,7 +477,7 @@ public class SaveOptimizeTest _server1.start(); int port1 = _server1.getPort(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(SaveOptimizeTest.class.getPackage())) { HttpClient client = new HttpClient(); try diff --git a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/SessionEvictionFailureTest.java b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/SessionEvictionFailureTest.java index e602959df49..fd55f277dfa 100644 --- a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/SessionEvictionFailureTest.java +++ b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/SessionEvictionFailureTest.java @@ -30,10 +30,9 @@ import javax.servlet.http.HttpSession; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -176,7 +175,7 @@ public class SessionEvictionFailureTest int port1 = server.getPort(); HttpClient client = new HttpClient(); client.start(); - try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + try (StacklessLogging stackless = new StacklessLogging(SessionEvictionFailureTest.class.getPackage())) { String url = "http://localhost:" + port1 + contextPath + servletMapping; diff --git a/tests/test-sessions/test-sessions-common/src/test/resources/jetty-logging.properties b/tests/test-sessions/test-sessions-common/src/test/resources/jetty-logging.properties index d96a696f82e..56cc73e5d68 100644 --- a/tests/test-sessions/test-sessions-common/src/test/resources/jetty-logging.properties +++ b/tests/test-sessions/test-sessions-common/src/test/resources/jetty-logging.properties @@ -1,2 +1,2 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG diff --git a/tests/test-webapps/test-http2-webapp/src/test/resources/jetty-logging.properties b/tests/test-webapps/test-http2-webapp/src/test/resources/jetty-logging.properties index 055e90b60ef..fe35fe0c739 100644 --- a/tests/test-webapps/test-http2-webapp/src/test/resources/jetty-logging.properties +++ b/tests/test-webapps/test-http2-webapp/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl org.eclipse.jetty.LEVEL=INFO #org.eclipse.jetty.alpn.LEVEL=DEBUG diff --git a/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/etc/test-realm.xml b/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/etc/test-realm.xml index 0f9867548b9..0b4cf7f7c31 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/etc/test-realm.xml +++ b/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/etc/test-realm.xml @@ -1,24 +1,29 @@ - - - - - - - - - - - Test Realm - - false - - - + + + + + + + + + + + Test Realm + + + + false + + + - - demo test-realm is deployed. DO NOT USE IN PRODUCTION! - + + org.eclipse.jetty + + demo test-realm is deployed. DO NOT USE IN PRODUCTION! + + diff --git a/tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java b/tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java index 9d34984b173..30b8d52bde0 100644 --- a/tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java +++ b/tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java @@ -49,7 +49,6 @@ import org.eclipse.jetty.server.session.DefaultSessionCache; import org.eclipse.jetty.server.session.FileSessionDataStore; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.log.StdErrLog; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.webapp.Configurations; import org.eclipse.jetty.webapp.MetaInfConfiguration; @@ -63,8 +62,6 @@ public class TestServer public static void main(String[] args) throws Exception { - ((StdErrLog)Log.getLog()).setSource(false); - // TODO don't depend on this file structure Path jettyRoot = FileSystems.getDefault().getPath(".").toAbsolutePath().normalize(); if (!Files.exists(jettyRoot.resolve("VERSION.txt"))) diff --git a/tests/test-webapps/test-jetty-webapp/src/test/resources/jetty-logging.properties b/tests/test-webapps/test-jetty-webapp/src/test/resources/jetty-logging.properties index 606fca83005..04724735a9d 100644 --- a/tests/test-webapps/test-jetty-webapp/src/test/resources/jetty-logging.properties +++ b/tests/test-webapps/test-jetty-webapp/src/test/resources/jetty-logging.properties @@ -1,3 +1,3 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +# Jetty Logging using jetty-slf4j-impl com.acme.LEVEL=INFO # org.eclipse.jetty.annotations.LEVEL=DEBUG \ No newline at end of file diff --git a/tests/test-webapps/test-proxy-webapp/src/test/java/org/eclipse/jetty/TestTransparentProxyServer.java b/tests/test-webapps/test-proxy-webapp/src/test/java/org/eclipse/jetty/TestTransparentProxyServer.java index 844b756c225..697941589c9 100644 --- a/tests/test-webapps/test-proxy-webapp/src/test/java/org/eclipse/jetty/TestTransparentProxyServer.java +++ b/tests/test-webapps/test-proxy-webapp/src/test/java/org/eclipse/jetty/TestTransparentProxyServer.java @@ -36,7 +36,6 @@ import org.eclipse.jetty.server.handler.ContextHandlerCollection; import org.eclipse.jetty.server.handler.DefaultHandler; import org.eclipse.jetty.server.handler.HandlerCollection; import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.StdErrLog; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.webapp.WebAppContext; @@ -47,8 +46,6 @@ public class TestTransparentProxyServer { public static void main(String[] args) throws Exception { - ((StdErrLog)Log.getLog()).setSource(false); - String jettyRoot = "../../.."; // Setup Threadpool From 57604d09558443dd80346f7bc63980481c2dea3c Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 18 Feb 2020 10:40:20 -0600 Subject: [PATCH 16/16] Issue #4572 - Mechanical Change to use org.slf4j Signed-off-by: Joakim Erdfelt --- apache-jsp/pom.xml | 10 ++ apache-jsp/src/main/java/module-info.java | 2 +- .../jetty/embedded/JettyDistribution.java | 10 +- .../jetty/embedded/WebSocketServerTest.java | 8 +- jetty-alpn/jetty-alpn-client/pom.xml | 10 ++ .../client/ALPNClientConnectionFactory.java | 8 +- .../jetty-alpn-conscrypt-client/pom.xml | 11 ++ .../client/ConscryptClientALPNProcessor.java | 8 +- .../server/ConscryptServerALPNProcessor.java | 6 +- jetty-alpn/jetty-alpn-java-client/pom.xml | 10 ++ .../java/client/JDK9ClientALPNProcessor.java | 6 +- .../java/server/JDK9ServerALPNProcessor.java | 6 +- .../alpn/server/ALPNServerConnection.java | 6 +- .../server/ALPNServerConnectionFactory.java | 10 +- .../annotations/AnnotationConfiguration.java | 19 +- .../annotations/AnnotationIntrospector.java | 41 +++-- .../jetty/annotations/AnnotationParser.java | 6 +- .../annotations/ClassInheritanceHandler.java | 8 +- .../DeclareRolesAnnotationHandler.java | 6 +- .../ResourceAnnotationHandler.java | 16 +- .../ResourcesAnnotationHandler.java | 8 +- .../annotations/RunAsAnnotationHandler.java | 6 +- .../ServletContainerInitializersStarter.java | 8 +- .../ServletSecurityAnnotationHandler.java | 6 +- .../annotations/WebFilterAnnotation.java | 6 +- .../WebFilterAnnotationHandler.java | 6 +- .../annotations/WebListenerAnnotation.java | 8 +- .../WebListenerAnnotationHandler.java | 6 +- .../annotations/WebServletAnnotation.java | 6 +- .../WebServletAnnotationHandler.java | 6 +- .../TestAnnotationConfiguration.java | 2 - .../annotations/TestAnnotationDecorator.java | 10 +- .../resources/TestResourceAnnotations.java | 2 +- .../src/test/resources/web-fragment4false.xml | 6 +- .../src/test/resources/web-fragment4true.xml | 7 +- .../eclipse/jetty/ant/AntWebAppContext.java | 8 +- .../jetty/ant/AntWebXmlConfiguration.java | 6 +- .../cdi/CdiServletContainerInitializer.java | 6 +- .../eclipse/jetty/cdi/CdiSpiDecorator.java | 6 +- jetty-client/src/main/java/module-info.java | 1 + .../jetty/client/AbstractConnectionPool.java | 6 +- .../client/AbstractHttpClientTransport.java | 6 +- .../client/AuthenticationProtocolHandler.java | 6 +- .../jetty/client/DuplexConnectionPool.java | 6 +- .../org/eclipse/jetty/client/HttpChannel.java | 6 +- .../org/eclipse/jetty/client/HttpClient.java | 6 +- .../eclipse/jetty/client/HttpConnection.java | 6 +- .../org/eclipse/jetty/client/HttpContent.java | 6 +- .../jetty/client/HttpConversation.java | 6 +- .../eclipse/jetty/client/HttpDestination.java | 6 +- .../eclipse/jetty/client/HttpExchange.java | 6 +- .../org/eclipse/jetty/client/HttpProxy.java | 6 +- .../eclipse/jetty/client/HttpReceiver.java | 8 +- .../eclipse/jetty/client/HttpRedirector.java | 6 +- .../org/eclipse/jetty/client/HttpSender.java | 12 +- .../client/LeakTrackingConnectionPool.java | 6 +- .../jetty/client/MultiplexConnectionPool.java | 6 +- .../ProxyProtocolClientConnectionFactory.java | 6 +- .../eclipse/jetty/client/RequestNotifier.java | 6 +- .../jetty/client/ResponseNotifier.java | 6 +- .../org/eclipse/jetty/client/Socks4Proxy.java | 6 +- .../jetty/client/TimeoutCompleteListener.java | 6 +- .../client/ValidatingConnectionPool.java | 6 +- .../client/http/HttpConnectionOverHTTP.java | 6 +- .../client/http/HttpReceiverOverHTTP.java | 6 +- .../jetty/client/http/HttpSenderOverHTTP.java | 4 +- .../ProxyProtocolClientConnectionFactory.java | 6 +- .../util/InputStreamContentProvider.java | 10 +- .../util/InputStreamResponseListener.java | 6 +- .../client/util/MultiPartContentProvider.java | 6 +- .../client/util/PathContentProvider.java | 8 +- .../client/util/SPNEGOAuthentication.java | 6 +- .../client/HttpConnectionLifecycleTest.java | 7 +- .../eclipse/jetty/client/LivelockTest.java | 10 +- .../jetty/client/ssl/SslBytesTest.java | 11 +- .../client/util/SPNEGOAuthenticationTest.java | 6 +- jetty-deploy/pom.xml | 10 ++ .../eclipse/jetty/deploy/AppLifeCycle.java | 6 +- .../jetty/deploy/DeploymentManager.java | 8 +- .../jetty/deploy/bindings/DebugBinding.java | 6 +- .../bindings/GlobalWebappConfigBinding.java | 6 +- .../deploy/providers/ScanningAppProvider.java | 6 +- .../jetty/deploy/doc-files/AppLifeCycle.svg | 30 +--- .../doc-files/DefaultAppLifeCycleBindings.svg | 42 +---- .../deploy/doc-files/DeploymentManager.svg | 30 +--- .../doc-files/DeploymentManager_Roles.svg | 30 +--- ...ScanningAppProviderRuntimeUpdatesTest.java | 8 +- jetty-fcgi/fcgi-client/pom.xml | 10 ++ .../client/http/HttpConnectionOverFCGI.java | 10 +- .../eclipse/jetty/fcgi/generator/Flusher.java | 6 +- .../jetty/fcgi/parser/HeaderParser.java | 6 +- .../fcgi/parser/ParamsContentParser.java | 6 +- .../org/eclipse/jetty/fcgi/parser/Parser.java | 6 +- .../fcgi/parser/ResponseContentParser.java | 6 +- .../fcgi/parser/StreamContentParser.java | 6 +- jetty-fcgi/fcgi-server/pom.xml | 10 ++ .../src/main/java/module-info.java | 2 +- .../fcgi/server/HttpChannelOverFCGI.java | 6 +- .../fcgi/server/HttpTransportOverFCGI.java | 6 +- .../fcgi/server/ServerFCGIConnection.java | 8 +- .../session/GCloudSessionDataStore.java | 12 +- .../config/etc/sessions/hazelcast/remote.xml | 28 ++- .../session/HazelcastSessionDataStore.java | 6 +- .../HazelcastSessionDataStoreFactory.java | 9 +- .../jetty/http/spi/HttpSpiContextHandler.java | 8 +- .../jetty/http/spi/JettyHttpServer.java | 8 +- jetty-http/pom.xml | 6 + .../org/eclipse/jetty/http/CookieCutter.java | 8 +- .../eclipse/jetty/http/HttpCompliance.java | 6 +- .../org/eclipse/jetty/http/HttpCookie.java | 6 +- .../org/eclipse/jetty/http/HttpFields.java | 8 +- .../org/eclipse/jetty/http/HttpGenerator.java | 10 +- .../org/eclipse/jetty/http/HttpParser.java | 8 +- .../org/eclipse/jetty/http/MimeTypes.java | 30 ++-- .../jetty/http/PreEncodedHttpField.java | 8 +- .../eclipse/jetty/http/QuotedQualityCSV.java | 7 +- .../jetty/http/pathmap/PathMappings.java | 6 +- .../jetty/http/pathmap/ServletPathSpec.java | 6 +- .../http/pathmap/UriTemplatePathSpec.java | 6 +- .../eclipse/jetty/http/HttpCookieTest.java | 9 - jetty-http2/http2-client/pom.xml | 10 ++ .../http2/client/HTTP2ClientSession.java | 6 +- .../jetty/http2/client/IdleTimeoutTest.java | 4 +- .../jetty/http2/client/InterleavingTest.java | 6 +- .../jetty/http2/client/RawHTTP2ProxyTest.java | 6 +- .../http2/client/SmallThreadPoolLoadTest.java | 6 +- jetty-http2/http2-common/pom.xml | 11 ++ .../http2/AbstractFlowControlStrategy.java | 6 +- .../eclipse/jetty/http2/HTTP2Connection.java | 6 +- .../org/eclipse/jetty/http2/HTTP2Flusher.java | 6 +- .../org/eclipse/jetty/http2/HTTP2Session.java | 14 +- .../org/eclipse/jetty/http2/HTTP2Stream.java | 6 +- .../jetty/http2/HTTP2StreamEndPoint.java | 6 +- .../jetty/http2/parser/BodyParser.java | 6 +- .../jetty/http2/parser/HeaderBlockParser.java | 12 +- .../eclipse/jetty/http2/parser/Parser.java | 8 +- .../jetty/http2/parser/PrefaceParser.java | 6 +- .../jetty/http2/parser/ServerParser.java | 8 +- .../http2/parser/SettingsBodyParser.java | 6 +- jetty-http2/http2-hpack/pom.xml | 10 ++ .../jetty/http2/hpack/HpackContext.java | 6 +- .../jetty/http2/hpack/HpackDecoder.java | 6 +- .../jetty/http2/hpack/HpackEncoder.java | 6 +- .../http2-http-client-transport/pom.xml | 11 ++ .../http/ClientHTTP2StreamEndPoint.java | 6 +- .../client/http/HttpChannelOverHTTP2.java | 2 +- .../client/http/HttpConnectionOverHTTP2.java | 6 +- jetty-http2/http2-server/pom.xml | 10 ++ .../server/HTTP2CServerConnectionFactory.java | 6 +- .../server/HTTP2ServerConnectionFactory.java | 6 +- .../http2/server/HTTP2ServerSession.java | 6 +- .../http2/server/HttpChannelOverHTTP2.java | 6 +- .../http2/server/HttpTransportOverHTTP2.java | 6 +- .../server/ServerHTTP2StreamEndPoint.java | 6 +- .../InfinispanSessionDataStore.java | 6 +- jetty-io/pom.xml | 10 ++ .../eclipse/jetty/io/AbstractConnection.java | 10 +- .../eclipse/jetty/io/AbstractEndPoint.java | 6 +- .../eclipse/jetty/io/ByteArrayEndPoint.java | 8 +- .../org/eclipse/jetty/io/ChannelEndPoint.java | 12 +- .../org/eclipse/jetty/io/ClientConnector.java | 8 +- .../org/eclipse/jetty/io/CyclicTimeout.java | 6 +- .../org/eclipse/jetty/io/FillInterest.java | 6 +- .../org/eclipse/jetty/io/IdleTimeout.java | 6 +- .../jetty/io/LeakTrackingByteBufferPool.java | 6 +- .../org/eclipse/jetty/io/ManagedSelector.java | 31 ++-- .../jetty/io/NegotiatingClientConnection.java | 10 +- .../NetworkTrafficSelectChannelEndPoint.java | 14 +- .../org/eclipse/jetty/io/SelectorManager.java | 12 +- .../jetty/io/SocketChannelEndPoint.java | 8 +- .../org/eclipse/jetty/io/WriteFlusher.java | 10 +- .../eclipse/jetty/io/ssl/SslConnection.java | 22 +-- .../jetty/io/SocketChannelEndPointTest.java | 12 +- .../eclipse/jetty/io/SslConnectionTest.java | 9 +- .../eclipse/jetty/jaas/JAASLoginService.java | 10 +- .../jaas/spi/AbstractDatabaseLoginModule.java | 6 +- .../jetty/jaas/spi/JDBCLoginModule.java | 6 +- .../jetty/jaas/spi/LdapLoginModule.java | 16 +- .../jaas/spi/PropertyFileLoginModule.java | 6 +- .../security/jaspi/JaspiAuthenticator.java | 6 +- .../jaspi/JaspiAuthenticatorFactory.java | 8 +- .../jetty/security/jaspi/BasicAuthModule.java | 6 +- jetty-jmx/pom.xml | 9 +- jetty-jmx/src/main/config/etc/jetty-jmx.xml | 7 - .../eclipse/jetty/jmx/ConnectorServer.java | 10 +- .../org/eclipse/jetty/jmx/MBeanContainer.java | 10 +- .../java/org/eclipse/jetty/jmx/MetaData.java | 6 +- .../org/eclipse/jetty/jmx/ObjectMBean.java | 10 +- .../test/java/com/acme/jmx/DerivedMBean.java | 6 +- .../eclipse/jetty/jndi/ContextFactory.java | 6 +- .../eclipse/jetty/jndi/DataSourceCloser.java | 10 +- .../jetty/jndi/InitialContextFactory.java | 6 +- .../org/eclipse/jetty/jndi/NamingContext.java | 6 +- .../org/eclipse/jetty/jndi/NamingUtil.java | 6 +- .../jetty/jndi/java/javaRootURLContext.java | 8 +- .../jndi/java/javaURLContextFactory.java | 6 +- .../jetty/jndi/local/localContextRoot.java | 8 +- .../org/eclipse/jetty/jndi/java/TestJNDI.java | 6 +- .../nosql/mongodb/MongoSessionDataStore.java | 6 +- .../jetty/security/openid/JwtDecoder.java | 6 +- .../security/openid/OpenIdAuthenticator.java | 6 +- .../security/openid/OpenIdConfiguration.java | 6 +- .../security/openid/OpenIdCredentials.java | 6 +- .../security/openid/OpenIdLoginService.java | 8 +- .../jasper/ContainerTldBundleDiscoverer.java | 6 +- .../boot/jasper/JSTLBundleDiscoverer.java | 6 +- .../annotations/AnnotationConfiguration.java | 6 +- .../osgi/boot/AbstractContextProvider.java | 6 +- .../jetty/osgi/boot/AbstractOSGiApp.java | 8 +- .../osgi/boot/AbstractWebAppProvider.java | 6 +- .../osgi/boot/BundleContextProvider.java | 12 +- .../jetty/osgi/boot/BundleWebAppProvider.java | 12 +- .../osgi/boot/JettyBootstrapActivator.java | 6 +- .../osgi/boot/OSGiMetaInfConfiguration.java | 6 +- .../osgi/boot/ServiceContextProvider.java | 8 +- .../osgi/boot/ServiceWebAppProvider.java | 8 +- .../DefaultJettyAtJettyHomeHelper.java | 8 +- .../JettyServerServiceTracker.java | 12 +- .../serverfactory/ServerInstanceWrapper.java | 20 +-- .../webapp/OSGiWebappClassLoader.java | 12 +- .../utils/BundleClassLoaderHelperFactory.java | 8 +- .../utils/BundleFileLocatorHelperFactory.java | 8 +- .../osgi/boot/utils/OSGiClassLoader.java | 6 +- .../DefaultBundleClassLoaderHelper.java | 46 +++-- jetty-osgi/test-jetty-osgi/pom.xml | 6 + .../main/resources/jetty-logging.properties | 2 +- .../src/test/resources/log4j.properties | 16 -- .../src/test/resources/log4j.xml | 28 +++ .../plus/annotation/ContainerInitializer.java | 6 +- .../jetty/plus/annotation/Injection.java | 10 +- .../plus/annotation/InjectionCollection.java | 6 +- .../LifeCycleCallbackCollection.java | 6 +- .../plus/annotation/PreDestroyCallback.java | 6 +- .../plus/annotation/RunAsCollection.java | 6 +- .../eclipse/jetty/plus/jndi/NamingEntry.java | 10 +- .../jetty/plus/jndi/NamingEntryUtil.java | 8 +- .../eclipse/jetty/plus/jndi/Transaction.java | 8 +- .../plus/security/DataSourceLoginService.java | 6 +- .../jetty/plus/webapp/EnvConfiguration.java | 10 +- .../jetty/plus/webapp/PlusConfiguration.java | 6 +- .../jetty/plus/webapp/PlusDecorator.java | 6 +- .../plus/webapp/PlusDescriptorProcessor.java | 6 +- jetty-proxy/pom.xml | 10 ++ .../jetty/proxy/AfterContentTransformer.java | 8 +- .../jetty/proxy/AsyncMiddleManServlet.java | 6 +- .../eclipse/jetty/proxy/ConnectHandler.java | 8 +- .../eclipse/jetty/proxy/ProxyConnection.java | 2 +- .../proxy/AsyncMiddleManServletTest.java | 6 +- .../jetty/proxy/ProxyServletLoadTest.java | 6 +- .../jetty/quickstart/AttributeNormalizer.java | 10 +- .../ExtraXmlDescriptorProcessor.java | 6 +- .../quickstart/PreconfigureQuickStartWar.java | 6 +- .../quickstart/QuickStartConfiguration.java | 6 +- .../QuickStartGeneratorConfiguration.java | 6 +- .../config/modules/rewrite-customizer.mod | 2 +- .../src/main/config/modules/rewrite.mod | 4 +- .../jetty/rewrite/handler/RuleContainer.java | 6 +- .../jetty/rewrite/handler/ValidUrlRule.java | 6 +- .../java/org/eclipse/jetty/runner/Runner.java | 6 +- jetty-security/pom.xml | 10 ++ .../jetty/security/AbstractLoginService.java | 6 +- .../ConfigurableSpnegoLoginService.java | 6 +- .../security/ConstraintSecurityHandler.java | 12 +- .../jetty/security/HashLoginService.java | 6 +- .../jetty/security/JDBCLoginService.java | 8 +- .../jetty/security/PropertyUserStore.java | 8 +- .../jetty/security/SecurityHandler.java | 6 +- .../ConfigurableSpnegoAuthenticator.java | 6 +- .../DeferredAuthentication.java | 10 +- .../authentication/DigestAuthenticator.java | 10 +- .../authentication/FormAuthenticator.java | 6 +- .../authentication/LoginAuthenticator.java | 6 +- .../authentication/SessionAuthentication.java | 6 +- .../test/resources/jetty-logging.properties | 1 - .../main/config/modules/bytebufferpool.mod | 3 + .../src/main/config/modules/server.mod | 2 +- .../src/main/config/modules/threadpool.mod | 3 + jetty-server/src/main/java/module-info.java | 2 +- .../jetty/server/AbstractConnector.java | 16 +- .../server/AbstractNetworkConnector.java | 2 +- .../eclipse/jetty/server/AcceptRateLimit.java | 6 +- .../jetty/server/AsyncRequestLogWriter.java | 10 +- .../jetty/server/CachedContentFactory.java | 12 +- .../eclipse/jetty/server/ConnectionLimit.java | 6 +- .../org/eclipse/jetty/server/Cookies.java | 9 +- .../jetty/server/CustomRequestLog.java | 8 +- .../eclipse/jetty/server/DebugListener.java | 10 +- .../server/DetectorConnectionFactory.java | 6 +- .../org/eclipse/jetty/server/Dispatcher.java | 6 +- .../eclipse/jetty/server/HomeBaseWarning.java | 8 +- .../org/eclipse/jetty/server/HttpChannel.java | 18 +- .../jetty/server/HttpChannelListeners.java | 6 +- .../jetty/server/HttpChannelOverHttp.java | 8 +- .../jetty/server/HttpChannelState.java | 32 ++-- .../eclipse/jetty/server/HttpConnection.java | 40 ++--- .../org/eclipse/jetty/server/HttpInput.java | 27 +-- .../org/eclipse/jetty/server/HttpOutput.java | 15 +- .../jetty/server/InclusiveByteRange.java | 10 +- .../eclipse/jetty/server/LocalConnector.java | 4 +- .../jetty/server/LowResourceMonitor.java | 6 +- .../server/MultiPartFormInputStream.java | 6 +- .../eclipse/jetty/server/MultiPartParser.java | 6 +- .../server/NegotiatingServerConnection.java | 8 +- .../server/OptionalSslConnectionFactory.java | 6 +- .../jetty/server/ProxyConnectionFactory.java | 6 +- .../eclipse/jetty/server/PushBuilderImpl.java | 6 +- .../org/eclipse/jetty/server/Request.java | 38 ++-- .../jetty/server/RequestLogWriter.java | 10 +- .../eclipse/jetty/server/ResourceService.java | 13 +- .../org/eclipse/jetty/server/Response.java | 6 +- .../eclipse/jetty/server/ResponseWriter.java | 24 +-- .../jetty/server/SameFileAliasChecker.java | 8 +- .../jetty/server/SecureRequestCustomizer.java | 8 +- .../java/org/eclipse/jetty/server/Server.java | 8 +- .../eclipse/jetty/server/ServerConnector.java | 4 +- .../jetty/server/handler/AbstractHandler.java | 6 +- .../handler/AbstractHandlerContainer.java | 6 +- .../handler/AllowSymLinkAliasChecker.java | 8 +- .../handler/BufferedResponseHandler.java | 6 +- .../jetty/server/handler/ContextHandler.java | 34 ++-- .../handler/ContextHandlerCollection.java | 6 +- .../jetty/server/handler/DefaultHandler.java | 11 +- .../jetty/server/handler/ErrorHandler.java | 17 +- .../server/handler/InetAccessHandler.java | 14 +- .../handler/ManagedAttributeListener.java | 6 +- .../jetty/server/handler/ResourceHandler.java | 14 +- .../jetty/server/handler/ShutdownHandler.java | 8 +- .../server/handler/StatisticsHandler.java | 6 +- .../server/handler/ThreadLimitHandler.java | 8 +- .../server/handler/gzip/GzipHandler.java | 6 +- .../gzip/GzipHttpOutputInterceptor.java | 6 +- .../handler/jmx/AbstractHandlerMBean.java | 8 +- .../resource/HttpContentRangeWriter.java | 6 +- .../server/session/AbstractSessionCache.java | 12 +- .../session/AbstractSessionDataStore.java | 6 +- .../session/CachingSessionDataStore.java | 10 +- .../jetty/server/session/DatabaseAdaptor.java | 6 +- .../server/session/DefaultSessionCache.java | 10 +- .../session/DefaultSessionIdManager.java | 9 +- .../server/session/FileSessionDataStore.java | 18 +- .../jetty/server/session/HouseKeeper.java | 8 +- .../server/session/JDBCSessionDataStore.java | 11 +- .../server/session/NullSessionCache.java | 5 + .../session/NullSessionCacheFactory.java | 6 +- .../eclipse/jetty/server/session/Session.java | 8 +- .../jetty/server/session/SessionData.java | 6 +- .../jetty/server/session/SessionHandler.java | 77 +++++---- .../eclipse/jetty/server/AsyncStressTest.java | 9 +- .../jetty/server/ConnectorTimeoutTest.java | 10 +- .../server/CustomResourcesMonitorTest.java | 6 +- .../org/eclipse/jetty/server/DumpHandler.java | 13 +- .../jetty/server/HttpConnectionTest.java | 7 +- .../jetty/server/HttpServerTestBase.java | 26 +-- .../jetty/server/HttpServerTestFixture.java | 12 +- .../jetty/server/LocalAsyncContextTest.java | 6 +- .../jetty/server/NotAcceptingTest.java | 10 +- .../org/eclipse/jetty/server/RequestTest.java | 54 +++--- .../eclipse/jetty/server/ResponseTest.java | 1 - .../org/eclipse/jetty/server/StopTest.java | 10 +- .../org/eclipse/jetty/server/StressTest.java | 6 +- .../server/handler/InetAccessHandlerTest.java | 142 +++++++-------- .../server/handler/NcsaRequestLogTest.java | 7 +- .../ssl/SelectChannelServerSslTest.java | 11 +- .../jetty/server/ssl/SlowClientsTest.java | 6 +- jetty-servlet/pom.xml | 10 ++ .../org/eclipse/jetty/servlet/BaseHolder.java | 9 +- .../eclipse/jetty/servlet/DefaultServlet.java | 17 +- .../jetty/servlet/ErrorPageErrorHandler.java | 6 +- .../eclipse/jetty/servlet/FilterHolder.java | 7 +- .../org/eclipse/jetty/servlet/Holder.java | 6 +- .../org/eclipse/jetty/servlet/Invoker.java | 10 +- .../eclipse/jetty/servlet/ListenerHolder.java | 3 +- .../jetty/servlet/ServletContextHandler.java | 8 +- .../eclipse/jetty/servlet/ServletHandler.java | 43 ++--- .../eclipse/jetty/servlet/ServletHolder.java | 28 ++- .../org/eclipse/jetty/servlet/Source.java | 2 +- .../jetty/servlet/StatisticsServlet.java | 6 +- .../servlet/listener/ELContextCleaner.java | 6 +- .../jetty/servlet/AsyncServletIOTest.java | 6 +- .../eclipse/jetty/servlet/DispatcherTest.java | 13 +- .../eclipse/jetty/servlet/ErrorPageTest.java | 11 +- .../jetty/servlet/ListenerHolderTest.java | 4 +- .../jetty/servlet/MultiPartServletTest.java | 6 +- .../jetty/servlet/PostServletTest.java | 6 +- .../servlet/ServletContextHandlerTest.java | 2 +- .../jetty/servlet/ServletRequestLogTest.java | 6 +- .../eclipse/jetty/servlet/ServletTester.java | 6 +- jetty-servlets/pom.xml | 10 ++ .../java/org/eclipse/jetty/servlets/CGI.java | 31 ++-- .../jetty/servlets/CrossOriginFilter.java | 7 +- .../org/eclipse/jetty/servlets/DoSFilter.java | 14 +- .../eclipse/jetty/servlets/HeaderFilter.java | 6 +- .../servlets/IncludeExcludeBasedFilter.java | 6 +- .../jetty/servlets/PushCacheFilter.java | 6 +- .../servlets/PushSessionCacheFilter.java | 6 +- .../org/eclipse/jetty/servlets/QoSFilter.java | 8 +- .../jetty/servlets/AsyncManipFilter.java | 6 +- .../eclipse/jetty/servlets/GzipTester.java | 6 +- .../eclipse/jetty/servlets/QoSFilterTest.java | 6 +- jetty-servlets/src/test/resources/test.svg | 46 +---- jetty-slf4j-impl/pom.xml | 4 +- jetty-spring/pom.xml | 11 ++ .../spring/SpringConfigurationProcessor.java | 6 +- .../jetty-unixsocket-client/pom.xml | 10 ++ .../HttpClientTransportOverUnixSockets.java | 6 +- .../jetty/unixsocket/UnixSocketTest.java | 6 +- .../jetty-unixsocket-common/pom.xml | 10 ++ .../unixsocket/common/UnixSocketEndPoint.java | 8 +- .../server/UnixSocketConnector.java | 10 +- jetty-util-ajax/pom.xml | 11 ++ .../org/eclipse/jetty/util/ajax/JSON.java | 6 +- .../jetty/util/ajax/JSONDateConvertor.java | 8 +- .../jetty/util/ajax/JSONEnumConvertor.java | 12 +- .../jetty/util/ajax/JSONPojoConvertor.java | 10 +- .../util/ajax/JSONPojoConvertorFactory.java | 5 +- jetty-util/pom.xml | 8 +- jetty-util/src/main/java/module-info.java | 2 + .../org/eclipse/jetty/util/BufferUtil.java | 17 +- .../jetty/util/DecoratedObjectFactory.java | 16 +- .../jetty/util/DeprecationWarning.java | 10 +- .../java/org/eclipse/jetty/util/HostPort.java | 1 - .../main/java/org/eclipse/jetty/util/IO.java | 12 +- .../java/org/eclipse/jetty/util/Jetty.java | 10 +- .../org/eclipse/jetty/util/LeakDetector.java | 6 +- .../org/eclipse/jetty/util/PathWatcher.java | 22 +-- .../java/org/eclipse/jetty/util/Promise.java | 4 +- .../java/org/eclipse/jetty/util/Scanner.java | 14 +- .../jetty/util/SharedBlockingCallback.java | 17 +- .../jetty/util/SocketAddressResolver.java | 6 +- .../java/org/eclipse/jetty/util/TypeUtil.java | 10 +- .../java/org/eclipse/jetty/util/URIUtil.java | 6 +- .../org/eclipse/jetty/util/UrlEncoded.java | 21 ++- .../eclipse/jetty/util/Utf8Appendable.java | 8 +- .../util/component/AbstractLifeCycle.java | 8 +- .../util/component/ContainerLifeCycle.java | 10 +- .../jetty/util/component/FileDestroyable.java | 6 +- .../FileNoticeLifeCycleListener.java | 8 +- .../jetty/util/component/Graceful.java | 6 +- .../jetty/util/component/StopLifeCycle.java | 8 +- .../preventers/AbstractLeakPreventer.java | 6 +- .../util/preventers/DOMLeakPreventer.java | 2 +- .../preventers/GCThreadLeakPreventer.java | 4 +- .../util/preventers/Java2DLeakPreventer.java | 2 +- .../util/preventers/LDAPLeakPreventer.java | 2 +- .../LoginConfigurationLeakPreventer.java | 2 +- .../jetty/util/resource/JarFileResource.java | 18 +- .../jetty/util/resource/JarResource.java | 8 +- .../jetty/util/resource/PathResource.java | 25 ++- .../eclipse/jetty/util/resource/Resource.java | 12 +- .../jetty/util/resource/URLResource.java | 12 +- .../util/security/CertificateValidator.java | 12 +- .../jetty/util/security/Credential.java | 12 +- .../eclipse/jetty/util/security/Password.java | 8 +- .../util/ssl/SniX509ExtendedKeyManager.java | 6 +- .../jetty/util/ssl/SslContextFactory.java | 56 +++--- .../java/org/eclipse/jetty/util/ssl/X509.java | 6 +- .../jetty/util/thread/QueuedThreadPool.java | 12 +- .../util/thread/ReservedThreadExecutor.java | 14 +- .../jetty/util/thread/SerializedExecutor.java | 4 +- .../jetty/util/thread/ShutdownThread.java | 12 +- .../eclipse/jetty/util/thread/Sweeper.java | 6 +- .../jetty/util/thread/ThreadPoolBudget.java | 6 +- .../jetty/util/thread/TimerScheduler.java | 6 +- .../util/thread/strategy/EatWhatYouKill.java | 20 +-- .../strategy/ExecuteProduceConsume.java | 6 +- .../util/thread/strategy/ProduceConsume.java | 6 +- .../strategy/ProduceExecuteConsume.java | 6 +- .../eclipse/jetty/util/BufferUtilTest.java | 6 +- .../org/eclipse/jetty/util/HostPortTest.java | 2 +- .../eclipse/jetty/util/PathWatcherDemo.java | 12 +- .../eclipse/jetty/util/PathWatcherTest.java | 6 +- .../jetty/util/QueueBenchmarkTest.java | 6 +- .../util/SharedBlockingCallbackTest.java | 6 +- .../org/eclipse/jetty/util/URIUtilTest.java | 6 +- .../jetty/util/UrlEncodedUtf8Test.java | 11 +- .../jetty/util/resource/PathResourceTest.java | 2 - .../util/resource/ResourceAliasTest.java | 7 +- .../jetty/util/thread/EatWhatYouKillTest.java | 2 +- .../util/thread/QueuedThreadPoolTest.java | 8 +- .../jetty/util/thread/SweeperTest.java | 2 +- jetty-webapp/pom.xml | 10 ++ .../webapp/CachingWebAppClassLoader.java | 9 +- .../eclipse/jetty/webapp/ClassMatcher.java | 10 +- .../eclipse/jetty/webapp/Configurations.java | 10 +- .../org/eclipse/jetty/webapp/Descriptor.java | 2 +- .../jetty/webapp/DiscoveredAnnotation.java | 12 +- .../jetty/webapp/JaasConfiguration.java | 8 +- .../webapp/JettyWebXmlConfiguration.java | 6 +- .../jetty/webapp/JmxConfiguration.java | 8 +- .../jetty/webapp/JndiConfiguration.java | 8 +- .../jetty/webapp/JspConfiguration.java | 8 +- .../org/eclipse/jetty/webapp/MetaData.java | 62 +++---- .../jetty/webapp/MetaInfConfiguration.java | 8 +- .../jetty/webapp/ServletsConfiguration.java | 8 +- .../webapp/StandardDescriptorProcessor.java | 163 +++++++++++------- .../jetty/webapp/WebAppClassLoader.java | 8 +- .../eclipse/jetty/webapp/WebAppContext.java | 10 +- .../eclipse/jetty/webapp/WebDescriptor.java | 25 ++- .../jetty/webapp/WebInfConfiguration.java | 6 +- .../jetty/webapp/WebXmlConfiguration.java | 6 +- .../java/org/acme/webapp/TestAnnotation.java | 2 +- .../eclipse/jetty/webapp/TestMetaData.java | 25 ++- jetty-websocket/websocket-core/pom.xml | 10 ++ .../websocket/core/AbstractExtension.java | 6 +- .../eclipse/jetty/websocket/core/Frame.java | 1 + .../jetty/websocket/core/MessageHandler.java | 6 +- .../core/client/ClientUpgradeRequest.java | 6 +- .../core/client/HttpClientProvider.java | 4 +- .../core/client/WebSocketCoreClient.java | 6 +- .../core/client/XmlHttpClientProvider.java | 7 +- .../core/internal/ExtensionStack.java | 6 +- .../core/internal/FragmentExtension.java | 6 +- .../core/internal/FragmentingFlusher.java | 6 +- .../core/internal/FrameCaptureExtension.java | 6 +- .../websocket/core/internal/FrameFlusher.java | 6 +- .../jetty/websocket/core/internal/Parser.java | 6 +- .../internal/PerMessageDeflateExtension.java | 6 +- .../core/internal/TransformingFlusher.java | 6 +- .../core/internal/ValidationExtension.java | 6 +- .../core/internal/WebSocketConnection.java | 6 +- .../core/internal/WebSocketCoreSession.java | 12 +- .../core/server/WebSocketUpgradeHandler.java | 6 +- .../server/internal/AbstractHandshaker.java | 6 +- .../jetty/websocket/core/GeneratorTest.java | 6 +- .../websocket/core/TestAsyncFrameHandler.java | 6 +- .../websocket/core/TestFrameHandler.java | 6 +- .../websocket/core/TestMessageHandler.java | 6 +- .../websocket/core/WebSocketCloseTest.java | 8 +- .../websocket/core/WebSocketOpenTest.java | 6 +- .../core/autobahn/CoreAutobahnClient.java | 6 +- .../core/chat/ChatWebSocketClient.java | 8 +- .../client/WebSocketClientServerTest.java | 6 +- .../core/extensions/ExtensionStackTest.java | 6 +- .../core/internal/FrameFlusherTest.java | 6 +- .../websocket/core/proxy/WebSocketProxy.java | 6 +- .../core/server/WebSocketServerTest.java | 6 +- .../common/JavaxWebSocketAsyncRemote.java | 6 +- .../common/JavaxWebSocketBasicRemote.java | 7 +- .../javax/common/JavaxWebSocketContainer.java | 6 +- .../common/JavaxWebSocketFrameHandler.java | 8 +- .../common/JavaxWebSocketRemoteEndpoint.java | 6 +- .../javax/common/JavaxWebSocketSession.java | 8 +- .../javax/common/SessionTracker.java | 8 +- .../common/messages/DecodedMessageSink.java | 6 +- .../endpoints/AbstractStringEndpoint.java | 6 +- .../main/config/modules/websocket-javax.mod | 6 +- .../config/ContainerDefaultConfigurator.java | 6 +- ...xWebSocketServletContainerInitializer.java | 6 +- .../internal/JavaxWebSocketCreator.java | 6 +- .../JavaxWebSocketServerContainer.java | 6 +- .../server/browser/JsrBrowserDebugTool.java | 8 +- .../server/browser/JsrBrowserSocket.java | 6 +- .../examples/WebSocketServerExamplesTest.java | 8 +- jetty-websocket/websocket-javax-tests/pom.xml | 5 + .../websocket/javax/tests/EventSocket.java | 6 +- .../jetty/websocket/javax/tests/Fuzzer.java | 6 +- .../websocket/javax/tests/LocalServer.java | 6 +- .../javax/tests/WSEndpointTracker.java | 6 +- .../websocket/javax/tests/WSEventTracker.java | 6 +- .../jetty/websocket/javax/tests/WSServer.java | 6 +- .../javax/tests/framehandlers/FrameEcho.java | 6 +- .../tests/autobahn/JavaxAutobahnClient.java | 6 +- .../tests/autobahn/JavaxAutobahnSocket.java | 6 +- .../tests/client/MessageReceivingTest.java | 12 +- .../javax/tests/coders/QuotesDecoder.java | 6 +- .../javax/tests/quotes/QuotesDecoder.java | 6 +- .../javax/tests/quotes/QuotesDecoderTest.java | 6 +- .../javax/tests/server/BinaryStreamTest.java | 6 +- .../javax/tests/server/ConfiguratorTest.java | 6 +- .../tests/server/EndpointViaConfigTest.java | 6 +- .../tests/server/InputStreamEchoTest.java | 6 +- .../javax/tests/server/PartialEchoTest.java | 6 +- .../javax/tests/server/PongSocket.java | 6 +- .../server/PrimitivesBinaryEchoTest.java | 6 +- .../tests/server/PrimitivesTextEchoTest.java | 6 +- .../javax/tests/server/ReaderEchoTest.java | 6 +- .../javax/tests/server/StreamTest.java | 6 +- .../javax/tests/server/TextStreamTest.java | 6 +- .../server/UriTemplateParameterTest.java | 6 +- .../server/sockets/ByteBufferSocket.java | 6 +- .../tests/server/sockets/DateTextSocket.java | 6 +- .../sockets/binary/ByteBufferSocket.java | 6 +- .../partial/PartialTextSessionSocket.java | 6 +- .../sockets/partial/PartialTextSocket.java | 6 +- .../BooleanObjectTextParamSocket.java | 6 +- .../primitives/BooleanObjectTextSocket.java | 6 +- .../primitives/BooleanTextParamSocket.java | 6 +- .../sockets/primitives/BooleanTextSocket.java | 6 +- .../primitives/ByteObjectTextSocket.java | 6 +- .../sockets/primitives/ByteTextSocket.java | 6 +- .../sockets/primitives/CharTextSocket.java | 6 +- .../primitives/CharacterObjectTextSocket.java | 6 +- .../primitives/DoubleObjectTextSocket.java | 6 +- .../sockets/primitives/DoubleTextSocket.java | 6 +- .../primitives/FloatObjectTextSocket.java | 6 +- .../sockets/primitives/FloatTextSocket.java | 6 +- .../primitives/IntParamTextSocket.java | 6 +- .../sockets/primitives/IntTextSocket.java | 6 +- .../IntegerObjectParamTextSocket.java | 6 +- .../primitives/IntegerObjectTextSocket.java | 6 +- .../primitives/LongObjectTextSocket.java | 6 +- .../sockets/primitives/LongTextSocket.java | 6 +- .../primitives/ShortObjectTextSocket.java | 6 +- .../sockets/primitives/ShortTextSocket.java | 6 +- .../sockets/streaming/InputStreamSocket.java | 6 +- .../sockets/streaming/ReaderParamSocket.java | 6 +- .../sockets/streaming/ReaderSocket.java | 6 +- .../StringReturnReaderParamSocket.java | 6 +- .../websocket/client/WebSocketClient.java | 6 +- .../common/JettyWebSocketFrameHandler.java | 6 +- .../common/JettyWebSocketRemoteEndpoint.java | 8 +- .../websocket/common/WebSocketSession.java | 6 +- .../common/MessageOutputStreamTest.java | 6 +- .../common/OutgoingMessageCapture.java | 6 +- .../main/config/modules/websocket-jetty.mod | 8 +- .../server/JettyWebSocketServerContainer.java | 6 +- .../config/JettyWebSocketConfiguration.java | 8 +- ...yWebSocketServletContainerInitializer.java | 6 +- .../server/browser/BrowserDebugTool.java | 8 +- .../server/browser/BrowserSocket.java | 8 +- jetty-websocket/websocket-jetty-tests/pom.xml | 7 + .../tests/CloseTrackingEndpoint.java | 6 +- .../jetty/websocket/tests/EventSocket.java | 6 +- .../tests/autobahn/JettyAutobahnClient.java | 6 +- .../tests/client/BadNetworkTest.java | 10 +- .../tests/client/ClientCloseTest.java | 12 +- .../tests/client/ClientWriteThread.java | 10 +- .../tests/server/AbstractCloseEndpoint.java | 6 +- .../tests/server/SlowServerEndpoint.java | 10 +- .../tests/util/FutureWriteCallback.java | 6 +- .../websocket/servlet/WebSocketMapping.java | 6 +- .../websocket/servlet/WebSocketServlet.java | 6 +- .../servlet/WebSocketUpgradeFilter.java | 6 +- .../util/messages/MessageInputStream.java | 6 +- .../util/messages/MessageOutputStream.java | 6 +- jetty-xml/pom.xml | 6 + .../eclipse/jetty/xml/XmlConfiguration.java | 26 +-- .../java/org/eclipse/jetty/xml/XmlParser.java | 22 +-- logos/jetty-avatar.svg | 43 +---- logos/jetty-logo-shadow.svg | 43 +---- logos/jetty-logo.svg | 52 +----- pom.xml | 35 ---- .../thread/strategy/jmh/TestConnection.java | 7 +- .../tests/distribution/DistributionTests.java | 2 - tests/test-http-client-transport/pom.xml | 6 + .../jetty/http/client/HttpClientLoadTest.java | 6 +- .../jetty/http/client/HttpClientTest.java | 1 - .../client/ProxyWithDynamicTransportTest.java | 6 +- .../jetty/http/client/TransportScenario.java | 12 +- tests/test-integration/pom.xml | 6 + .../jetty/test/FailedSelectorTest.java | 16 +- .../jsp/JspAndDefaultWithAliasesTest.java | 6 +- .../test/support/XmlBasedJettyServer.java | 6 +- .../test/support/rawhttp/HttpsSocketImpl.java | 6 +- .../test/websocket/JavaxSimpleEchoSocket.java | 8 +- .../test/websocket/JettySimpleEchoSocket.java | 8 +- .../jetty/test/jmx/CommonComponent.java | 6 +- .../test/jmx/MyContainerInitializer.java | 6 +- .../eclipse/jetty/test/jmx/PingServlet.java | 6 +- .../jetty/quickstart/PreconfigureJNDIWar.java | 6 +- .../jetty/quickstart/PreconfigureSpecWar.java | 6 +- .../PreconfigureStandardTestWar.java | 6 +- .../jetty/quickstart/QuickStartTest.java | 25 ++- .../test/resources/jetty-logging.properties | 2 +- .../test-sessions/test-jdbc-sessions/pom.xml | 10 ++ .../jetty/nosql/mongodb/MongoTestHelper.java | 6 +- .../test-sessions-common/pom.xml | 5 + .../session/AbstractSessionCacheTest.java | 3 +- .../server/session/DuplicateCookieTest.java | 2 +- tests/test-webapps/test-jetty-webapp/pom.xml | 8 + .../src/main/java/com/acme/ChatServlet.java | 6 +- .../src/main/java/com/acme/Dump.java | 6 +- .../main/java/com/acme/SecureModeServlet.java | 6 +- .../src/main/java/com/acme/TestFilter.java | 6 +- .../java/org/eclipse/jetty/TestServer.java | 9 +- .../jetty/TestTransparentProxyServer.java | 2 - .../src/main/webapp/WEB-INF/jetty-web.xml | 16 +- .../src/main/webapp/WEB-INF/web.xml | 2 +- .../websocket/OnCloseServerEndpoint.java | 7 +- .../websocket/OnOpenServerEndpoint.java | 7 +- 680 files changed, 3206 insertions(+), 3062 deletions(-) delete mode 100644 jetty-osgi/test-jetty-osgi/src/test/resources/log4j.properties create mode 100644 jetty-osgi/test-jetty-osgi/src/test/resources/log4j.xml diff --git a/apache-jsp/pom.xml b/apache-jsp/pom.xml index 4b0a2b9ddd1..5b38c489a61 100644 --- a/apache-jsp/pom.xml +++ b/apache-jsp/pom.xml @@ -85,6 +85,10 @@ jetty-annotations ${project.version} + + org.slf4j + slf4j-api + org.eclipse.jetty @@ -105,6 +109,12 @@ ${project.version} test + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/apache-jsp/src/main/java/module-info.java b/apache-jsp/src/main/java/module-info.java index 018320716a0..20f6efc0d1e 100644 --- a/apache-jsp/src/main/java/module-info.java +++ b/apache-jsp/src/main/java/module-info.java @@ -29,9 +29,9 @@ module org.eclipse.jetty.apache.jsp requires java.xml; requires jetty.servlet.api; - requires org.slf4j; requires org.eclipse.jetty.util; requires org.mortbay.apache.jasper; + requires org.slf4j; provides Log with JuliLog; provides ServletContainerInitializer with JettyJasperInitializer; diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/JettyDistribution.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/JettyDistribution.java index 91f362d4fd6..a94825be6f0 100644 --- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/JettyDistribution.java +++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/JettyDistribution.java @@ -23,8 +23,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A utility test class to locate a Jetty Distribution for testing purposes by searching: @@ -36,7 +36,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class JettyDistribution { - private static final Logger LOG = Log.getLogger(JettyDistribution.class); + private static final Logger LOG = LoggerFactory.getLogger(JettyDistribution.class); public static final Path DISTRIBUTION; static @@ -64,7 +64,7 @@ public class JettyDistribution } catch (Throwable th) { - LOG.warn(th); + LOG.warn("Unable to resolve Jetty Distribution location", th); } } @@ -119,7 +119,7 @@ public class JettyDistribution } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } return null; } diff --git a/examples/embedded/src/test/java/org/eclipse/jetty/embedded/WebSocketServerTest.java b/examples/embedded/src/test/java/org/eclipse/jetty/embedded/WebSocketServerTest.java index 099ced7edfc..4e80855d51d 100644 --- a/examples/embedded/src/test/java/org/eclipse/jetty/embedded/WebSocketServerTest.java +++ b/examples/embedded/src/test/java/org/eclipse/jetty/embedded/WebSocketServerTest.java @@ -25,8 +25,6 @@ import java.util.concurrent.LinkedBlockingQueue; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; @@ -37,6 +35,8 @@ import org.eclipse.jetty.websocket.client.WebSocketClient; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.util.concurrent.TimeUnit.SECONDS; import static org.hamcrest.MatcherAssert.assertThat; @@ -87,7 +87,7 @@ public class WebSocketServerTest @WebSocket public static class TrackingClientEndpoint { - private static final Logger LOG = Log.getLogger(TrackingClientEndpoint.class); + private static final Logger LOG = LoggerFactory.getLogger(TrackingClientEndpoint.class); public LinkedBlockingQueue messages = new LinkedBlockingQueue<>(); @OnWebSocketMessage @@ -99,7 +99,7 @@ public class WebSocketServerTest @OnWebSocketError public void onError(Throwable cause) { - LOG.warn(cause); + LOG.warn("TrackingClientEndpoint Error", cause); } @OnWebSocketClose diff --git a/jetty-alpn/jetty-alpn-client/pom.xml b/jetty-alpn/jetty-alpn-client/pom.xml index db889380de8..e7201256539 100644 --- a/jetty-alpn/jetty-alpn-client/pom.xml +++ b/jetty-alpn/jetty-alpn-client/pom.xml @@ -51,6 +51,16 @@ jetty-io ${project.version} + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory.java b/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory.java index 7ddf404f62e..fea5ed34923 100644 --- a/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory.java +++ b/jetty-alpn/jetty-alpn-client/src/main/java/org/eclipse/jetty/alpn/client/ALPNClientConnectionFactory.java @@ -32,12 +32,12 @@ import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.NegotiatingClientConnectionFactory; import org.eclipse.jetty.io.ssl.ALPNProcessor.Client; import org.eclipse.jetty.io.ssl.SslClientConnectionFactory; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ALPNClientConnectionFactory extends NegotiatingClientConnectionFactory { - private static final Logger LOG = Log.getLogger(ALPNClientConnectionFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(ALPNClientConnectionFactory.class); private final List processors = new ArrayList<>(); private final Executor executor; @@ -64,7 +64,7 @@ public class ALPNClientConnectionFactory extends NegotiatingClientConnectionFact catch (Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Unable to load client processor", x); failure.addSuppressed(x); continue; } diff --git a/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml b/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml index e2863c7231f..8251b50b33a 100644 --- a/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml +++ b/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml @@ -26,12 +26,23 @@ jetty-alpn-client ${project.version} + + org.slf4j + slf4j-api + + org.eclipse.jetty.http2 http2-client ${project.version} test + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + diff --git a/jetty-alpn/jetty-alpn-conscrypt-client/src/main/java/org/eclipse/jetty/alpn/conscrypt/client/ConscryptClientALPNProcessor.java b/jetty-alpn/jetty-alpn-conscrypt-client/src/main/java/org/eclipse/jetty/alpn/conscrypt/client/ConscryptClientALPNProcessor.java index d32edd7f4c6..681d708a3a5 100644 --- a/jetty-alpn/jetty-alpn-conscrypt-client/src/main/java/org/eclipse/jetty/alpn/conscrypt/client/ConscryptClientALPNProcessor.java +++ b/jetty-alpn/jetty-alpn-conscrypt-client/src/main/java/org/eclipse/jetty/alpn/conscrypt/client/ConscryptClientALPNProcessor.java @@ -28,12 +28,12 @@ import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.ssl.ALPNProcessor; import org.eclipse.jetty.io.ssl.SslConnection; import org.eclipse.jetty.io.ssl.SslHandshakeListener; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ConscryptClientALPNProcessor implements ALPNProcessor.Client { - private static final Logger LOG = Log.getLogger(ConscryptClientALPNProcessor.class); + private static final Logger LOG = LoggerFactory.getLogger(ConscryptClientALPNProcessor.class); @Override public void init() @@ -95,8 +95,8 @@ public class ConscryptClientALPNProcessor implements ALPNProcessor.Client } catch (Throwable e) { + LOG.warn("Unable to process Conscrypt ApplicationProtocol for {}", alpnConnection, e); alpnConnection.selected(null); - LOG.warn(e); } } } diff --git a/jetty-alpn/jetty-alpn-conscrypt-server/src/main/java/org/eclipse/jetty/alpn/conscrypt/server/ConscryptServerALPNProcessor.java b/jetty-alpn/jetty-alpn-conscrypt-server/src/main/java/org/eclipse/jetty/alpn/conscrypt/server/ConscryptServerALPNProcessor.java index 1d54ed8fc2d..974029cd8bf 100644 --- a/jetty-alpn/jetty-alpn-conscrypt-server/src/main/java/org/eclipse/jetty/alpn/conscrypt/server/ConscryptServerALPNProcessor.java +++ b/jetty-alpn/jetty-alpn-conscrypt-server/src/main/java/org/eclipse/jetty/alpn/conscrypt/server/ConscryptServerALPNProcessor.java @@ -31,12 +31,12 @@ import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.ssl.ALPNProcessor; import org.eclipse.jetty.io.ssl.SslConnection.DecryptedEndPoint; import org.eclipse.jetty.io.ssl.SslHandshakeListener; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ConscryptServerALPNProcessor implements ALPNProcessor.Server { - private static final Logger LOG = Log.getLogger(ConscryptServerALPNProcessor.class); + private static final Logger LOG = LoggerFactory.getLogger(ConscryptServerALPNProcessor.class); @Override public void init() diff --git a/jetty-alpn/jetty-alpn-java-client/pom.xml b/jetty-alpn/jetty-alpn-java-client/pom.xml index fb8b4a1bb2a..95928e95608 100644 --- a/jetty-alpn/jetty-alpn-java-client/pom.xml +++ b/jetty-alpn/jetty-alpn-java-client/pom.xml @@ -40,6 +40,10 @@ jetty-alpn-client ${project.version} + + org.slf4j + slf4j-api + org.eclipse.jetty.http2 @@ -47,6 +51,12 @@ ${project.version} test + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + diff --git a/jetty-alpn/jetty-alpn-java-client/src/main/java/org/eclipse/jetty/alpn/java/client/JDK9ClientALPNProcessor.java b/jetty-alpn/jetty-alpn-java-client/src/main/java/org/eclipse/jetty/alpn/java/client/JDK9ClientALPNProcessor.java index a8660e3fe10..3a455ffb024 100644 --- a/jetty-alpn/jetty-alpn-java-client/src/main/java/org/eclipse/jetty/alpn/java/client/JDK9ClientALPNProcessor.java +++ b/jetty-alpn/jetty-alpn-java-client/src/main/java/org/eclipse/jetty/alpn/java/client/JDK9ClientALPNProcessor.java @@ -28,12 +28,12 @@ import org.eclipse.jetty.io.ssl.ALPNProcessor; import org.eclipse.jetty.io.ssl.SslConnection.DecryptedEndPoint; import org.eclipse.jetty.io.ssl.SslHandshakeListener; import org.eclipse.jetty.util.JavaVersion; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JDK9ClientALPNProcessor implements ALPNProcessor.Client { - private static final Logger LOG = Log.getLogger(JDK9ClientALPNProcessor.class); + private static final Logger LOG = LoggerFactory.getLogger(JDK9ClientALPNProcessor.class); @Override public void init() diff --git a/jetty-alpn/jetty-alpn-java-server/src/main/java/org/eclipse/jetty/alpn/java/server/JDK9ServerALPNProcessor.java b/jetty-alpn/jetty-alpn-java-server/src/main/java/org/eclipse/jetty/alpn/java/server/JDK9ServerALPNProcessor.java index cd3e99333a7..f5ae6579eba 100644 --- a/jetty-alpn/jetty-alpn-java-server/src/main/java/org/eclipse/jetty/alpn/java/server/JDK9ServerALPNProcessor.java +++ b/jetty-alpn/jetty-alpn-java-server/src/main/java/org/eclipse/jetty/alpn/java/server/JDK9ServerALPNProcessor.java @@ -28,12 +28,12 @@ import org.eclipse.jetty.io.ssl.ALPNProcessor; import org.eclipse.jetty.io.ssl.SslConnection; import org.eclipse.jetty.io.ssl.SslHandshakeListener; import org.eclipse.jetty.util.JavaVersion; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JDK9ServerALPNProcessor implements ALPNProcessor.Server, SslHandshakeListener { - private static final Logger LOG = Log.getLogger(JDK9ServerALPNProcessor.class); + private static final Logger LOG = LoggerFactory.getLogger(JDK9ServerALPNProcessor.class); @Override public void init() diff --git a/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnection.java b/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnection.java index cf798a142e8..8d6e931793d 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnection.java +++ b/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnection.java @@ -27,12 +27,12 @@ import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.server.ConnectionFactory; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.NegotiatingServerConnection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ALPNServerConnection extends NegotiatingServerConnection { - private static final Logger LOG = Log.getLogger(ALPNServerConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(ALPNServerConnection.class); public ALPNServerConnection(Connector connector, EndPoint endPoint, SSLEngine engine, List protocols, String defaultProtocol) { diff --git a/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnectionFactory.java b/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnectionFactory.java index 5615f004fe0..f0f2628fba0 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnectionFactory.java +++ b/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnectionFactory.java @@ -31,12 +31,12 @@ import org.eclipse.jetty.io.ssl.ALPNProcessor.Server; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.NegotiatingServerConnectionFactory; import org.eclipse.jetty.util.annotation.Name; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ALPNServerConnectionFactory extends NegotiatingServerConnectionFactory { - private static final Logger LOG = Log.getLogger(ALPNServerConnectionFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(ALPNServerConnectionFactory.class); private final List processors = new ArrayList<>(); @@ -61,7 +61,7 @@ public class ALPNServerConnectionFactory extends NegotiatingServerConnectionFact catch (Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug(x.getMessage(), x); if (x != failure) failure.addSuppressed(x); continue; @@ -75,7 +75,7 @@ public class ALPNServerConnectionFactory extends NegotiatingServerConnectionFact catch (Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug("Could not initialize " + processor, x); + LOG.debug("Could not initialize {}", processor, x); if (x != failure) failure.addSuppressed(x); } diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java index 3f36bf1d3e9..e07eaf2323a 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java @@ -39,7 +39,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; - import javax.servlet.ServletContainerInitializer; import javax.servlet.annotation.HandlesTypes; @@ -51,8 +50,6 @@ import org.eclipse.jetty.util.MultiException; import org.eclipse.jetty.util.ProcessorUtils; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.statistic.CounterStatistic; import org.eclipse.jetty.webapp.AbstractConfiguration; @@ -63,13 +60,15 @@ import org.eclipse.jetty.webapp.MetaInfConfiguration; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.webapp.WebDescriptor; import org.eclipse.jetty.webapp.WebXmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Configuration for Annotations */ public class AnnotationConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(AnnotationConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(AnnotationConfiguration.class); public static final String SERVLET_CONTAINER_INITIALIZER_EXCLUSION_PATTERN = "org.eclipse.jetty.containerInitializerExclusionPattern"; public static final String SERVLET_CONTAINER_INITIALIZER_ORDER = "org.eclipse.jetty.containerInitializerOrder"; @@ -337,7 +336,7 @@ public class AnnotationConfiguration extends AbstractConfiguration { //handle introspectable annotations (postconstruct,predestroy, multipart etc etc) context.getObjectFactory().addDecorator(new AnnotationDecorator(context)); - + if (!context.getMetaData().isMetaDataComplete()) { //If web.xml not metadata-complete, if this is a servlet 3 webapp or above @@ -411,7 +410,7 @@ public class AnnotationConfiguration extends AbstractConfiguration /** * Perform scanning of classes for discoverable - * annotations such as WebServlet/WebFilter/WebListener + * annotations such as WebServlet/WebFilter/WebListener * * @param context the context for the scan * @throws Exception if unable to scan @@ -836,8 +835,10 @@ public class AnnotationConfiguration extends AbstractConfiguration catch (Error e) { // Probably a SCI discovered on the system classpath that is hidden by the context classloader - LOG.info("Error: {} for {}", e.getMessage(), context); - LOG.debug(e); + if (LOG.isDebugEnabled()) + LOG.debug("Error: {} for {}", e.getMessage(), context, e); + else + LOG.info("Error: {} for {}", e.getMessage(), context); continue; } @@ -1026,7 +1027,7 @@ public class AnnotationConfiguration extends AbstractConfiguration /** * Scan jars in WEB-INF/lib. - * + * * Only jars selected by MetaInfConfiguration, and that are not excluded * by an ordering will be considered. * diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationIntrospector.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationIntrospector.java index 9837009efd2..4ffe33c9cc2 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationIntrospector.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationIntrospector.java @@ -27,11 +27,11 @@ import java.util.Set; import org.eclipse.jetty.servlet.BaseHolder; import org.eclipse.jetty.servlet.Source.Origin; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.webapp.WebDescriptor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AnnotationIntrospector @@ -40,7 +40,7 @@ import org.eclipse.jetty.webapp.WebDescriptor; */ public class AnnotationIntrospector { - private static final Logger LOG = Log.getLogger(AnnotationIntrospector.class); + private static final Logger LOG = LoggerFactory.getLogger(AnnotationIntrospector.class); private final Set> _introspectedClasses = new HashSet<>(); private final List _handlers = new ArrayList(); private final WebAppContext _context; @@ -89,13 +89,13 @@ public class AnnotationIntrospector c = c.getSuperclass(); } } - + public WebAppContext getContext() { return _context; } } - + public AnnotationIntrospector(WebAppContext context) { _context = Objects.requireNonNull(context); @@ -105,11 +105,11 @@ public class AnnotationIntrospector { _handlers.add(handler); } - + /** - * Test if an object should be introspected for some specific types of annotations + * Test if an object should be introspected for some specific types of annotations * like PostConstruct/PreDestroy/MultiPart etc etc. - * + * * According to servlet 4.0, these types of annotations should only be evaluated iff any * of the following are true: *
    @@ -118,10 +118,10 @@ public class AnnotationIntrospector * in a descriptor AND web.xml is NOT metadata-complete AND any web-fragment.xml associated with the location of * the class is NOT metadata-complete *
- * + * * We also support evaluations of these types of annotations for objects that were created directly * by the jetty api. - * + * * @param o the object to check for its ability to be introspected for annotations * @param metaInfo meta information about the object to be introspected * @return true if it can be introspected according to servlet 4.0 rules @@ -130,27 +130,27 @@ public class AnnotationIntrospector { if (o == null) return false; //nothing to introspect - + if (metaInfo == null) return true; //no information about the object to introspect, assume introspectable - + @SuppressWarnings("rawtypes") BaseHolder holder = null; - + try { holder = (BaseHolder)metaInfo; } catch (ClassCastException e) { - LOG.warn(e); + LOG.warn("Not introspectable {}", metaInfo.getClass().getName(), e); return true; //not the type of information we were expecting, assume introspectable } - + Origin origin = (holder.getSource() == null ? null : holder.getSource().getOrigin()); if (origin == null) return true; //assume introspectable - + switch (origin) { case EMBEDDED: @@ -168,7 +168,7 @@ public class AnnotationIntrospector //is not metadata-complete if (_context.getMetaData().isMetaDataComplete()) return false; - + String descriptorLocation = holder.getSource().getResource(); if (descriptorLocation == null) return true; //no descriptor, can't be metadata-complete @@ -186,16 +186,15 @@ public class AnnotationIntrospector } /** - * @param o - * @param metaInfo + * */ public void introspect(Object o, Object metaInfo) { if (!isIntrospectable(o, metaInfo)) return; - + Class clazz = o.getClass(); - + synchronized (_introspectedClasses) { //Synchronize on the set of already introspected classes. diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationParser.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationParser.java index 23d82584508..1e6621ce8ec 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationParser.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationParser.java @@ -39,8 +39,6 @@ import org.eclipse.jetty.util.MultiException; import org.eclipse.jetty.util.MultiReleaseJarFile; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.ClassReader; @@ -48,6 +46,8 @@ import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.FieldVisitor; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AnnotationParser @@ -69,7 +69,7 @@ import org.objectweb.asm.Opcodes; */ public class AnnotationParser { - private static final Logger LOG = Log.getLogger(AnnotationParser.class); + private static final Logger LOG = LoggerFactory.getLogger(AnnotationParser.class); protected static int ASM_OPCODE_VERSION = Opcodes.ASM7; //compatibility of api protected static String ASM_OPCODE_VERSION_STR = "ASM7"; diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ClassInheritanceHandler.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ClassInheritanceHandler.java index 3d57f75996c..c2532731ae5 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ClassInheritanceHandler.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ClassInheritanceHandler.java @@ -24,8 +24,8 @@ import java.util.concurrent.ConcurrentHashMap; import org.eclipse.jetty.annotations.AnnotationParser.AbstractHandler; import org.eclipse.jetty.annotations.AnnotationParser.ClassInfo; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ClassInheritanceHandler @@ -34,7 +34,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class ClassInheritanceHandler extends AbstractHandler { - private static final Logger LOG = Log.getLogger(ClassInheritanceHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ClassInheritanceHandler.class); Map> _inheritanceMap; @@ -64,7 +64,7 @@ public class ClassInheritanceHandler extends AbstractHandler } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed to handle {}", classInfo, e); } } diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/DeclareRolesAnnotationHandler.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/DeclareRolesAnnotationHandler.java index c9e3cc81a09..72604d851ce 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/DeclareRolesAnnotationHandler.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/DeclareRolesAnnotationHandler.java @@ -24,16 +24,16 @@ import javax.servlet.Servlet; import org.eclipse.jetty.annotations.AnnotationIntrospector.AbstractIntrospectableAnnotationHandler; import org.eclipse.jetty.security.ConstraintAware; import org.eclipse.jetty.security.ConstraintSecurityHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * DeclaresRolesAnnotationHandler */ public class DeclareRolesAnnotationHandler extends AbstractIntrospectableAnnotationHandler { - private static final Logger LOG = Log.getLogger(DeclareRolesAnnotationHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(DeclareRolesAnnotationHandler.class); public DeclareRolesAnnotationHandler(WebAppContext context) { diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourceAnnotationHandler.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourceAnnotationHandler.java index 8b2e87df27e..0a0896fa527 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourceAnnotationHandler.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourceAnnotationHandler.java @@ -32,21 +32,21 @@ import javax.naming.NamingException; import org.eclipse.jetty.annotations.AnnotationIntrospector.AbstractIntrospectableAnnotationHandler; import org.eclipse.jetty.plus.annotation.Injection; import org.eclipse.jetty.plus.annotation.InjectionCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.MetaData; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ResourceAnnotationHandler extends AbstractIntrospectableAnnotationHandler { - private static final Logger LOG = Log.getLogger(ResourceAnnotationHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ResourceAnnotationHandler.class); protected static final List> ENV_ENTRY_TYPES = Arrays.asList(new Class[] - { - String.class, Character.class, Integer.class, Boolean.class, Double.class, Byte.class, Short.class, Long.class, - Float.class - }); + { + String.class, Character.class, Integer.class, Boolean.class, Double.class, Byte.class, Short.class, Long.class, + Float.class + }); public ResourceAnnotationHandler(WebAppContext wac) { @@ -98,7 +98,7 @@ public class ResourceAnnotationHandler extends AbstractIntrospectableAnnotationH } catch (NamingException e) { - LOG.warn(e); + LOG.warn("Unable to bind name {} to {} from class {}", name, mappedName, clazz, e); } } } diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourcesAnnotationHandler.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourcesAnnotationHandler.java index 01d8d771724..e5bb183e5e9 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourcesAnnotationHandler.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ResourcesAnnotationHandler.java @@ -23,13 +23,13 @@ import javax.annotation.Resources; import javax.naming.NamingException; import org.eclipse.jetty.annotations.AnnotationIntrospector.AbstractIntrospectableAnnotationHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ResourcesAnnotationHandler extends AbstractIntrospectableAnnotationHandler { - private static final Logger LOG = Log.getLogger(ResourcesAnnotationHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ResourcesAnnotationHandler.class); public ResourcesAnnotationHandler(WebAppContext wac) { @@ -67,7 +67,7 @@ public class ResourcesAnnotationHandler extends AbstractIntrospectableAnnotation } catch (NamingException e) { - LOG.warn(e); + LOG.warn("Unable to bind {} to {}", name, mappedName, e); } } } diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/RunAsAnnotationHandler.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/RunAsAnnotationHandler.java index d432903eff7..0f8be1166a9 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/RunAsAnnotationHandler.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/RunAsAnnotationHandler.java @@ -23,15 +23,15 @@ import javax.servlet.Servlet; import org.eclipse.jetty.annotations.AnnotationIntrospector.AbstractIntrospectableAnnotationHandler; import org.eclipse.jetty.plus.annotation.RunAsCollection; import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.Descriptor; import org.eclipse.jetty.webapp.MetaData; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RunAsAnnotationHandler extends AbstractIntrospectableAnnotationHandler { - private static final Logger LOG = Log.getLogger(RunAsAnnotationHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(RunAsAnnotationHandler.class); public RunAsAnnotationHandler(WebAppContext wac) { diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ServletContainerInitializersStarter.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ServletContainerInitializersStarter.java index e92828673b4..9a96f0f003f 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ServletContainerInitializersStarter.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ServletContainerInitializersStarter.java @@ -23,9 +23,9 @@ import java.util.List; import org.eclipse.jetty.plus.annotation.ContainerInitializer; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ServletContainerInitializersStarter @@ -35,7 +35,7 @@ import org.eclipse.jetty.webapp.WebAppContext; */ public class ServletContainerInitializersStarter extends AbstractLifeCycle implements ServletContextHandler.ServletContainerInitializerCaller { - private static final Logger LOG = Log.getLogger(ServletContainerInitializersStarter.class); + private static final Logger LOG = LoggerFactory.getLogger(ServletContainerInitializersStarter.class); WebAppContext _context; public ServletContainerInitializersStarter(WebAppContext context) @@ -60,7 +60,7 @@ public class ServletContainerInitializersStarter extends AbstractLifeCycle imple } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed to call startup on {}", i, e); throw new RuntimeException(e); } } diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ServletSecurityAnnotationHandler.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ServletSecurityAnnotationHandler.java index c580bd22daf..328d51d505a 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ServletSecurityAnnotationHandler.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/ServletSecurityAnnotationHandler.java @@ -31,10 +31,10 @@ import org.eclipse.jetty.security.ConstraintMapping; import org.eclipse.jetty.security.ConstraintSecurityHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletMapping; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ServletSecurityAnnotationHandler @@ -55,7 +55,7 @@ import org.eclipse.jetty.webapp.WebAppContext; */ public class ServletSecurityAnnotationHandler extends AbstractIntrospectableAnnotationHandler { - private static final Logger LOG = Log.getLogger(ServletSecurityAnnotationHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ServletSecurityAnnotationHandler.class); public ServletSecurityAnnotationHandler(WebAppContext wac) { diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebFilterAnnotation.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebFilterAnnotation.java index 07f3919c4f8..fbe62081d65 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebFilterAnnotation.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebFilterAnnotation.java @@ -29,20 +29,20 @@ import org.eclipse.jetty.http.pathmap.ServletPathSpec; import org.eclipse.jetty.servlet.FilterHolder; import org.eclipse.jetty.servlet.FilterMapping; import org.eclipse.jetty.servlet.Source; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.DiscoveredAnnotation; import org.eclipse.jetty.webapp.MetaData; import org.eclipse.jetty.webapp.Origin; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * WebFilterAnnotation */ public class WebFilterAnnotation extends DiscoveredAnnotation { - private static final Logger LOG = Log.getLogger(WebFilterAnnotation.class); + private static final Logger LOG = LoggerFactory.getLogger(WebFilterAnnotation.class); public WebFilterAnnotation(WebAppContext context, String className) { diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebFilterAnnotationHandler.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebFilterAnnotationHandler.java index 3055259478d..3cae920d061 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebFilterAnnotationHandler.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebFilterAnnotationHandler.java @@ -21,16 +21,16 @@ package org.eclipse.jetty.annotations; import org.eclipse.jetty.annotations.AnnotationParser.ClassInfo; import org.eclipse.jetty.annotations.AnnotationParser.FieldInfo; import org.eclipse.jetty.annotations.AnnotationParser.MethodInfo; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * WebFilterAnnotationHandler */ public class WebFilterAnnotationHandler extends AbstractDiscoverableAnnotationHandler { - private static final Logger LOG = Log.getLogger(WebFilterAnnotationHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(WebFilterAnnotationHandler.class); public WebFilterAnnotationHandler(WebAppContext context) { diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebListenerAnnotation.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebListenerAnnotation.java index 50613c38870..a3bb6e7a692 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebListenerAnnotation.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebListenerAnnotation.java @@ -29,20 +29,20 @@ import javax.servlet.http.HttpSessionListener; import org.eclipse.jetty.servlet.ListenerHolder; import org.eclipse.jetty.servlet.Source; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.DiscoveredAnnotation; import org.eclipse.jetty.webapp.MetaData; import org.eclipse.jetty.webapp.Origin; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * WebListenerAnnotation */ public class WebListenerAnnotation extends DiscoveredAnnotation { - private static final Logger LOG = Log.getLogger(WebListenerAnnotation.class); + private static final Logger LOG = LoggerFactory.getLogger(WebListenerAnnotation.class); public WebListenerAnnotation(WebAppContext context, String className) { @@ -88,7 +88,7 @@ public class WebListenerAnnotation extends DiscoveredAnnotation } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to add listener {}", clazz, e); } } } diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebListenerAnnotationHandler.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebListenerAnnotationHandler.java index 4b0cc31f747..919f3a834b0 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebListenerAnnotationHandler.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebListenerAnnotationHandler.java @@ -21,13 +21,13 @@ package org.eclipse.jetty.annotations; import org.eclipse.jetty.annotations.AnnotationParser.ClassInfo; import org.eclipse.jetty.annotations.AnnotationParser.FieldInfo; import org.eclipse.jetty.annotations.AnnotationParser.MethodInfo; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class WebListenerAnnotationHandler extends AbstractDiscoverableAnnotationHandler { - private static final Logger LOG = Log.getLogger(WebListenerAnnotationHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(WebListenerAnnotationHandler.class); public WebListenerAnnotationHandler(WebAppContext context) { diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebServletAnnotation.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebServletAnnotation.java index 84986bf6e9f..c310dfc0036 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebServletAnnotation.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebServletAnnotation.java @@ -32,20 +32,20 @@ import org.eclipse.jetty.servlet.ServletMapping; import org.eclipse.jetty.servlet.Source; import org.eclipse.jetty.util.ArrayUtil; import org.eclipse.jetty.util.LazyList; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.DiscoveredAnnotation; import org.eclipse.jetty.webapp.MetaData; import org.eclipse.jetty.webapp.Origin; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * WebServletAnnotation */ public class WebServletAnnotation extends DiscoveredAnnotation { - private static final Logger LOG = Log.getLogger(WebServletAnnotation.class); + private static final Logger LOG = LoggerFactory.getLogger(WebServletAnnotation.class); public WebServletAnnotation(WebAppContext context, String className) { diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebServletAnnotationHandler.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebServletAnnotationHandler.java index 47106cb4c13..f3c02f38d87 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebServletAnnotationHandler.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebServletAnnotationHandler.java @@ -21,9 +21,9 @@ package org.eclipse.jetty.annotations; import org.eclipse.jetty.annotations.AnnotationParser.ClassInfo; import org.eclipse.jetty.annotations.AnnotationParser.FieldInfo; import org.eclipse.jetty.annotations.AnnotationParser.MethodInfo; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * WebServletAnnotationHandler @@ -32,7 +32,7 @@ import org.eclipse.jetty.webapp.WebAppContext; */ public class WebServletAnnotationHandler extends AbstractDiscoverableAnnotationHandler { - private static final Logger LOG = Log.getLogger(WebServletAnnotationHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(WebServletAnnotationHandler.class); public WebServletAnnotationHandler(WebAppContext context) { diff --git a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationConfiguration.java b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationConfiguration.java index fb086620c40..13753551f7c 100644 --- a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationConfiguration.java +++ b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationConfiguration.java @@ -21,7 +21,6 @@ package org.eclipse.jetty.annotations; import java.io.File; import java.net.URL; import java.net.URLClassLoader; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.servlet.ServletContainerInitializer; @@ -30,7 +29,6 @@ import org.eclipse.jetty.toolchain.test.FS; import org.eclipse.jetty.toolchain.test.JAR; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.resource.Resource; -import org.eclipse.jetty.webapp.FragmentDescriptor; import org.eclipse.jetty.webapp.RelativeOrdering; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.webapp.WebDescriptor; diff --git a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationDecorator.java b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationDecorator.java index eaeac24d583..ba6fd673b2e 100644 --- a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationDecorator.java +++ b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationDecorator.java @@ -85,7 +85,7 @@ public class TestAnnotationDecorator { new AnnotationDecorator(null); }); - + WebAppContext context = new WebAppContext(); AnnotationDecorator decorator = new AnnotationDecorator(context); ServletE servlet = new ServletE(); @@ -94,10 +94,10 @@ public class TestAnnotationDecorator LifeCycleCallbackCollection callbacks = (LifeCycleCallbackCollection)context.getAttribute(LifeCycleCallbackCollection.LIFECYCLE_CALLBACK_COLLECTION); assertNotNull(callbacks); assertFalse(callbacks.getPreDestroyCallbacks().isEmpty()); - + //reset context.removeAttribute(LifeCycleCallbackCollection.LIFECYCLE_CALLBACK_COLLECTION); - + //test with BaseHolder metadata, should not introspect with metdata-complete==true context.getMetaData().setWebDescriptor(new TestWebDescriptor(MetaData.Complete.True)); assertTrue(context.getMetaData().isMetaDataComplete()); @@ -110,10 +110,10 @@ public class TestAnnotationDecorator DecoratedObjectFactory.disassociateInfo(); callbacks = (LifeCycleCallbackCollection)context.getAttribute(LifeCycleCallbackCollection.LIFECYCLE_CALLBACK_COLLECTION); assertNull(callbacks); - + //reset context.removeAttribute(LifeCycleCallbackCollection.LIFECYCLE_CALLBACK_COLLECTION); - + //test with BaseHolder metadata, should introspect with metadata-complete==false context.getMetaData().setWebDescriptor(new TestWebDescriptor(MetaData.Complete.False)); DecoratedObjectFactory.associateInfo(holder); diff --git a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/resources/TestResourceAnnotations.java b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/resources/TestResourceAnnotations.java index 9ccef3072d3..ef98e8ff419 100644 --- a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/resources/TestResourceAnnotations.java +++ b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/resources/TestResourceAnnotations.java @@ -76,7 +76,7 @@ public class TestResourceAnnotations AnnotationIntrospector parser = new AnnotationIntrospector(wac); ResourceAnnotationHandler handler = new ResourceAnnotationHandler(wac); parser.registerHandler(handler); - + ResourceA resourceA = new ResourceA(); ResourceB resourceB = new ResourceB(); parser.introspect(resourceA, null); diff --git a/jetty-annotations/src/test/resources/web-fragment4false.xml b/jetty-annotations/src/test/resources/web-fragment4false.xml index 391672008da..7d44223765b 100644 --- a/jetty-annotations/src/test/resources/web-fragment4false.xml +++ b/jetty-annotations/src/test/resources/web-fragment4false.xml @@ -1,10 +1,6 @@ - + ardvaark diff --git a/jetty-annotations/src/test/resources/web-fragment4true.xml b/jetty-annotations/src/test/resources/web-fragment4true.xml index d9a3558589d..cf84dc66bde 100644 --- a/jetty-annotations/src/test/resources/web-fragment4true.xml +++ b/jetty-annotations/src/test/resources/web-fragment4true.xml @@ -1,11 +1,6 @@ - + badger diff --git a/jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebAppContext.java b/jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebAppContext.java index 56b200b599c..bf6b391cda3 100644 --- a/jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebAppContext.java +++ b/jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebAppContext.java @@ -49,21 +49,21 @@ import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletMapping; import org.eclipse.jetty.servlet.Source; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.PathResource; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.MetaInfConfiguration; import org.eclipse.jetty.webapp.WebAppClassLoader; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.xml.XmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Extension of WebAppContext to allow configuration via Ant environment. */ public class AntWebAppContext extends WebAppContext { - private static final Logger LOG = Log.getLogger(WebAppContext.class); + private static final Logger LOG = LoggerFactory.getLogger(WebAppContext.class); public static final String DEFAULT_CONTAINER_INCLUDE_JAR_PATTERN = ".*/.*jsp-api-[^/]*\\.jar$|.*/.*jsp-[^/]*\\.jar$|.*/.*taglibs[^/]*\\.jar$|.*/.*jstl[^/]*\\.jar$|.*/.*jsf-impl-[^/]*\\.jar$|.*/.*javax.faces-[^/]*\\.jar$|.*/.*myfaces-impl-[^/]*\\.jar$"; @@ -176,7 +176,7 @@ public class AntWebAppContext extends WebAppContext } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } } diff --git a/jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebXmlConfiguration.java b/jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebXmlConfiguration.java index a097c78282d..56d5460b25f 100644 --- a/jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebXmlConfiguration.java +++ b/jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebXmlConfiguration.java @@ -21,10 +21,10 @@ package org.eclipse.jetty.ant; import java.io.File; import java.util.List; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.Configuration; import org.eclipse.jetty.webapp.WebXmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This configuration object provides additional way to inject application @@ -34,7 +34,7 @@ import org.eclipse.jetty.webapp.WebXmlConfiguration; */ public class AntWebXmlConfiguration extends WebXmlConfiguration { - private static final Logger LOG = Log.getLogger(WebXmlConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(WebXmlConfiguration.class); /** * List of classpath files. diff --git a/jetty-cdi/src/main/java/org/eclipse/jetty/cdi/CdiServletContainerInitializer.java b/jetty-cdi/src/main/java/org/eclipse/jetty/cdi/CdiServletContainerInitializer.java index 30139bc41d1..70f017f17a3 100644 --- a/jetty-cdi/src/main/java/org/eclipse/jetty/cdi/CdiServletContainerInitializer.java +++ b/jetty-cdi/src/main/java/org/eclipse/jetty/cdi/CdiServletContainerInitializer.java @@ -26,8 +26,8 @@ import javax.servlet.ServletContext; import org.eclipse.jetty.annotations.AnnotationConfiguration; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A {@link ServletContainerInitializer} that introspects for a CDI API @@ -48,7 +48,7 @@ import org.eclipse.jetty.util.log.Logger; public class CdiServletContainerInitializer implements ServletContainerInitializer { public static final String CDI_INTEGRATION_ATTRIBUTE = "org.eclipse.jetty.cdi"; - private static final Logger LOG = Log.getLogger(CdiServletContainerInitializer.class); + private static final Logger LOG = LoggerFactory.getLogger(CdiServletContainerInitializer.class); @Override public void onStartup(Set> c, ServletContext ctx) diff --git a/jetty-cdi/src/main/java/org/eclipse/jetty/cdi/CdiSpiDecorator.java b/jetty-cdi/src/main/java/org/eclipse/jetty/cdi/CdiSpiDecorator.java index ecc27e0a2e8..cd77cf513c6 100644 --- a/jetty-cdi/src/main/java/org/eclipse/jetty/cdi/CdiSpiDecorator.java +++ b/jetty-cdi/src/main/java/org/eclipse/jetty/cdi/CdiSpiDecorator.java @@ -26,8 +26,8 @@ import java.util.Map; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.Decorator; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A Decorator that invokes the CDI provider within a webapp to decorate objects created by @@ -47,7 +47,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class CdiSpiDecorator implements Decorator { - private static final Logger LOG = Log.getLogger(CdiServletContainerInitializer.class); + private static final Logger LOG = LoggerFactory.getLogger(CdiServletContainerInitializer.class); public static final String MODE = "CdiSpiDecorator"; private final ServletContextHandler _context; diff --git a/jetty-client/src/main/java/module-info.java b/jetty-client/src/main/java/module-info.java index 633e74db434..40005b81a79 100644 --- a/jetty-client/src/main/java/module-info.java +++ b/jetty-client/src/main/java/module-info.java @@ -33,5 +33,6 @@ module org.eclipse.jetty.client // Only required if using SPNEGO. requires static java.security.jgss; // Only required if using JMX. + requires static java.management; requires static org.eclipse.jetty.jmx; } diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectionPool.java b/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectionPool.java index 7d901328f83..9271318a602 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectionPool.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectionPool.java @@ -29,13 +29,13 @@ import org.eclipse.jetty.util.Promise; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ManagedObject public abstract class AbstractConnectionPool implements ConnectionPool, Dumpable { - private static final Logger LOG = Log.getLogger(AbstractConnectionPool.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractConnectionPool.class); private final AtomicBoolean closed = new AtomicBoolean(); diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractHttpClientTransport.java b/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractHttpClientTransport.java index 957fa20bc03..7e9722160ef 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractHttpClientTransport.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractHttpClientTransport.java @@ -24,13 +24,13 @@ import org.eclipse.jetty.client.api.Connection; import org.eclipse.jetty.util.Promise; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ManagedObject public abstract class AbstractHttpClientTransport extends ContainerLifeCycle implements HttpClientTransport { - protected static final Logger LOG = Log.getLogger(HttpClientTransport.class); + protected static final Logger LOG = LoggerFactory.getLogger(HttpClientTransport.class); private HttpClient client; private ConnectionPool.Factory factory; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/AuthenticationProtocolHandler.java b/jetty-client/src/main/java/org/eclipse/jetty/client/AuthenticationProtocolHandler.java index 878a639c2a1..4053bb89c54 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/AuthenticationProtocolHandler.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/AuthenticationProtocolHandler.java @@ -40,13 +40,13 @@ import org.eclipse.jetty.http.HttpField; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http.QuotedCSV; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class AuthenticationProtocolHandler implements ProtocolHandler { public static final int DEFAULT_MAX_CONTENT_LENGTH = 16 * 1024; - public static final Logger LOG = Log.getLogger(AuthenticationProtocolHandler.class); + public static final Logger LOG = LoggerFactory.getLogger(AuthenticationProtocolHandler.class); private final HttpClient client; private final int maxContentLength; private final ResponseNotifier notifier; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/DuplexConnectionPool.java b/jetty-client/src/main/java/org/eclipse/jetty/client/DuplexConnectionPool.java index 90a8c21ca56..73f4b1b734d 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/DuplexConnectionPool.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/DuplexConnectionPool.java @@ -37,14 +37,14 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Sweeper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ManagedObject public class DuplexConnectionPool extends AbstractConnectionPool implements Sweeper.Sweepable { - private static final Logger LOG = Log.getLogger(DuplexConnectionPool.class); + private static final Logger LOG = LoggerFactory.getLogger(DuplexConnectionPool.class); private final ReentrantLock lock = new ReentrantLock(); private final Deque idleConnections; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpChannel.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpChannel.java index 1845babbd52..1867615b3ef 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpChannel.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpChannel.java @@ -19,12 +19,12 @@ package org.eclipse.jetty.client; import org.eclipse.jetty.client.api.Result; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class HttpChannel { - protected static final Logger LOG = Log.getLogger(HttpChannel.class); + protected static final Logger LOG = LoggerFactory.getLogger(HttpChannel.class); private final HttpDestination _destination; private final TimeoutCompleteListener _totalTimeout; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java index bbd56bb12b8..ea6459057eb 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java @@ -74,13 +74,13 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.util.thread.ThreadPool; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

HttpClient provides an efficient, asynchronous, non-blocking implementation @@ -122,7 +122,7 @@ import org.eclipse.jetty.util.thread.ThreadPool; public class HttpClient extends ContainerLifeCycle { public static final String USER_AGENT = "Jetty/" + Jetty.VERSION; - private static final Logger LOG = Log.getLogger(HttpClient.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class); private final ConcurrentMap destinations = new ConcurrentHashMap<>(); private final ProtocolHandlers handlers = new ProtocolHandlers(); diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java index 1cf2ef0b6a9..cb6cc8f844c 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java @@ -34,12 +34,12 @@ import org.eclipse.jetty.http.HttpFields; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.util.HttpCookieStore; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class HttpConnection implements IConnection { - private static final Logger LOG = Log.getLogger(HttpConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpConnection.class); private final HttpDestination destination; private int idleTimeoutGuard; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpContent.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpContent.java index 9559b43eece..dc9bf42b7e9 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpContent.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpContent.java @@ -27,8 +27,8 @@ import org.eclipse.jetty.client.api.ContentProvider; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * {@link HttpContent} is a stateful, linear representation of the request content provided @@ -66,7 +66,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class HttpContent implements Callback, Closeable { - private static final Logger LOG = Log.getLogger(HttpContent.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpContent.class); private static final ByteBuffer AFTER = ByteBuffer.allocate(0); private static final ByteBuffer CLOSE = ByteBuffer.allocate(0); diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConversation.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConversation.java index 14c9d331205..1eddf461326 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConversation.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConversation.java @@ -25,12 +25,12 @@ import java.util.concurrent.ConcurrentLinkedDeque; import org.eclipse.jetty.client.api.Response; import org.eclipse.jetty.util.AttributesMap; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HttpConversation extends AttributesMap { - private static final Logger LOG = Log.getLogger(HttpConversation.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpConversation.class); private final Deque exchanges = new ConcurrentLinkedDeque<>(); private volatile List listeners; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java index 9e99a0a10d1..bc00ab3cf43 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java @@ -46,16 +46,16 @@ import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.util.thread.Sweeper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ManagedObject public abstract class HttpDestination extends ContainerLifeCycle implements Destination, Closeable, Callback, Dumpable { - protected static final Logger LOG = Log.getLogger(HttpDestination.class); + protected static final Logger LOG = LoggerFactory.getLogger(HttpDestination.class); private final HttpClient client; private final Origin origin; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java index 8b6673371ca..d52393d28b0 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java @@ -22,12 +22,12 @@ import java.util.List; import org.eclipse.jetty.client.api.Response; import org.eclipse.jetty.client.api.Result; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HttpExchange { - private static final Logger LOG = Log.getLogger(HttpExchange.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpExchange.class); private final HttpDestination destination; private final HttpRequest request; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpProxy.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpProxy.java index 238ab839e1a..64a2812a024 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpProxy.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpProxy.java @@ -38,13 +38,13 @@ import org.eclipse.jetty.io.ClientConnectionFactory; import org.eclipse.jetty.io.ClientConnector; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.Promise; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HttpProxy extends ProxyConfiguration.Proxy { - private static final Logger LOG = Log.getLogger(HttpProxy.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpProxy.class); public HttpProxy(String host, int port) { diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java index c2fd19178f6..15a4047c4e7 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java @@ -42,8 +42,8 @@ import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.MathUtils; import org.eclipse.jetty.util.component.Destroyable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * {@link HttpReceiver} provides the abstract code to implement the various steps of the receive of HTTP responses. @@ -72,7 +72,7 @@ import org.eclipse.jetty.util.log.Logger; */ public abstract class HttpReceiver { - protected static final Logger LOG = Log.getLogger(HttpReceiver.class); + protected static final Logger LOG = LoggerFactory.getLogger(HttpReceiver.class); private final AtomicReference responseState = new AtomicReference<>(ResponseState.IDLE); private final HttpChannel channel; @@ -286,7 +286,7 @@ public abstract class HttpReceiver catch (IOException x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Unable to store cookies {} from {}", field, uri, x); } } diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpRedirector.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpRedirector.java index 72ba8c25c75..8efcc282065 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpRedirector.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpRedirector.java @@ -33,8 +33,8 @@ import org.eclipse.jetty.client.api.Response; import org.eclipse.jetty.client.api.Result; import org.eclipse.jetty.client.util.BufferingResponseListener; import org.eclipse.jetty.http.HttpMethod; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Utility class that handles HTTP redirects. @@ -60,7 +60,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class HttpRedirector { - private static final Logger LOG = Log.getLogger(HttpRedirector.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpRedirector.class); private static final String SCHEME_REGEXP = "(^https?)"; private static final String AUTHORITY_REGEXP = "([^/?#]+)"; // The location may be relative so the scheme://authority part may be missing diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpSender.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpSender.java index 0e2cc1280d6..2b8f3099a82 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpSender.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpSender.java @@ -31,8 +31,8 @@ import org.eclipse.jetty.http.HttpHeaderValue; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IteratingCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * {@link HttpSender} abstracts the algorithm to send HTTP requests, so that subclasses only implement @@ -59,7 +59,7 @@ import org.eclipse.jetty.util.log.Logger; */ public abstract class HttpSender implements AsyncContentProvider.Listener { - protected static final Logger LOG = Log.getLogger(HttpSender.class); + protected static final Logger LOG = LoggerFactory.getLogger(HttpSender.class); private final AtomicReference requestState = new AtomicReference<>(RequestState.QUEUED); private final AtomicReference senderState = new AtomicReference<>(SenderState.IDLE); @@ -363,7 +363,11 @@ public abstract class HttpSender implements AsyncContentProvider.Listener catch (RejectedExecutionException x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + { + if (x != failure) + x.addSuppressed(failure); + LOG.debug("Exchange aborted {}", exchange, x); + } abort(exchange, failure); } } diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/LeakTrackingConnectionPool.java b/jetty-client/src/main/java/org/eclipse/jetty/client/LeakTrackingConnectionPool.java index 457f4e0cf86..943e1b615bc 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/LeakTrackingConnectionPool.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/LeakTrackingConnectionPool.java @@ -22,12 +22,12 @@ import org.eclipse.jetty.client.api.Connection; import org.eclipse.jetty.client.api.Destination; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.LeakDetector; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class LeakTrackingConnectionPool extends DuplexConnectionPool { - private static final Logger LOG = Log.getLogger(LeakTrackingConnectionPool.class); + private static final Logger LOG = LoggerFactory.getLogger(LeakTrackingConnectionPool.class); private final LeakDetector leakDetector = new LeakDetector() { diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/MultiplexConnectionPool.java b/jetty-client/src/main/java/org/eclipse/jetty/client/MultiplexConnectionPool.java index 8475ef7da62..b5ed9fe63cf 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/MultiplexConnectionPool.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/MultiplexConnectionPool.java @@ -32,13 +32,13 @@ import org.eclipse.jetty.client.api.Connection; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Sweeper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class MultiplexConnectionPool extends AbstractConnectionPool implements ConnectionPool.Multiplexable, Sweeper.Sweepable { - private static final Logger LOG = Log.getLogger(MultiplexConnectionPool.class); + private static final Logger LOG = LoggerFactory.getLogger(MultiplexConnectionPool.class); private final HttpDestination destination; private final Deque idleConnections; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/ProxyProtocolClientConnectionFactory.java b/jetty-client/src/main/java/org/eclipse/jetty/client/ProxyProtocolClientConnectionFactory.java index a2f44510b2a..6aac5970989 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/ProxyProtocolClientConnectionFactory.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/ProxyProtocolClientConnectionFactory.java @@ -36,8 +36,8 @@ import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.Promise; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

ClientConnectionFactory for the @@ -446,7 +446,7 @@ public abstract class ProxyProtocolClientConnectionFactory implements ClientConn protected abstract static class ProxyProtocolConnection extends AbstractConnection implements Callback { - protected static final Logger LOG = Log.getLogger(ProxyProtocolConnection.class); + protected static final Logger LOG = LoggerFactory.getLogger(ProxyProtocolConnection.class); private final ClientConnectionFactory factory; private final Map context; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/RequestNotifier.java b/jetty-client/src/main/java/org/eclipse/jetty/client/RequestNotifier.java index 1a2819e0ccd..a4886519114 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/RequestNotifier.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/RequestNotifier.java @@ -22,12 +22,12 @@ import java.nio.ByteBuffer; import java.util.List; import org.eclipse.jetty.client.api.Request; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RequestNotifier { - private static final Logger LOG = Log.getLogger(ResponseNotifier.class); + private static final Logger LOG = LoggerFactory.getLogger(ResponseNotifier.class); private final HttpClient client; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/ResponseNotifier.java b/jetty-client/src/main/java/org/eclipse/jetty/client/ResponseNotifier.java index 31ec0bb2fc3..1d3f959f10d 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/ResponseNotifier.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/ResponseNotifier.java @@ -32,12 +32,12 @@ import org.eclipse.jetty.client.api.Result; import org.eclipse.jetty.http.HttpField; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.CountingCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ResponseNotifier { - private static final Logger LOG = Log.getLogger(ResponseNotifier.class); + private static final Logger LOG = LoggerFactory.getLogger(ResponseNotifier.class); public void notifyBegin(List listeners, Response response) { diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/Socks4Proxy.java b/jetty-client/src/main/java/org/eclipse/jetty/client/Socks4Proxy.java index ef5746a2dfb..b7351316649 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/Socks4Proxy.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/Socks4Proxy.java @@ -35,8 +35,8 @@ import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.Promise; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Socks4Proxy extends ProxyConfiguration.Proxy { @@ -78,7 +78,7 @@ public class Socks4Proxy extends ProxyConfiguration.Proxy private static class Socks4ProxyConnection extends AbstractConnection implements Callback { private static final Pattern IPv4_PATTERN = Pattern.compile("(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})"); - private static final Logger LOG = Log.getLogger(Socks4ProxyConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(Socks4ProxyConnection.class); private final Socks4Parser parser = new Socks4Parser(); private final ClientConnectionFactory connectionFactory; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/TimeoutCompleteListener.java b/jetty-client/src/main/java/org/eclipse/jetty/client/TimeoutCompleteListener.java index 6633b5bf241..f2048452c3a 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/TimeoutCompleteListener.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/TimeoutCompleteListener.java @@ -26,13 +26,13 @@ import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.client.api.Response; import org.eclipse.jetty.client.api.Result; import org.eclipse.jetty.io.CyclicTimeout; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TimeoutCompleteListener extends CyclicTimeout implements Response.CompleteListener { - private static final Logger LOG = Log.getLogger(TimeoutCompleteListener.class); + private static final Logger LOG = LoggerFactory.getLogger(TimeoutCompleteListener.class); private final AtomicReference request = new AtomicReference<>(); diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/ValidatingConnectionPool.java b/jetty-client/src/main/java/org/eclipse/jetty/client/ValidatingConnectionPool.java index 594383faa70..7aec6712b7d 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/ValidatingConnectionPool.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/ValidatingConnectionPool.java @@ -30,9 +30,9 @@ import org.eclipse.jetty.client.api.Destination; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A connection pool that validates connections before @@ -59,7 +59,7 @@ import org.eclipse.jetty.util.thread.Scheduler; */ public class ValidatingConnectionPool extends DuplexConnectionPool { - private static final Logger LOG = Log.getLogger(ValidatingConnectionPool.class); + private static final Logger LOG = LoggerFactory.getLogger(ValidatingConnectionPool.class); private final Scheduler scheduler; private final long timeout; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java index e52f1d2ff9d..f7ecd63dfa7 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java @@ -43,13 +43,13 @@ import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.io.AbstractConnection; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.Promise; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Sweeper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HttpConnectionOverHTTP extends AbstractConnection implements IConnection, org.eclipse.jetty.io.Connection.UpgradeFrom, Sweeper.Sweepable { - private static final Logger LOG = Log.getLogger(HttpConnectionOverHTTP.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpConnectionOverHTTP.class); private final AtomicBoolean closed = new AtomicBoolean(); private final AtomicInteger sweeps = new AtomicInteger(); diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTP.java b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTP.java index 70d6767cd74..49e5e2ef5fb 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTP.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTP.java @@ -142,10 +142,10 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res private void process() { + HttpConnectionOverHTTP connection = getHttpConnection(); + EndPoint endPoint = connection.getEndPoint(); try { - HttpConnectionOverHTTP connection = getHttpConnection(); - EndPoint endPoint = connection.getEndPoint(); while (true) { // Always parse even empty buffers to advance the parser. @@ -192,7 +192,7 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res catch (Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Unable to fill from endpoint {}", endPoint, x); networkBuffer.clear(); releaseNetworkBuffer(); failAndClose(x); diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpSenderOverHTTP.java b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpSenderOverHTTP.java index 411cc48713b..7906b5a87b2 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpSenderOverHTTP.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpSenderOverHTTP.java @@ -62,7 +62,7 @@ public class HttpSenderOverHTTP extends HttpSender catch (Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Unable to send headers on exchange {}", exchange, x); callback.failed(x); } } @@ -133,7 +133,7 @@ public class HttpSenderOverHTTP extends HttpSender catch (Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Unable to send content on {}", exchange, x); callback.failed(x); } } diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/proxy/ProxyProtocolClientConnectionFactory.java b/jetty-client/src/main/java/org/eclipse/jetty/client/proxy/ProxyProtocolClientConnectionFactory.java index c6483fa72fb..4da66ec27f5 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/proxy/ProxyProtocolClientConnectionFactory.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/proxy/ProxyProtocolClientConnectionFactory.java @@ -36,8 +36,8 @@ import org.eclipse.jetty.io.ClientConnectionFactory; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.Promise; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ProxyProtocolClientConnectionFactory implements ClientConnectionFactory { @@ -61,7 +61,7 @@ public class ProxyProtocolClientConnectionFactory implements ClientConnectionFac private class ProxyProtocolConnection extends AbstractConnection implements Callback { - private final Logger log = Log.getLogger(ProxyProtocolConnection.class); + private final Logger log = LoggerFactory.getLogger(ProxyProtocolConnection.class); private final Map context; public ProxyProtocolConnection(EndPoint endPoint, Executor executor, Map context) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamContentProvider.java b/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamContentProvider.java index 4fd7c1a9fc9..2f81b71f94b 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamContentProvider.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamContentProvider.java @@ -28,8 +28,8 @@ import java.util.NoSuchElementException; import org.eclipse.jetty.client.api.ContentProvider; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A {@link ContentProvider} for an {@link InputStream}. @@ -53,7 +53,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class InputStreamContentProvider implements ContentProvider, Callback, Closeable { - private static final Logger LOG = Log.getLogger(InputStreamContentProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(InputStreamContentProvider.class); private final InputStreamContentProviderIterator iterator = new InputStreamContentProviderIterator(); private final InputStream stream; @@ -131,7 +131,7 @@ public class InputStreamContentProvider implements ContentProvider, Callback, Cl } catch (IOException x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } } } @@ -199,7 +199,7 @@ public class InputStreamContentProvider implements ContentProvider, Callback, Cl catch (Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Failed to read", x); if (failure == null) { failure = x; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java b/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java index a48115460e5..94d7dac43b8 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java @@ -41,8 +41,8 @@ import org.eclipse.jetty.client.api.Result; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Implementation of {@link Listener} that produces an {@link InputStream} @@ -75,7 +75,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class InputStreamResponseListener extends Listener.Adapter { - private static final Logger LOG = Log.getLogger(InputStreamResponseListener.class); + private static final Logger LOG = LoggerFactory.getLogger(InputStreamResponseListener.class); private static final DeferredContentProvider.Chunk EOF = new DeferredContentProvider.Chunk(BufferUtil.EMPTY_BUFFER, Callback.NOOP); private final Object lock = this; private final CountDownLatch responseLatch = new CountDownLatch(1); diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/util/MultiPartContentProvider.java b/jetty-client/src/main/java/org/eclipse/jetty/client/util/MultiPartContentProvider.java index 27ce2ca5136..8252e3e7413 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/util/MultiPartContentProvider.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/util/MultiPartContentProvider.java @@ -39,8 +39,8 @@ import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.io.RuntimeIOException; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A {@link ContentProvider} for form uploads with the {@code "multipart/form-data"} @@ -66,7 +66,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class MultiPartContentProvider extends AbstractTypedContentProvider implements AsyncContentProvider, Closeable { - private static final Logger LOG = Log.getLogger(MultiPartContentProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(MultiPartContentProvider.class); private static final byte[] COLON_SPACE_BYTES = new byte[]{':', ' '}; private static final byte[] CR_LF_BYTES = new byte[]{'\r', '\n'}; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/util/PathContentProvider.java b/jetty-client/src/main/java/org/eclipse/jetty/client/util/PathContentProvider.java index 67509c9b8c5..ffa41c752bb 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/util/PathContentProvider.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/util/PathContentProvider.java @@ -33,8 +33,8 @@ import java.util.NoSuchElementException; import org.eclipse.jetty.client.api.ContentProvider; import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A {@link ContentProvider} for files using JDK 7's {@code java.nio.file} APIs.

@@ -46,7 +46,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class PathContentProvider extends AbstractTypedContentProvider { - private static final Logger LOG = Log.getLogger(PathContentProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(PathContentProvider.class); private final Path filePath; private final long fileSize; @@ -183,7 +183,7 @@ public class PathContentProvider extends AbstractTypedContentProvider } catch (Throwable x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } } } diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/util/SPNEGOAuthentication.java b/jetty-client/src/main/java/org/eclipse/jetty/client/util/SPNEGOAuthentication.java index 0c7689ad514..5f3d7742604 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/util/SPNEGOAuthentication.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/util/SPNEGOAuthentication.java @@ -41,13 +41,13 @@ import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.util.Attributes; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.ietf.jgss.GSSContext; import org.ietf.jgss.GSSException; import org.ietf.jgss.GSSManager; import org.ietf.jgss.GSSName; import org.ietf.jgss.Oid; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Implementation of the SPNEGO (or "Negotiate") authentication defined in RFC 4559.

@@ -61,7 +61,7 @@ import org.ietf.jgss.Oid; */ public class SPNEGOAuthentication extends AbstractAuthentication { - private static final Logger LOG = Log.getLogger(SPNEGOAuthentication.class); + private static final Logger LOG = LoggerFactory.getLogger(SPNEGOAuthentication.class); private static final String NEGOTIATE = HttpHeader.NEGOTIATE.asString(); private final GSSManager gssManager = GSSManager.getInstance(); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java index 733cb78f873..26b58540a99 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java @@ -37,11 +37,12 @@ import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.util.log.Log; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ArgumentsSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -49,6 +50,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest { + private static final Logger LOG = LoggerFactory.getLogger(HttpConnectionLifecycleTest.class); + @Override public HttpClient newHttpClient(HttpClientTransport transport) { @@ -403,7 +406,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest Collection activeConnections = connectionPool.getActiveConnections(); assertEquals(0, activeConnections.size()); - Log.getLogger(HttpConnection.class).info("Expecting java.lang.IllegalStateException: HttpParser{s=CLOSED,..."); + LOG.info("Expecting java.lang.IllegalStateException: HttpParser{s=CLOSED,..."); CountDownLatch latch = new CountDownLatch(1); ByteBuffer buffer = ByteBuffer.allocate(16 * 1024 * 1024); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/LivelockTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/LivelockTest.java index 1643806f60d..af999682754 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/LivelockTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/LivelockTest.java @@ -31,14 +31,14 @@ import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.util.SocketAddressResolver; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -120,7 +120,7 @@ public class LivelockTest int requestRate = 5; long pause = 1000 / requestRate; - Logger clientLog = Log.getLogger("TESTClient"); + Logger clientLog = LoggerFactory.getLogger("TESTClient"); CountDownLatch latch = new CountDownLatch(count); for (int i = 0; i < count; ++i) { @@ -133,9 +133,9 @@ public class LivelockTest else { if (result.getRequestFailure() != null) - clientLog.warn(result.getRequestFailure()); + clientLog.warn("Request Failure on {}", result, result.getRequestFailure()); if (result.getResponseFailure() != null) - clientLog.warn(result.getResponseFailure()); + clientLog.warn("Response Failure on {}", result, result.getResponseFailure()); } }); sleep(pause); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesTest.java index 52a0648f64c..72748ffded6 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesTest.java @@ -33,14 +33,14 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertTrue; public abstract class SslBytesTest { - protected final Logger logger = Log.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); public static class TLSRecord { @@ -146,10 +146,7 @@ public abstract class SslBytesTest } catch (IOException x) { - logger.info(x.getClass() + ": " + x.getMessage()); - - if (logger.isDebugEnabled()) - logger.debug(x); + logger.warn("Unable to accept from {}", serverSocket, x); } } diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/util/SPNEGOAuthenticationTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/util/SPNEGOAuthenticationTest.java index fbb7e26f57a..dfd157edf18 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/util/SPNEGOAuthenticationTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/util/SPNEGOAuthenticationTest.java @@ -51,8 +51,6 @@ import org.eclipse.jetty.server.session.DefaultSessionIdManager; import org.eclipse.jetty.server.session.SessionHandler; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Constraint; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -60,6 +58,8 @@ import org.junit.jupiter.api.condition.DisabledOnJre; import org.junit.jupiter.api.condition.JRE; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ArgumentsSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -71,7 +71,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; @DisabledOnJre({JRE.JAVA_8, JRE.JAVA_9, JRE.JAVA_10}) public class SPNEGOAuthenticationTest extends AbstractHttpClientServerTest { - private static final Logger LOG = Log.getLogger(SPNEGOAuthenticationTest.class); + private static final Logger LOG = LoggerFactory.getLogger(SPNEGOAuthenticationTest.class); static { diff --git a/jetty-deploy/pom.xml b/jetty-deploy/pom.xml index 68ace6744ea..7a229ce4da3 100644 --- a/jetty-deploy/pom.xml +++ b/jetty-deploy/pom.xml @@ -45,6 +45,10 @@ jetty-xml ${project.version} + + org.slf4j + slf4j-api + org.eclipse.jetty jetty-jmx @@ -56,6 +60,12 @@ slf4j-api + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/AppLifeCycle.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/AppLifeCycle.java index cc08391a3e2..22e7840098c 100644 --- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/AppLifeCycle.java +++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/AppLifeCycle.java @@ -27,8 +27,8 @@ import java.util.Set; import org.eclipse.jetty.deploy.graph.Graph; import org.eclipse.jetty.deploy.graph.Node; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The lifecycle of an App in the {@link DeploymentManager}. @@ -40,7 +40,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class AppLifeCycle extends Graph { - private static final Logger LOG = Log.getLogger(AppLifeCycle.class); + private static final Logger LOG = LoggerFactory.getLogger(AppLifeCycle.class); private static final String ALL_NODES = "*"; diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java index 88c05bf99b9..3793d99f7b6 100644 --- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java +++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java @@ -46,10 +46,10 @@ import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; import org.eclipse.jetty.util.annotation.Name; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.xml.XmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The Deployment Manager. @@ -68,7 +68,7 @@ import org.eclipse.jetty.xml.XmlConfiguration; @ManagedObject("Deployment Manager") public class DeploymentManager extends ContainerLifeCycle { - private static final Logger LOG = Log.getLogger(DeploymentManager.class); + private static final Logger LOG = LoggerFactory.getLogger(DeploymentManager.class); private MultiException onStartupErrors; /** @@ -534,7 +534,7 @@ public class DeploymentManager extends ContainerLifeCycle catch (Throwable ignore) { // The runBindings failed for 'failed' node - LOG.ignore(ignore); + LOG.trace("IGNORED", ignore); } if (isStarting()) diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/DebugBinding.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/DebugBinding.java index c0c664e7a34..4930596d94a 100644 --- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/DebugBinding.java +++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/DebugBinding.java @@ -21,12 +21,12 @@ package org.eclipse.jetty.deploy.bindings; import org.eclipse.jetty.deploy.App; import org.eclipse.jetty.deploy.AppLifeCycle; import org.eclipse.jetty.deploy.graph.Node; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class DebugBinding implements AppLifeCycle.Binding { - private static final Logger LOG = Log.getLogger(DebugBinding.class); + private static final Logger LOG = LoggerFactory.getLogger(DebugBinding.class); final String[] _targets; diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java index 6d9b728e1c3..1b69c90e40a 100644 --- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java +++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java @@ -24,12 +24,12 @@ import org.eclipse.jetty.deploy.AppProvider; import org.eclipse.jetty.deploy.graph.Node; import org.eclipse.jetty.deploy.providers.WebAppProvider; import org.eclipse.jetty.server.handler.ContextHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.WebAppClassLoader; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.xml.XmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Provides a way of globally setting various aspects of webapp contexts. @@ -46,7 +46,7 @@ import org.eclipse.jetty.xml.XmlConfiguration; */ public class GlobalWebappConfigBinding implements AppLifeCycle.Binding { - private static final Logger LOG = Log.getLogger(GlobalWebappConfigBinding.class); + private static final Logger LOG = LoggerFactory.getLogger(GlobalWebappConfigBinding.class); private String _jettyXml; diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java index e1140fe1aee..32dd02b1393 100644 --- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java +++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java @@ -37,9 +37,9 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @@ -47,7 +47,7 @@ import org.eclipse.jetty.util.resource.Resource; @ManagedObject("Abstract Provider for loading webapps") public abstract class ScanningAppProvider extends ContainerLifeCycle implements AppProvider { - private static final Logger LOG = Log.getLogger(ScanningAppProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(ScanningAppProvider.class); private Map _appMap = new HashMap(); diff --git a/jetty-deploy/src/main/javadoc/org/eclipse/jetty/deploy/doc-files/AppLifeCycle.svg b/jetty-deploy/src/main/javadoc/org/eclipse/jetty/deploy/doc-files/AppLifeCycle.svg index 43841b1fb64..7e62945425c 100644 --- a/jetty-deploy/src/main/javadoc/org/eclipse/jetty/deploy/doc-files/AppLifeCycle.svg +++ b/jetty-deploy/src/main/javadoc/org/eclipse/jetty/deploy/doc-files/AppLifeCycle.svg @@ -4,34 +4,12 @@ - - + + - + image/svg+xml - + diff --git a/jetty-deploy/src/main/javadoc/org/eclipse/jetty/deploy/doc-files/DefaultAppLifeCycleBindings.svg b/jetty-deploy/src/main/javadoc/org/eclipse/jetty/deploy/doc-files/DefaultAppLifeCycleBindings.svg index 969021da7fa..a74d356d80a 100644 --- a/jetty-deploy/src/main/javadoc/org/eclipse/jetty/deploy/doc-files/DefaultAppLifeCycleBindings.svg +++ b/jetty-deploy/src/main/javadoc/org/eclipse/jetty/deploy/doc-files/DefaultAppLifeCycleBindings.svg @@ -4,46 +4,8 @@ - - + - - + + - + image/svg+xml - + diff --git a/jetty-deploy/src/main/javadoc/org/eclipse/jetty/deploy/doc-files/DeploymentManager_Roles.svg b/jetty-deploy/src/main/javadoc/org/eclipse/jetty/deploy/doc-files/DeploymentManager_Roles.svg index f208563ffa8..fe849872f5c 100644 --- a/jetty-deploy/src/main/javadoc/org/eclipse/jetty/deploy/doc-files/DeploymentManager_Roles.svg +++ b/jetty-deploy/src/main/javadoc/org/eclipse/jetty/deploy/doc-files/DeploymentManager_Roles.svg @@ -4,34 +4,12 @@ - - + + - + image/svg+xml - + diff --git a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java index a8c33191f58..5a8c294fcc3 100644 --- a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java +++ b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java @@ -27,14 +27,14 @@ import org.eclipse.jetty.deploy.test.XmlConfiguredJetty; import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension; import org.eclipse.jetty.util.Scanner; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnOs; import org.junit.jupiter.api.extension.ExtendWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.condition.OS.WINDOWS; @@ -45,7 +45,7 @@ import static org.junit.jupiter.api.condition.OS.WINDOWS; @ExtendWith(WorkDirExtension.class) public class ScanningAppProviderRuntimeUpdatesTest { - private static final Logger LOG = Log.getLogger(ScanningAppProviderRuntimeUpdatesTest.class); + private static final Logger LOG = LoggerFactory.getLogger(ScanningAppProviderRuntimeUpdatesTest.class); public WorkDir testdir; private static XmlConfiguredJetty jetty; @@ -106,7 +106,7 @@ public class ScanningAppProviderRuntimeUpdatesTest } catch (InterruptedException e) { - LOG.warn(e); + LOG.warn("Sleep failed", e); } } while (_scans.get() < scan); diff --git a/jetty-fcgi/fcgi-client/pom.xml b/jetty-fcgi/fcgi-client/pom.xml index 9d4ec739d53..cb1adfc13ae 100644 --- a/jetty-fcgi/fcgi-client/pom.xml +++ b/jetty-fcgi/fcgi-client/pom.xml @@ -35,6 +35,16 @@ jetty-client ${project.version} + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpConnectionOverFCGI.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpConnectionOverFCGI.java index 68be4272fc5..c4720e32318 100644 --- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpConnectionOverFCGI.java +++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpConnectionOverFCGI.java @@ -53,12 +53,12 @@ import org.eclipse.jetty.io.RetainableByteBuffer; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.Promise; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HttpConnectionOverFCGI extends AbstractConnection implements IConnection { - private static final Logger LOG = Log.getLogger(HttpConnectionOverFCGI.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpConnectionOverFCGI.class); private final LinkedList requests = new LinkedList<>(); private final Map activeChannels = new ConcurrentHashMap<>(); @@ -152,9 +152,9 @@ public class HttpConnectionOverFCGI extends AbstractConnection implements IConne void process() { + EndPoint endPoint = getEndPoint(); try { - EndPoint endPoint = getEndPoint(); while (true) { if (parse(networkBuffer.getBuffer())) @@ -185,7 +185,7 @@ public class HttpConnectionOverFCGI extends AbstractConnection implements IConne catch (Exception x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Unable to fill from endpoint {}", endPoint, x); networkBuffer.clear(); releaseNetworkBuffer(); close(x); diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/generator/Flusher.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/generator/Flusher.java index db502554704..0b31c501a4a 100644 --- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/generator/Flusher.java +++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/generator/Flusher.java @@ -24,12 +24,12 @@ import java.util.Queue; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.IteratingCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Flusher { - private static final Logger LOG = Log.getLogger(Flusher.class); + private static final Logger LOG = LoggerFactory.getLogger(Flusher.class); private final Queue queue = new ArrayDeque<>(); private final IteratingCallback flushCallback = new FlushCallback(); diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/HeaderParser.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/HeaderParser.java index 445e5aac4fd..15e90361dd4 100644 --- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/HeaderParser.java +++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/HeaderParser.java @@ -21,8 +21,8 @@ package org.eclipse.jetty.fcgi.parser; import java.nio.ByteBuffer; import org.eclipse.jetty.fcgi.FCGI; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Parser for FastCGI frame headers.

@@ -41,7 +41,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class HeaderParser { - private static final Logger LOG = Log.getLogger(Parser.class); + private static final Logger LOG = LoggerFactory.getLogger(Parser.class); private State state = State.VERSION; private int cursor; diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/ParamsContentParser.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/ParamsContentParser.java index 041ef33bd7d..538d229db9f 100644 --- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/ParamsContentParser.java +++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/ParamsContentParser.java @@ -23,8 +23,8 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import org.eclipse.jetty.http.HttpField; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Parser for the PARAMS frame body.

@@ -60,7 +60,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class ParamsContentParser extends ContentParser { - private static final Logger LOG = Log.getLogger(ParamsContentParser.class); + private static final Logger LOG = LoggerFactory.getLogger(ParamsContentParser.class); private final ServerParser.Listener listener; private State state = State.LENGTH; diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/Parser.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/Parser.java index 2d1ac024ae0..b4abccd8268 100644 --- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/Parser.java +++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/Parser.java @@ -22,8 +22,8 @@ import java.nio.ByteBuffer; import org.eclipse.jetty.fcgi.FCGI; import org.eclipse.jetty.http.HttpField; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

The FastCGI protocol exchanges frames.

@@ -47,7 +47,7 @@ import org.eclipse.jetty.util.log.Logger; */ public abstract class Parser { - private static final Logger LOG = Log.getLogger(Parser.class); + private static final Logger LOG = LoggerFactory.getLogger(Parser.class); protected final HeaderParser headerParser = new HeaderParser(); private State state = State.HEADER; diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/ResponseContentParser.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/ResponseContentParser.java index 890e9751b7f..ade1a39b03c 100644 --- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/ResponseContentParser.java +++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/ResponseContentParser.java @@ -32,8 +32,8 @@ import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpParser; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http.HttpVersion; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

The parser for STDOUT type frame bodies.

@@ -45,7 +45,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class ResponseContentParser extends StreamContentParser { - private static final Logger LOG = Log.getLogger(ResponseContentParser.class); + private static final Logger LOG = LoggerFactory.getLogger(ResponseContentParser.class); private final Map parsers = new ConcurrentHashMap<>(); private final ClientParser.Listener listener; diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/StreamContentParser.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/StreamContentParser.java index 785647d5fdb..1d801ae0cbb 100644 --- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/StreamContentParser.java +++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/StreamContentParser.java @@ -21,8 +21,8 @@ package org.eclipse.jetty.fcgi.parser; import java.nio.ByteBuffer; import org.eclipse.jetty.fcgi.FCGI; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A stream content parser parses frame bodies of type STDIN, STDOUT and STDERR.

@@ -30,7 +30,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class StreamContentParser extends ContentParser { - private static final Logger LOG = Log.getLogger(StreamContentParser.class); + private static final Logger LOG = LoggerFactory.getLogger(StreamContentParser.class); private final FCGI.StreamType streamType; private final Parser.Listener listener; diff --git a/jetty-fcgi/fcgi-server/pom.xml b/jetty-fcgi/fcgi-server/pom.xml index 6b8cd246e86..b01bfa9050b 100644 --- a/jetty-fcgi/fcgi-server/pom.xml +++ b/jetty-fcgi/fcgi-server/pom.xml @@ -39,7 +39,17 @@ jetty-server ${project.version} + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty jetty-servlet diff --git a/jetty-fcgi/fcgi-server/src/main/java/module-info.java b/jetty-fcgi/fcgi-server/src/main/java/module-info.java index c4201e8cd37..2722eaaec7a 100644 --- a/jetty-fcgi/fcgi-server/src/main/java/module-info.java +++ b/jetty-fcgi/fcgi-server/src/main/java/module-info.java @@ -21,9 +21,9 @@ module org.eclipse.jetty.fcgi.server exports org.eclipse.jetty.fcgi.server; exports org.eclipse.jetty.fcgi.server.proxy; - requires org.slf4j; requires transitive org.eclipse.jetty.fcgi.client; requires transitive org.eclipse.jetty.proxy; + requires org.slf4j; // Only required if using the proxy features. requires static jetty.servlet.api; diff --git a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/HttpChannelOverFCGI.java b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/HttpChannelOverFCGI.java index 70e640945f7..ddba3fa5f70 100644 --- a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/HttpChannelOverFCGI.java +++ b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/HttpChannelOverFCGI.java @@ -36,12 +36,12 @@ import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpTransport; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HttpChannelOverFCGI extends HttpChannel { - private static final Logger LOG = Log.getLogger(HttpChannelOverFCGI.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpChannelOverFCGI.class); private final HttpFields fields = new HttpFields(); private final Dispatcher dispatcher; diff --git a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/HttpTransportOverFCGI.java b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/HttpTransportOverFCGI.java index cbdb3f5504e..866989a7cd1 100644 --- a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/HttpTransportOverFCGI.java +++ b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/HttpTransportOverFCGI.java @@ -31,12 +31,12 @@ import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.server.HttpTransport; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HttpTransportOverFCGI implements HttpTransport { - private static final Logger LOG = Log.getLogger(HttpTransportOverFCGI.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpTransportOverFCGI.class); private final ServerGenerator generator; private final Flusher flusher; private final int request; diff --git a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/ServerFCGIConnection.java b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/ServerFCGIConnection.java index 987d4cb3a78..27b1b9ba465 100644 --- a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/ServerFCGIConnection.java +++ b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/ServerFCGIConnection.java @@ -34,12 +34,12 @@ import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpInput; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ServerFCGIConnection extends AbstractConnection { - private static final Logger LOG = Log.getLogger(ServerFCGIConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(ServerFCGIConnection.class); private final ConcurrentMap channels = new ConcurrentHashMap<>(); private final Connector connector; @@ -121,7 +121,7 @@ public class ServerFCGIConnection extends AbstractConnection catch (Exception x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Unable to fill endpoint", x); bufferPool.release(buffer); // TODO: fail and close ? } diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionDataStore.java b/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionDataStore.java index 528607b7f6e..9daa5f146e6 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionDataStore.java +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionDataStore.java @@ -45,8 +45,8 @@ import org.eclipse.jetty.util.ClassLoadingObjectInputStream; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * GCloudSessionDataStore @@ -54,7 +54,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject public class GCloudSessionDataStore extends AbstractSessionDataStore { - private static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(GCloudSessionDataStore.class); public static final int DEFAULT_MAX_QUERY_RESULTS = 100; public static final int DEFAULT_MAX_RETRIES = 5; @@ -594,7 +594,7 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to expire candidate sessions individually", e); } } } @@ -603,7 +603,7 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to get expired", e); return expired; //return what we got } } @@ -921,7 +921,7 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore } catch (DatastoreException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } long expiry = entity.getLong(_model.getExpiry()); long maxInactive = entity.getLong(_model.getMaxInactive()); diff --git a/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml b/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml index cf0b516e1e3..1bd391807ca 100644 --- a/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml +++ b/jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml @@ -10,13 +10,27 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/jetty-hazelcast/src/main/java/org/eclipse/jetty/hazelcast/session/HazelcastSessionDataStore.java b/jetty-hazelcast/src/main/java/org/eclipse/jetty/hazelcast/session/HazelcastSessionDataStore.java index c272f6c5d3d..c61ecbc3b7a 100644 --- a/jetty-hazelcast/src/main/java/org/eclipse/jetty/hazelcast/session/HazelcastSessionDataStore.java +++ b/jetty-hazelcast/src/main/java/org/eclipse/jetty/hazelcast/session/HazelcastSessionDataStore.java @@ -34,8 +34,8 @@ import org.eclipse.jetty.server.session.SessionData; import org.eclipse.jetty.server.session.SessionDataStore; import org.eclipse.jetty.server.session.UnreadableSessionDataException; import org.eclipse.jetty.util.annotation.ManagedObject; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Session data stored in Hazelcast @@ -46,7 +46,7 @@ public class HazelcastSessionDataStore implements SessionDataStore { - private static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(HazelcastSessionDataStore.class); private IMap sessionDataMap; diff --git a/jetty-hazelcast/src/main/java/org/eclipse/jetty/hazelcast/session/HazelcastSessionDataStoreFactory.java b/jetty-hazelcast/src/main/java/org/eclipse/jetty/hazelcast/session/HazelcastSessionDataStoreFactory.java index 6c9bed49ed7..b021b9096d7 100644 --- a/jetty-hazelcast/src/main/java/org/eclipse/jetty/hazelcast/session/HazelcastSessionDataStoreFactory.java +++ b/jetty-hazelcast/src/main/java/org/eclipse/jetty/hazelcast/session/HazelcastSessionDataStoreFactory.java @@ -30,7 +30,6 @@ import com.hazelcast.config.SerializerConfig; import com.hazelcast.config.XmlConfigBuilder; import com.hazelcast.core.Hazelcast; import com.hazelcast.core.HazelcastInstance; - import org.eclipse.jetty.server.session.AbstractSessionDataStoreFactory; import org.eclipse.jetty.server.session.SessionData; import org.eclipse.jetty.server.session.SessionDataStore; @@ -60,7 +59,7 @@ public class HazelcastSessionDataStoreFactory private boolean scavengeZombies = false; private String addresses; - + public boolean isScavengeZombies() { return scavengeZombies; @@ -86,12 +85,12 @@ public class HazelcastSessionDataStoreFactory if (configurationLocation == null) { ClientConfig config = new ClientConfig(); - + if (addresses != null && !addresses.isEmpty()) { config.getNetworkConfig().setAddresses(Arrays.asList(addresses.split(","))); } - + SerializerConfig sc = new SerializerConfig() .setImplementation(new SessionDataSerializer()) .setTypeClass(SessionData.class); @@ -212,7 +211,7 @@ public class HazelcastSessionDataStoreFactory { this.hazelcastInstanceName = hazelcastInstanceName; } - + public String getAddresses() { return addresses; diff --git a/jetty-http-spi/src/main/java/org/eclipse/jetty/http/spi/HttpSpiContextHandler.java b/jetty-http-spi/src/main/java/org/eclipse/jetty/http/spi/HttpSpiContextHandler.java index 52e3f3349f9..0e1caf4b3ed 100644 --- a/jetty-http-spi/src/main/java/org/eclipse/jetty/http/spi/HttpSpiContextHandler.java +++ b/jetty-http-spi/src/main/java/org/eclipse/jetty/http/spi/HttpSpiContextHandler.java @@ -35,15 +35,15 @@ import com.sun.net.httpserver.HttpPrincipal; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Jetty handler that bridges requests to {@link HttpHandler}. */ public class HttpSpiContextHandler extends ContextHandler { - public static final Logger LOG = Log.getLogger(HttpSpiContextHandler.class); + public static final Logger LOG = LoggerFactory.getLogger(HttpSpiContextHandler.class); private HttpContext _httpContext; @@ -89,7 +89,7 @@ public class HttpSpiContextHandler extends ContextHandler } catch (Exception ex) { - LOG.debug(ex); + LOG.debug("Failed to handle", ex); PrintWriter writer = new PrintWriter(jettyHttpExchange.getResponseBody()); resp.setStatus(500); diff --git a/jetty-http-spi/src/main/java/org/eclipse/jetty/http/spi/JettyHttpServer.java b/jetty-http-spi/src/main/java/org/eclipse/jetty/http/spi/JettyHttpServer.java index c41fae0b0c6..5d5ab6d670a 100644 --- a/jetty-http-spi/src/main/java/org/eclipse/jetty/http/spi/JettyHttpServer.java +++ b/jetty-http-spi/src/main/java/org/eclipse/jetty/http/spi/JettyHttpServer.java @@ -36,16 +36,16 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ContextHandlerCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ThreadPool; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Jetty implementation of {@link com.sun.net.httpserver.HttpServer}. */ public class JettyHttpServer extends com.sun.net.httpserver.HttpServer { - private static final Logger LOG = Log.getLogger(JettyHttpServer.class); + private static final Logger LOG = LoggerFactory.getLogger(JettyHttpServer.class); private final HttpConfiguration _httpConfiguration; @@ -223,7 +223,7 @@ public class JettyHttpServer extends com.sun.net.httpserver.HttpServer } catch (Exception ex) { - LOG.warn(ex); + LOG.warn("Unable to stop connector {}", connector, ex); } _server.removeConnector(connector); } diff --git a/jetty-http/pom.xml b/jetty-http/pom.xml index 9b32a761e5b..34620564bc7 100644 --- a/jetty-http/pom.xml +++ b/jetty-http/pom.xml @@ -26,6 +26,12 @@ ${project.version} + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java b/jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java index 7ec4ccd8670..570daca5159 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java @@ -21,8 +21,8 @@ package org.eclipse.jetty.http; import java.util.List; import java.util.Locale; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.eclipse.jetty.http.CookieCompliance.Violation.COMMA_NOT_VALID_OCTET; import static org.eclipse.jetty.http.CookieCompliance.Violation.RESERVED_NAMES_NOT_DOLLAR_PREFIXED; @@ -32,7 +32,7 @@ import static org.eclipse.jetty.http.CookieCompliance.Violation.RESERVED_NAMES_N */ public abstract class CookieCutter { - protected static final Logger LOG = Log.getLogger(CookieCutter.class); + protected static final Logger LOG = LoggerFactory.getLogger(CookieCutter.class); protected final CookieCompliance _complianceMode; private final ComplianceViolation.Listener _complianceListener; @@ -207,7 +207,7 @@ public abstract class CookieCutter } catch (Exception e) { - LOG.debug(e); + LOG.debug("Unable to process Cookie", e); } name = null; diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpCompliance.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpCompliance.java index dc9a6824b70..a0017569bf8 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpCompliance.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpCompliance.java @@ -25,8 +25,8 @@ import java.util.Objects; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.util.Arrays.asList; import static java.util.Collections.unmodifiableSet; @@ -84,7 +84,7 @@ public final class HttpCompliance implements ComplianceViolation.Mode } } - private static final Logger LOG = Log.getLogger(HttpParser.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpParser.class); public static final String VIOLATIONS_ATTR = "org.eclipse.jetty.http.compliance.violations"; public static final HttpCompliance RFC7230 = new HttpCompliance("RFC7230", noneOf(Violation.class)); diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java index d1a4811e905..219e9c13584 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java @@ -25,13 +25,13 @@ import java.util.concurrent.TimeUnit; import org.eclipse.jetty.util.Attributes; import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // TODO consider replacing this with java.net.HttpCookie (once it supports RFC6265) public class HttpCookie { - private static final Logger LOG = Log.getLogger(HttpCookie.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpCookie.class); private static final String __COOKIE_DELIM = "\",;\\ \t"; private static final String __01Jan1970_COOKIE = DateGenerator.formatCookieDate(0).trim(); diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java index 3a584f67902..7def4fdcfc4 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java @@ -34,8 +34,8 @@ import java.util.function.ToIntFunction; import java.util.stream.Stream; import org.eclipse.jetty.util.QuotedStringTokenizer; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * HTTP Fields. A collection of HTTP header and or Trailer fields. @@ -47,7 +47,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class HttpFields implements Iterable { - private static final Logger LOG = Log.getLogger(HttpFields.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpFields.class); private HttpField[] _fields; private int _size; @@ -896,7 +896,7 @@ public class HttpFields implements Iterable } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to get fields as String", e); return e.toString(); } } diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java index 4302da7afa8..c488b990403 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java @@ -29,8 +29,8 @@ import org.eclipse.jetty.util.ArrayTrie; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.Trie; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.eclipse.jetty.http.HttpStatus.INTERNAL_SERVER_ERROR_500; @@ -44,7 +44,7 @@ import static org.eclipse.jetty.http.HttpStatus.INTERNAL_SERVER_ERROR_500; */ public class HttpGenerator { - private static final Logger LOG = Log.getLogger(HttpGenerator.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpGenerator.class); public static final boolean __STRICT = Boolean.getBoolean("org.eclipse.jetty.http.HttpGenerator.STRICT"); @@ -251,7 +251,7 @@ public class HttpGenerator } catch (BufferOverflowException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return Result.HEADER_OVERFLOW; } catch (Exception e) @@ -429,7 +429,7 @@ public class HttpGenerator } catch (BufferOverflowException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return Result.HEADER_OVERFLOW; } catch (Exception e) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java index 2acfb494bd7..1d6db1f0cf9 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java @@ -31,8 +31,8 @@ import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.Trie; import org.eclipse.jetty.util.Utf8StringBuilder; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.eclipse.jetty.http.HttpCompliance.RFC7230; import static org.eclipse.jetty.http.HttpCompliance.Violation; @@ -89,7 +89,7 @@ import static org.eclipse.jetty.http.HttpCompliance.Violation.WHITESPACE_AFTER_F */ public class HttpParser { - public static final Logger LOG = Log.getLogger(HttpParser.class); + public static final Logger LOG = LoggerFactory.getLogger(HttpParser.class); public static final int INITIAL_URI_LENGTH = 256; private static final int MAX_CHUNK_LENGTH = Integer.MAX_VALUE / 16 - 16; @@ -1069,7 +1069,7 @@ public class HttpParser } catch (NumberFormatException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); throw new BadMessageException(HttpStatus.BAD_REQUEST_400, "Invalid Content-Length Value", e); } } diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/MimeTypes.java b/jetty-http/src/main/java/org/eclipse/jetty/http/MimeTypes.java index 89243847fd8..f377b566cfb 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/MimeTypes.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/MimeTypes.java @@ -36,8 +36,8 @@ import org.eclipse.jetty.util.ArrayTrie; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.Trie; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * MIME Type enum and utilities @@ -45,7 +45,7 @@ import org.eclipse.jetty.util.log.Logger; public class MimeTypes { - private static final Logger LOG = Log.getLogger(MimeTypes.class); + private static final Logger LOG = LoggerFactory.getLogger(MimeTypes.class); private static final Trie TYPES = new ArrayTrie(512); private static final Map __dftMimeMap = new HashMap(); private static final Map __inferredEncodings = new HashMap(); @@ -218,15 +218,19 @@ public class MimeTypes } catch (IOException e) { - LOG.warn(e.toString()); - LOG.debug(e); + if (LOG.isDebugEnabled()) + LOG.warn("Unable to read mime-type resource: {}", resourceName, e); + else + LOG.warn("Unable to read mime-type resource: {} - {}", resourceName, e.toString()); } } } catch (IOException e) { - LOG.warn(e.toString()); - LOG.debug(e); + if (LOG.isDebugEnabled()) + LOG.warn("Unable to load mime-type resource: {}", resourceName, e); + else + LOG.warn("Unable to load mime-type resource: {} - {}", resourceName, e.toString()); } resourceName = "encoding.properties"; @@ -262,15 +266,19 @@ public class MimeTypes } catch (IOException e) { - LOG.warn(e.toString()); - LOG.debug(e); + if (LOG.isDebugEnabled()) + LOG.warn("Unable to read encoding resource: {}", resourceName, e); + else + LOG.warn("Unable to read encoding resource: {} - {}", resourceName, e.toString()); } } } catch (IOException e) { - LOG.warn(e.toString()); - LOG.debug(e); + if (LOG.isDebugEnabled()) + LOG.warn("Unable to load encoding resource: {}", resourceName, e); + else + LOG.warn("Unable to load encoding resource: {} - {}", resourceName, e.toString()); } } diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java b/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java index e1f39a60689..4c26bfba941 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java @@ -24,8 +24,8 @@ import java.util.Iterator; import java.util.List; import java.util.ServiceLoader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Pre encoded HttpField. @@ -38,7 +38,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class PreEncodedHttpField extends HttpField { - private static final Logger LOG = Log.getLogger(PreEncodedHttpField.class); + private static final Logger LOG = LoggerFactory.getLogger(PreEncodedHttpField.class); private static final HttpFieldPreEncoder[] __encoders; static @@ -55,7 +55,7 @@ public class PreEncodedHttpField extends HttpField } catch (Error | RuntimeException e) { - LOG.debug(e); + LOG.debug("Unable to add HttpFieldPreEncoder", e); } } LOG.debug("HttpField encoders loaded: {}", encoders); diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/QuotedQualityCSV.java b/jetty-http/src/main/java/org/eclipse/jetty/http/QuotedQualityCSV.java index be8905ae02f..d2bf32835fc 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/QuotedQualityCSV.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/QuotedQualityCSV.java @@ -23,7 +23,8 @@ import java.util.Iterator; import java.util.List; import java.util.function.ToIntFunction; -import org.eclipse.jetty.util.log.Log; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.lang.Integer.MIN_VALUE; @@ -39,6 +40,8 @@ import static java.lang.Integer.MIN_VALUE; */ public class QuotedQualityCSV extends QuotedCSV implements Iterable { + private static final Logger LOG = LoggerFactory.getLogger(QuotedQualityCSV.class); + /** * Lambda to apply a most specific MIME encoding secondary ordering. * @@ -129,7 +132,7 @@ public class QuotedQualityCSV extends QuotedCSV implements Iterable } catch (Exception e) { - Log.getLogger(QuotedQualityCSV.class).ignore(e); + LOG.trace("IGNORED", e); q = 0.0D; } buffer.setLength(Math.max(0, paramName - 1)); diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/PathMappings.java b/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/PathMappings.java index 2417d719744..b0ef6bf817b 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/PathMappings.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/PathMappings.java @@ -32,8 +32,8 @@ import org.eclipse.jetty.util.Trie; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Path Mappings of PathSpec to Resource. @@ -45,7 +45,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Path Mappings") public class PathMappings implements Iterable>, Dumpable { - private static final Logger LOG = Log.getLogger(PathMappings.class); + private static final Logger LOG = LoggerFactory.getLogger(PathMappings.class); private final Set> _mappings = new TreeSet<>(); private Trie> _exactMap = new ArrayTernaryTrie<>(false); diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/ServletPathSpec.java b/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/ServletPathSpec.java index 5381a892d28..fefc652d854 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/ServletPathSpec.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/ServletPathSpec.java @@ -20,13 +20,13 @@ package org.eclipse.jetty.http.pathmap; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ServletPathSpec extends PathSpec { - private static final Logger LOG = Log.getLogger(ServletPathSpec.class); + private static final Logger LOG = LoggerFactory.getLogger(ServletPathSpec.class); /** * If a servlet or filter path mapping isn't a suffix mapping, ensure diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpec.java b/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpec.java index 130c5aa3899..63a5463044f 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpec.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpec.java @@ -31,8 +31,8 @@ import java.util.regex.Pattern; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.UrlEncoded; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * PathSpec for URI Template based declarations @@ -41,7 +41,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class UriTemplatePathSpec extends RegexPathSpec { - private static final Logger LOG = Log.getLogger(UriTemplatePathSpec.class); + private static final Logger LOG = LoggerFactory.getLogger(UriTemplatePathSpec.class); private static final Pattern VARIABLE_PATTERN = Pattern.compile("\\{(.*)\\}"); /** diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpCookieTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpCookieTest.java index 41a53f5e43f..194139e9c6c 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpCookieTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpCookieTest.java @@ -18,15 +18,6 @@ package org.eclipse.jetty.http; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Collections; -import java.util.Enumeration; -import java.util.EventListener; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; import java.util.stream.Stream; import org.eclipse.jetty.http.HttpCookie.SameSite; diff --git a/jetty-http2/http2-client/pom.xml b/jetty-http2/http2-client/pom.xml index 06b47b0943a..541f701eee5 100644 --- a/jetty-http2/http2-client/pom.xml +++ b/jetty-http2/http2-client/pom.xml @@ -39,7 +39,17 @@ jetty-alpn-client ${project.version} + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientSession.java b/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientSession.java index 0d52b4c581c..6aa7ae9eb4b 100644 --- a/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientSession.java +++ b/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientSession.java @@ -33,13 +33,13 @@ import org.eclipse.jetty.http2.frames.ResetFrame; import org.eclipse.jetty.http2.generator.Generator; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HTTP2ClientSession extends HTTP2Session { - private static final Logger LOG = Log.getLogger(HTTP2ClientSession.class); + private static final Logger LOG = LoggerFactory.getLogger(HTTP2ClientSession.class); private final AtomicLong streamsOpened = new AtomicLong(); private final AtomicLong streamsClosed = new AtomicLong(); diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java index 8baaefcb322..de1f2306e72 100644 --- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java +++ b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/IdleTimeoutTest.java @@ -52,10 +52,10 @@ import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FuturePromise; import org.eclipse.jetty.util.Promise; -import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -565,7 +565,7 @@ public class IdleTimeoutTest extends AbstractTest while (true) { int read = input.read(buffer); - Log.getLogger(IdleTimeoutTest.class).info("Read {} bytes", read); + LoggerFactory.getLogger(IdleTimeoutTest.class).info("Read {} bytes", read); if (read < 0) break; sleep(delay); diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/InterleavingTest.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/InterleavingTest.java index 99a6a7e1b09..e6c5b1fefb1 100644 --- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/InterleavingTest.java +++ b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/InterleavingTest.java @@ -45,9 +45,9 @@ import org.eclipse.jetty.http2.frames.SettingsFrame; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FuturePromise; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.lessThanOrEqualTo; @@ -188,7 +188,7 @@ public class InterleavingTest extends AbstractTest } groups.get(currentStream).add(currentLength); - Logger logger = Log.getLogger(getClass()); + Logger logger = LoggerFactory.getLogger(getClass()); logger.debug("frame lengths = {}", streamLengths); groups.forEach((stream, lengths) -> diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/RawHTTP2ProxyTest.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/RawHTTP2ProxyTest.java index a16eefe3fe3..c8ee642159f 100644 --- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/RawHTTP2ProxyTest.java +++ b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/RawHTTP2ProxyTest.java @@ -53,18 +53,18 @@ import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FuturePromise; import org.eclipse.jetty.util.IteratingCallback; import org.eclipse.jetty.util.Promise; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; public class RawHTTP2ProxyTest { - private static final Logger LOGGER = Log.getLogger(RawHTTP2ProxyTest.class); + private static final Logger LOGGER = LoggerFactory.getLogger(RawHTTP2ProxyTest.class); private final List servers = new ArrayList<>(); private final List clients = new ArrayList<>(); diff --git a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/SmallThreadPoolLoadTest.java b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/SmallThreadPoolLoadTest.java index 7b833b86c41..386d6b07311 100644 --- a/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/SmallThreadPoolLoadTest.java +++ b/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/SmallThreadPoolLoadTest.java @@ -46,13 +46,13 @@ import org.eclipse.jetty.util.ByteArrayOutputStream2; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FuturePromise; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.Scheduler; import org.hamcrest.Matchers; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -60,7 +60,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @Disabled public class SmallThreadPoolLoadTest extends AbstractTest { - private final Logger logger = Log.getLogger(SmallThreadPoolLoadTest.class); + private final Logger logger = LoggerFactory.getLogger(SmallThreadPoolLoadTest.class); private final AtomicLong requestIds = new AtomicLong(); @Override diff --git a/jetty-http2/http2-common/pom.xml b/jetty-http2/http2-common/pom.xml index 995a3b8d592..30d716433d2 100644 --- a/jetty-http2/http2-common/pom.xml +++ b/jetty-http2/http2-common/pom.xml @@ -16,12 +16,23 @@ http2-hpack ${project.version} + + org.slf4j + slf4j-api + + org.eclipse.jetty jetty-jmx ${project.version} true + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/AbstractFlowControlStrategy.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/AbstractFlowControlStrategy.java index 191c025ef42..f4b2823b7fa 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/AbstractFlowControlStrategy.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/AbstractFlowControlStrategy.java @@ -30,13 +30,13 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ManagedObject public abstract class AbstractFlowControlStrategy implements FlowControlStrategy, Dumpable { - protected static final Logger LOG = Log.getLogger(FlowControlStrategy.class); + protected static final Logger LOG = LoggerFactory.getLogger(FlowControlStrategy.class); private final AtomicLong sessionStall = new AtomicLong(); private final AtomicLong sessionStallTime = new AtomicLong(); diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Connection.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Connection.java index 8c8874d7abf..ff3ff554274 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Connection.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Connection.java @@ -35,15 +35,15 @@ import org.eclipse.jetty.io.WriteFlusher; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ExecutionStrategy; import org.eclipse.jetty.util.thread.TryExecutor; import org.eclipse.jetty.util.thread.strategy.EatWhatYouKill; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HTTP2Connection extends AbstractConnection implements WriteFlusher.Listener { - protected static final Logger LOG = Log.getLogger(HTTP2Connection.class); + protected static final Logger LOG = LoggerFactory.getLogger(HTTP2Connection.class); // TODO remove this once we are sure EWYK is OK for http2 private static final boolean PEC_MODE = Boolean.getBoolean("org.eclipse.jetty.http2.PEC_MODE"); diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Flusher.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Flusher.java index 74b2533c482..bc249bd0b2c 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Flusher.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Flusher.java @@ -36,12 +36,12 @@ import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IteratingCallback; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HTTP2Flusher extends IteratingCallback implements Dumpable { - private static final Logger LOG = Log.getLogger(HTTP2Flusher.class); + private static final Logger LOG = LoggerFactory.getLogger(HTTP2Flusher.class); private static final ByteBuffer[] EMPTY_BYTE_BUFFERS = new ByteBuffer[0]; private final Queue windows = new ArrayDeque<>(); diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java index 576e352caac..27bab4b2775 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java @@ -68,14 +68,14 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ManagedObject public abstract class HTTP2Session extends ContainerLifeCycle implements ISession, Parser.Listener { - private static final Logger LOG = Log.getLogger(HTTP2Session.class); + private static final Logger LOG = LoggerFactory.getLogger(HTTP2Session.class); private final ConcurrentMap streams = new ConcurrentHashMap<>(); private final AtomicBiInteger streamCount = new AtomicBiInteger(); // Hi = closed, Lo = stream count @@ -1580,7 +1580,7 @@ public abstract class HTTP2Session extends ContainerLifeCycle implements ISessio public void failed(Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Reset failed", x); complete(); } @@ -1602,7 +1602,7 @@ public abstract class HTTP2Session extends ContainerLifeCycle implements ISessio public void failed(Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("OnReset failed", x); complete(); } @@ -1640,7 +1640,7 @@ public abstract class HTTP2Session extends ContainerLifeCycle implements ISessio public void failed(Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("CloseCallback failed", x); complete(); } @@ -1662,7 +1662,7 @@ public abstract class HTTP2Session extends ContainerLifeCycle implements ISessio public void failed(Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("DisconnectCallback failed", x); complete(); } diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java index 98c37e40858..3fefbdab6da 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java @@ -47,14 +47,14 @@ import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.MathUtils; import org.eclipse.jetty.util.Promise; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.AutoLock; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HTTP2Stream extends IdleTimeout implements IStream, Callback, Dumpable { - private static final Logger LOG = Log.getLogger(HTTP2Stream.class); + private static final Logger LOG = LoggerFactory.getLogger(HTTP2Stream.class); private final AutoLock lock = new AutoLock(); private final Queue dataQueue = new ArrayDeque<>(); diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2StreamEndPoint.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2StreamEndPoint.java index 8220f09960b..5c3e5bbc19e 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2StreamEndPoint.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2StreamEndPoint.java @@ -35,13 +35,13 @@ import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Invocable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class HTTP2StreamEndPoint implements EndPoint { - private static final Logger LOG = Log.getLogger(HTTP2StreamEndPoint.class); + private static final Logger LOG = LoggerFactory.getLogger(HTTP2StreamEndPoint.class); private final Deque dataQueue = new ArrayDeque<>(); private final AtomicReference writeState = new AtomicReference<>(WriteState.IDLE); diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/BodyParser.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/BodyParser.java index 7e26a455fde..2c06fd20e90 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/BodyParser.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/BodyParser.java @@ -32,8 +32,8 @@ import org.eclipse.jetty.http2.frames.ResetFrame; import org.eclipse.jetty.http2.frames.SettingsFrame; import org.eclipse.jetty.http2.frames.WindowUpdateFrame; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

The base parser for the frame body of HTTP/2 frames.

@@ -44,7 +44,7 @@ import org.eclipse.jetty.util.log.Logger; */ public abstract class BodyParser { - protected static final Logger LOG = Log.getLogger(BodyParser.class); + protected static final Logger LOG = LoggerFactory.getLogger(BodyParser.class); private final HeaderParser headerParser; private final Parser.Listener listener; diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/HeaderBlockParser.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/HeaderBlockParser.java index fde1d0972fc..11a922a81ce 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/HeaderBlockParser.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/HeaderBlockParser.java @@ -27,14 +27,14 @@ import org.eclipse.jetty.http2.hpack.HpackDecoder; import org.eclipse.jetty.http2.hpack.HpackException; import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HeaderBlockParser { public static final MetaData STREAM_FAILURE = new MetaData(HttpVersion.HTTP_2, null); public static final MetaData SESSION_FAILURE = new MetaData(HttpVersion.HTTP_2, null); - private static final Logger LOG = Log.getLogger(HeaderBlockParser.class); + private static final Logger LOG = LoggerFactory.getLogger(HeaderBlockParser.class); private final HeaderParser headerParser; private final ByteBufferPool byteBufferPool; @@ -102,21 +102,21 @@ public class HeaderBlockParser catch (HpackException.StreamException x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Stream error, stream={}", headerParser.getStreamId(), x); notifier.streamFailure(headerParser.getStreamId(), ErrorCode.PROTOCOL_ERROR.code, "invalid_hpack_block"); return STREAM_FAILURE; } catch (HpackException.CompressionException x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Compression error, buffer={}", BufferUtil.toDetailString(buffer), x); notifier.connectionFailure(buffer, ErrorCode.COMPRESSION_ERROR.code, "invalid_hpack_block"); return SESSION_FAILURE; } catch (HpackException.SessionException x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Session error, buffer={}", BufferUtil.toDetailString(buffer), x); notifier.connectionFailure(buffer, ErrorCode.PROTOCOL_ERROR.code, "invalid_hpack_block"); return SESSION_FAILURE; } diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/Parser.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/Parser.java index 799c29fc3cc..5997c00d199 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/Parser.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/Parser.java @@ -36,8 +36,8 @@ import org.eclipse.jetty.http2.frames.SettingsFrame; import org.eclipse.jetty.http2.frames.WindowUpdateFrame; import org.eclipse.jetty.http2.hpack.HpackDecoder; import org.eclipse.jetty.io.ByteBufferPool; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

The HTTP/2 protocol parser.

@@ -46,7 +46,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class Parser { - private static final Logger LOG = Log.getLogger(Parser.class); + private static final Logger LOG = LoggerFactory.getLogger(Parser.class); private final ByteBufferPool byteBufferPool; private final Listener listener; @@ -138,7 +138,7 @@ public class Parser catch (Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Parse failed", x); connectionFailure(buffer, ErrorCode.PROTOCOL_ERROR, "parser_error"); } } diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/PrefaceParser.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/PrefaceParser.java index 6f4c85a3ed6..0dc6a052d3d 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/PrefaceParser.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/PrefaceParser.java @@ -23,12 +23,12 @@ import java.nio.ByteBuffer; import org.eclipse.jetty.http2.ErrorCode; import org.eclipse.jetty.http2.frames.PrefaceFrame; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class PrefaceParser { - private static final Logger LOG = Log.getLogger(PrefaceParser.class); + private static final Logger LOG = LoggerFactory.getLogger(PrefaceParser.class); private final Parser.Listener listener; private int cursor; diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/ServerParser.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/ServerParser.java index bf4aeea28f8..21aaf5aa6cd 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/ServerParser.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/ServerParser.java @@ -25,12 +25,12 @@ import org.eclipse.jetty.http2.Flags; import org.eclipse.jetty.http2.frames.FrameType; import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ServerParser extends Parser { - private static final Logger LOG = Log.getLogger(ServerParser.class); + private static final Logger LOG = LoggerFactory.getLogger(ServerParser.class); private final Listener listener; private final PrefaceParser prefaceParser; @@ -124,7 +124,7 @@ public class ServerParser extends Parser } catch (Throwable x) { - LOG.debug(x); + LOG.debug("Parse error", x); BufferUtil.clear(buffer); notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR.code, "parser_error"); } diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/SettingsBodyParser.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/SettingsBodyParser.java index 26fae4edd1f..1854ab3371d 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/SettingsBodyParser.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/SettingsBodyParser.java @@ -28,12 +28,12 @@ import org.eclipse.jetty.http2.ErrorCode; import org.eclipse.jetty.http2.Flags; import org.eclipse.jetty.http2.frames.Frame; import org.eclipse.jetty.http2.frames.SettingsFrame; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SettingsBodyParser extends BodyParser { - private static final Logger LOG = Log.getLogger(SettingsBodyParser.class); + private static final Logger LOG = LoggerFactory.getLogger(SettingsBodyParser.class); private final int maxKeys; private State state = State.PREPARE; diff --git a/jetty-http2/http2-hpack/pom.xml b/jetty-http2/http2-hpack/pom.xml index 6f154432a16..c3c2f088d34 100644 --- a/jetty-http2/http2-hpack/pom.xml +++ b/jetty-http2/http2-hpack/pom.xml @@ -48,6 +48,10 @@ jetty-io ${project.version}
+ + org.slf4j + slf4j-api + org.eclipse.jetty.tests @@ -55,6 +59,12 @@ ${project.version} test + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackContext.java b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackContext.java index d42de950516..546066dd610 100644 --- a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackContext.java +++ b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackContext.java @@ -32,8 +32,8 @@ import org.eclipse.jetty.http.HttpScheme; import org.eclipse.jetty.util.ArrayTernaryTrie; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.Trie; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * HPACK - Header Compression for HTTP/2 @@ -45,7 +45,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class HpackContext { - public static final Logger LOG = Log.getLogger(HpackContext.class); + public static final Logger LOG = LoggerFactory.getLogger(HpackContext.class); private static final String EMPTY = ""; public static final String[][] STATIC_TABLE = { diff --git a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackDecoder.java b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackDecoder.java index 4b6aa53d76f..ab07b75b27c 100644 --- a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackDecoder.java +++ b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackDecoder.java @@ -26,8 +26,8 @@ import org.eclipse.jetty.http.HttpTokens; import org.eclipse.jetty.http.MetaData; import org.eclipse.jetty.http2.hpack.HpackContext.Entry; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Hpack Decoder @@ -35,7 +35,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class HpackDecoder { - public static final Logger LOG = Log.getLogger(HpackDecoder.class); + public static final Logger LOG = LoggerFactory.getLogger(HpackDecoder.class); public static final HttpField.LongValueHttpField CONTENT_LENGTH_0 = new HttpField.LongValueHttpField(HttpHeader.CONTENT_LENGTH, 0L); diff --git a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java index ef89b05515a..d3b6a70e96b 100644 --- a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java +++ b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java @@ -38,12 +38,12 @@ import org.eclipse.jetty.http2.hpack.HpackContext.Entry; import org.eclipse.jetty.http2.hpack.HpackContext.StaticEntry; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HpackEncoder { - private static final Logger LOG = Log.getLogger(HpackEncoder.class); + private static final Logger LOG = LoggerFactory.getLogger(HpackEncoder.class); private static final HttpField[] STATUSES = new HttpField[599]; static final EnumSet DO_NOT_HUFFMAN = EnumSet.of( diff --git a/jetty-http2/http2-http-client-transport/pom.xml b/jetty-http2/http2-http-client-transport/pom.xml index 49a7e917d53..d4c7a55ad7b 100644 --- a/jetty-http2/http2-http-client-transport/pom.xml +++ b/jetty-http2/http2-http-client-transport/pom.xml @@ -30,12 +30,23 @@ jetty-alpn-java-client ${project.version} + + org.slf4j + slf4j-api + + org.eclipse.jetty jetty-alpn-java-server ${project.version} test + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/ClientHTTP2StreamEndPoint.java b/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/ClientHTTP2StreamEndPoint.java index f672bb74f38..f189f1c3ee8 100644 --- a/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/ClientHTTP2StreamEndPoint.java +++ b/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/ClientHTTP2StreamEndPoint.java @@ -24,12 +24,12 @@ import org.eclipse.jetty.http2.IStream; import org.eclipse.jetty.http2.frames.DataFrame; import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ClientHTTP2StreamEndPoint extends HTTP2StreamEndPoint implements HTTP2Channel.Client { - private static final Logger LOG = Log.getLogger(ClientHTTP2StreamEndPoint.class); + private static final Logger LOG = LoggerFactory.getLogger(ClientHTTP2StreamEndPoint.class); public ClientHTTP2StreamEndPoint(IStream stream) { diff --git a/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/HttpChannelOverHTTP2.java b/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/HttpChannelOverHTTP2.java index ed680456e31..2bec70b3e42 100644 --- a/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/HttpChannelOverHTTP2.java +++ b/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/HttpChannelOverHTTP2.java @@ -155,7 +155,7 @@ public class HttpChannelOverHTTP2 extends HttpChannel public void failed(Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("ReleaseCallback failed", x); release(); } diff --git a/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/HttpConnectionOverHTTP2.java b/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/HttpConnectionOverHTTP2.java index cc13c4bdeeb..95e4cb08479 100644 --- a/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/HttpConnectionOverHTTP2.java +++ b/jetty-http2/http2-http-client-transport/src/main/java/org/eclipse/jetty/http2/client/http/HttpConnectionOverHTTP2.java @@ -40,13 +40,13 @@ import org.eclipse.jetty.http2.ErrorCode; import org.eclipse.jetty.http2.IStream; import org.eclipse.jetty.http2.api.Session; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Sweeper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HttpConnectionOverHTTP2 extends HttpConnection implements Sweeper.Sweepable { - private static final Logger LOG = Log.getLogger(HttpConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpConnection.class); private final Set activeChannels = ConcurrentHashMap.newKeySet(); private final Queue idleChannels = new ConcurrentLinkedQueue<>(); diff --git a/jetty-http2/http2-server/pom.xml b/jetty-http2/http2-server/pom.xml index 702a6204ab0..ccbaeed6add 100644 --- a/jetty-http2/http2-server/pom.xml +++ b/jetty-http2/http2-server/pom.xml @@ -55,6 +55,10 @@ jetty-server ${project.version} + + org.slf4j + slf4j-api + org.eclipse.jetty jetty-servlet @@ -73,6 +77,12 @@ ${project.version} test + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2CServerConnectionFactory.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2CServerConnectionFactory.java index 5921710592e..9b4133c9bdd 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2CServerConnectionFactory.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2CServerConnectionFactory.java @@ -28,8 +28,8 @@ import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.util.annotation.Name; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * HTTP2 Clear Text Connection factory. @@ -46,7 +46,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class HTTP2CServerConnectionFactory extends HTTP2ServerConnectionFactory implements ConnectionFactory.Upgrading { - private static final Logger LOG = Log.getLogger(HTTP2CServerConnectionFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(HTTP2CServerConnectionFactory.class); public HTTP2CServerConnectionFactory(@Name("config") HttpConfiguration httpConfiguration) { diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerConnectionFactory.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerConnectionFactory.java index 49e44ef0b4e..cd116fecc43 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerConnectionFactory.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerConnectionFactory.java @@ -40,12 +40,12 @@ import org.eclipse.jetty.server.NegotiatingServerConnection.CipherDiscriminator; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.Name; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HTTP2ServerConnectionFactory extends AbstractHTTP2ServerConnectionFactory implements CipherDiscriminator { - private static final Logger LOG = Log.getLogger(HTTP2ServerConnectionFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(HTTP2ServerConnectionFactory.class); public HTTP2ServerConnectionFactory(@Name("config") HttpConfiguration httpConfiguration) { diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerSession.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerSession.java index d7b0cb3a959..1660a244a85 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerSession.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerSession.java @@ -39,13 +39,13 @@ import org.eclipse.jetty.http2.generator.Generator; import org.eclipse.jetty.http2.parser.ServerParser; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HTTP2ServerSession extends HTTP2Session implements ServerParser.Listener { - private static final Logger LOG = Log.getLogger(HTTP2ServerSession.class); + private static final Logger LOG = LoggerFactory.getLogger(HTTP2ServerSession.class); private final ServerSessionListener listener; diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpChannelOverHTTP2.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpChannelOverHTTP2.java index bd251ef6477..f83e43f985f 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpChannelOverHTTP2.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpChannelOverHTTP2.java @@ -45,12 +45,12 @@ import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpInput; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HttpChannelOverHTTP2 extends HttpChannel implements Closeable, WriteFlusher.Listener, HTTP2Channel.Server { - private static final Logger LOG = Log.getLogger(HttpChannelOverHTTP2.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpChannelOverHTTP2.class); private static final HttpField SERVER_VERSION = new PreEncodedHttpField(HttpHeader.SERVER, HttpConfiguration.SERVER_VERSION); private static final HttpField POWERED_BY = new PreEncodedHttpField(HttpHeader.X_POWERED_BY, HttpConfiguration.SERVER_VERSION); diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java index 416c8acc090..d9bc67dc04c 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java @@ -42,12 +42,12 @@ import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.Promise; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HttpTransportOverHTTP2 implements HttpTransport { - private static final Logger LOG = Log.getLogger(HttpTransportOverHTTP2.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpTransportOverHTTP2.class); private final AtomicBoolean commit = new AtomicBoolean(); private final TransportCallback transportCallback = new TransportCallback(); diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/ServerHTTP2StreamEndPoint.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/ServerHTTP2StreamEndPoint.java index 49cdf584001..9b922d327c3 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/ServerHTTP2StreamEndPoint.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/ServerHTTP2StreamEndPoint.java @@ -27,12 +27,12 @@ import org.eclipse.jetty.http2.frames.DataFrame; import org.eclipse.jetty.http2.frames.HeadersFrame; import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ServerHTTP2StreamEndPoint extends HTTP2StreamEndPoint implements HTTP2Channel.Server { - private static final Logger LOG = Log.getLogger(ServerHTTP2StreamEndPoint.class); + private static final Logger LOG = LoggerFactory.getLogger(ServerHTTP2StreamEndPoint.class); public ServerHTTP2StreamEndPoint(IStream stream) { diff --git a/jetty-infinispan/infinispan-common/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionDataStore.java b/jetty-infinispan/infinispan-common/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionDataStore.java index 0598f614bf5..a94e08c902d 100644 --- a/jetty-infinispan/infinispan-common/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionDataStore.java +++ b/jetty-infinispan/infinispan-common/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionDataStore.java @@ -29,9 +29,9 @@ import org.eclipse.jetty.server.session.SessionData; import org.eclipse.jetty.server.session.UnreadableSessionDataException; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.infinispan.commons.api.BasicCache; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * InfinispanSessionDataStore @@ -39,7 +39,7 @@ import org.infinispan.commons.api.BasicCache; @ManagedObject public class InfinispanSessionDataStore extends AbstractSessionDataStore { - private static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(InfinispanSessionDataStore.class); /** * Clustered cache of sessions diff --git a/jetty-io/pom.xml b/jetty-io/pom.xml index ef53deabed6..77e73ece8aa 100644 --- a/jetty-io/pom.xml +++ b/jetty-io/pom.xml @@ -18,6 +18,16 @@ jetty-util ${project.version} + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java index 3d3043f6ee5..eac63d67f89 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java @@ -26,9 +26,9 @@ import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.TimeoutException; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Invocable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A convenience base implementation of {@link Connection}.

@@ -39,7 +39,7 @@ import org.eclipse.jetty.util.thread.Invocable; */ public abstract class AbstractConnection implements Connection { - private static final Logger LOG = Log.getLogger(AbstractConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractConnection.class); private final List _listeners = new CopyOnWriteArrayList<>(); private final long _created = System.currentTimeMillis(); @@ -95,7 +95,7 @@ public abstract class AbstractConnection implements Connection } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed callback", x); } }; @@ -108,7 +108,7 @@ public abstract class AbstractConnection implements Connection } catch (RejectedExecutionException e) { - LOG.debug(e); + LOG.debug("Rejected", e); callback.failed(x); } break; diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java index b00ac5dcb7e..7cd08ad4542 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java @@ -25,13 +25,13 @@ import java.util.concurrent.atomic.AtomicReference; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint { - private static final Logger LOG = Log.getLogger(AbstractEndPoint.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractEndPoint.class); private final AtomicReference _state = new AtomicReference<>(State.OPEN); private final long _created = System.currentTimeMillis(); diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ByteArrayEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ByteArrayEndPoint.java index 50cdf335de5..bddd34d0bfc 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ByteArrayEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ByteArrayEndPoint.java @@ -34,17 +34,17 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Condition; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.AutoLock; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ByteArrayEndPoint. */ public class ByteArrayEndPoint extends AbstractEndPoint { - static final Logger LOG = Log.getLogger(ByteArrayEndPoint.class); + static final Logger LOG = LoggerFactory.getLogger(ByteArrayEndPoint.class); static final InetAddress NOIP; static final InetSocketAddress NOIPPORT; @@ -57,7 +57,7 @@ public class ByteArrayEndPoint extends AbstractEndPoint } catch (UnknownHostException e) { - LOG.warn(e); + LOG.warn("Unable to get IPv4 no-ip reference for 0.0.0.0", e); } finally { diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ChannelEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ChannelEndPoint.java index 323fc4496d2..2c89a173753 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ChannelEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ChannelEndPoint.java @@ -28,10 +28,10 @@ import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Invocable; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Channel End Point. @@ -39,7 +39,7 @@ import org.eclipse.jetty.util.thread.Scheduler; */ public abstract class ChannelEndPoint extends AbstractEndPoint implements ManagedSelector.Selectable { - private static final Logger LOG = Log.getLogger(ChannelEndPoint.class); + private static final Logger LOG = LoggerFactory.getLogger(ChannelEndPoint.class); private final ByteChannel _channel; private final GatheringByteChannel _gather; @@ -89,7 +89,7 @@ public abstract class ChannelEndPoint extends AbstractEndPoint implements Manage } catch (Throwable x) { - LOG.warn(x); + LOG.warn("Unable to close ChannelEndPoint", x); } } } @@ -192,7 +192,7 @@ public abstract class ChannelEndPoint extends AbstractEndPoint implements Manage } catch (IOException e) { - LOG.debug(e); + LOG.debug("Unable to close channel", e); } finally { @@ -232,7 +232,7 @@ public abstract class ChannelEndPoint extends AbstractEndPoint implements Manage } catch (IOException e) { - LOG.debug(e); + LOG.debug("Unable to shutdown output", e); shutdownInput(); filled = -1; } diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java index a13617f8a86..abe77a5673e 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java @@ -32,12 +32,12 @@ import java.util.concurrent.Executor; import org.eclipse.jetty.util.Promise; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ClientConnector extends ContainerLifeCycle { @@ -45,7 +45,7 @@ public class ClientConnector extends ContainerLifeCycle public static final String REMOTE_SOCKET_ADDRESS_CONTEXT_KEY = CLIENT_CONNECTOR_CONTEXT_KEY + ".remoteSocketAddress"; public static final String CLIENT_CONNECTION_FACTORY_CONTEXT_KEY = CLIENT_CONNECTOR_CONTEXT_KEY + ".clientConnectionFactory"; public static final String CONNECTION_PROMISE_CONTEXT_KEY = CLIENT_CONNECTOR_CONTEXT_KEY + ".connectionPromise"; - private static final Logger LOG = Log.getLogger(ClientConnector.class); + private static final Logger LOG = LoggerFactory.getLogger(ClientConnector.class); private Executor executor; private Scheduler scheduler; @@ -288,7 +288,7 @@ public class ClientConnector extends ContainerLifeCycle } catch (Throwable x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } } diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/CyclicTimeout.java b/jetty-io/src/main/java/org/eclipse/jetty/io/CyclicTimeout.java index 0e4b60e0598..f064941af8e 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/CyclicTimeout.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/CyclicTimeout.java @@ -22,9 +22,9 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import org.eclipse.jetty.util.component.Destroyable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.lang.Long.MAX_VALUE; @@ -50,7 +50,7 @@ import static java.lang.Long.MAX_VALUE; */ public abstract class CyclicTimeout implements Destroyable { - private static final Logger LOG = Log.getLogger(CyclicTimeout.class); + private static final Logger LOG = LoggerFactory.getLogger(CyclicTimeout.class); private static final Timeout NOT_SET = new Timeout(MAX_VALUE, null); private static final Scheduler.Task DESTROYED = () -> false; diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/FillInterest.java b/jetty-io/src/main/java/org/eclipse/jetty/io/FillInterest.java index 25705ea3eda..b904638d665 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/FillInterest.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/FillInterest.java @@ -24,10 +24,10 @@ import java.nio.channels.ReadPendingException; import java.util.concurrent.atomic.AtomicReference; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Invocable; import org.eclipse.jetty.util.thread.Invocable.InvocationType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A Utility class to help implement {@link EndPoint#fillInterested(Callback)} @@ -35,7 +35,7 @@ import org.eclipse.jetty.util.thread.Invocable.InvocationType; */ public abstract class FillInterest { - private static final Logger LOG = Log.getLogger(FillInterest.class); + private static final Logger LOG = LoggerFactory.getLogger(FillInterest.class); private final AtomicReference _interested = new AtomicReference<>(null); protected FillInterest() diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/IdleTimeout.java b/jetty-io/src/main/java/org/eclipse/jetty/io/IdleTimeout.java index 012c0485a0e..99d4969f1c9 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/IdleTimeout.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/IdleTimeout.java @@ -22,9 +22,9 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicReference; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * An Abstract implementation of an Idle Timeout. @@ -36,7 +36,7 @@ import org.eclipse.jetty.util.thread.Scheduler; */ public abstract class IdleTimeout { - private static final Logger LOG = Log.getLogger(IdleTimeout.class); + private static final Logger LOG = LoggerFactory.getLogger(IdleTimeout.class); private final Scheduler _scheduler; private final AtomicReference _timeout = new AtomicReference<>(); private volatile long _idleTimeout; diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/LeakTrackingByteBufferPool.java b/jetty-io/src/main/java/org/eclipse/jetty/io/LeakTrackingByteBufferPool.java index 61683237e3a..d61dce79115 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/LeakTrackingByteBufferPool.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/LeakTrackingByteBufferPool.java @@ -24,12 +24,12 @@ import java.util.concurrent.atomic.AtomicLong; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.LeakDetector; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class LeakTrackingByteBufferPool extends ContainerLifeCycle implements ByteBufferPool { - private static final Logger LOG = Log.getLogger(LeakTrackingByteBufferPool.class); + private static final Logger LOG = LoggerFactory.getLogger(LeakTrackingByteBufferPool.class); private final LeakDetector leakDetector = new LeakDetector() { diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java index e8b1122c7ba..afa3410f882 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java @@ -36,6 +36,7 @@ import java.util.Deque; import java.util.Iterator; import java.util.List; import java.util.Locale; +import java.util.Objects; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor; @@ -47,11 +48,11 @@ import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ExecutionStrategy; import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.util.thread.strategy.EatWhatYouKill; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

{@link ManagedSelector} wraps a {@link Selector} simplifying non-blocking operations on channels.

@@ -61,7 +62,7 @@ import org.eclipse.jetty.util.thread.strategy.EatWhatYouKill; */ public class ManagedSelector extends ContainerLifeCycle implements Dumpable { - private static final Logger LOG = Log.getLogger(ManagedSelector.class); + private static final Logger LOG = LoggerFactory.getLogger(ManagedSelector.class); private static final boolean FORCE_SELECT_NOW; static @@ -302,7 +303,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable } catch (Throwable x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); return -1; } } @@ -315,7 +316,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable } catch (Throwable x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); return -1; } } @@ -434,7 +435,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable } catch (Throwable th) { - LOG.warn(th); + LOG.warn("Cannot update selector {}", _selector, th); } } _updateable.clear(); @@ -512,7 +513,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable else { LOG.warn(x.toString()); - LOG.debug(x); + LOG.debug("select() failure", x); } } return false; @@ -639,7 +640,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable } catch (InterruptedException x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } return keys; } @@ -671,7 +672,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable catch (Throwable x) { IO.close(_channel); - LOG.warn(x); + LOG.warn("Unable to register OP_ACCEPT on selector", x); } } @@ -746,7 +747,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable { IO.close(channel); _selectorManager.onAcceptFailed(channel, x); - LOG.debug(x); + LOG.debug("Unable to register update for accept", x); } } @@ -760,7 +761,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable } catch (Throwable x) { - LOG.debug(x); + LOG.debug("Unable to accept", x); failed(x); } } @@ -768,8 +769,8 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable protected void failed(Throwable failure) { IO.close(channel); - LOG.warn(String.valueOf(failure)); - LOG.debug(failure); + LOG.warn("ManagedSelector#Accept failure : {}", Objects.toString(failure)); + LOG.debug("ManagedSelector#Accept failure", failure); _selectorManager.onAcceptFailed(channel, failure); } } @@ -934,8 +935,8 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable catch (Throwable failure) { IO.close(_connect.channel); - LOG.warn(String.valueOf(failure)); - LOG.debug(failure); + LOG.warn("ManagedSelector#CreateEndpoint failure : {}", Objects.toString(failure)); + LOG.debug("ManagedSelector#CreateEndpoint failure", failure); _connect.failed(failure); } } diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java index 7060f86a6bc..79b22580dac 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java @@ -24,12 +24,12 @@ import java.util.concurrent.Executor; import javax.net.ssl.SSLEngine; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class NegotiatingClientConnection extends AbstractConnection { - private static final Logger LOG = Log.getLogger(NegotiatingClientConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(NegotiatingClientConnection.class); private final SSLEngine engine; private final ClientConnectionFactory connectionFactory; @@ -108,7 +108,7 @@ public abstract class NegotiatingClientConnection extends AbstractConnection } catch (IOException x) { - LOG.debug(x); + LOG.debug("Unable to fill from endpoint", x); close(); return -1; } @@ -123,7 +123,7 @@ public abstract class NegotiatingClientConnection extends AbstractConnection } catch (Throwable x) { - LOG.debug(x); + LOG.debug("Unable to replace connection", x); close(); } } diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/NetworkTrafficSelectChannelEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/NetworkTrafficSelectChannelEndPoint.java index 6985babda5c..5ff5c11a33c 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/NetworkTrafficSelectChannelEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/NetworkTrafficSelectChannelEndPoint.java @@ -25,13 +25,13 @@ import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; import java.util.List; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class NetworkTrafficSelectChannelEndPoint extends SocketChannelEndPoint { - private static final Logger LOG = Log.getLogger(NetworkTrafficSelectChannelEndPoint.class); + private static final Logger LOG = LoggerFactory.getLogger(NetworkTrafficSelectChannelEndPoint.class); private final List listeners; @@ -85,7 +85,7 @@ public class NetworkTrafficSelectChannelEndPoint extends SocketChannelEndPoint } catch (Exception x) { - LOG.warn(x); + LOG.warn("listener.opened failure", x); } } } @@ -105,7 +105,7 @@ public class NetworkTrafficSelectChannelEndPoint extends SocketChannelEndPoint } catch (Exception x) { - LOG.warn(x); + LOG.warn("listener.closed failure", x); } } } @@ -124,7 +124,7 @@ public class NetworkTrafficSelectChannelEndPoint extends SocketChannelEndPoint } catch (Exception x) { - LOG.warn(x); + LOG.warn("listener.incoming() failure", x); } } } @@ -143,7 +143,7 @@ public class NetworkTrafficSelectChannelEndPoint extends SocketChannelEndPoint } catch (Exception x) { - LOG.warn(x); + LOG.warn("listener.outgoing() failure", x); } } } diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java b/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java index 1e6bf65f9fc..fb427e68291 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java @@ -41,11 +41,11 @@ import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.Container; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.util.thread.ThreadPool; import org.eclipse.jetty.util.thread.ThreadPoolBudget; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

{@link SelectorManager} manages a number of {@link ManagedSelector}s that @@ -58,7 +58,7 @@ import org.eclipse.jetty.util.thread.ThreadPoolBudget; public abstract class SelectorManager extends ContainerLifeCycle implements Dumpable { public static final int DEFAULT_CONNECT_TIMEOUT = 15000; - protected static final Logger LOG = Log.getLogger(SelectorManager.class); + protected static final Logger LOG = LoggerFactory.getLogger(SelectorManager.class); private final Executor executor; private final Scheduler scheduler; @@ -433,7 +433,7 @@ public abstract class SelectorManager extends ContainerLifeCycle implements Dump } catch (Throwable x) { - LOG.warn(x); + LOG.warn("Failed to notify onAccepting on listener {}", l, x); } } } @@ -448,7 +448,7 @@ public abstract class SelectorManager extends ContainerLifeCycle implements Dump } catch (Throwable x) { - LOG.warn(x); + LOG.warn("Failed to notify onAcceptFailed on listener {}", l, x); } } } @@ -463,7 +463,7 @@ public abstract class SelectorManager extends ContainerLifeCycle implements Dump } catch (Throwable x) { - LOG.warn(x); + LOG.warn("Failed to notify onAccepted on listener {}", l, x); } } } diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/SocketChannelEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/SocketChannelEndPoint.java index 313523cf0b4..23809302b8c 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/SocketChannelEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/SocketChannelEndPoint.java @@ -25,13 +25,13 @@ import java.nio.channels.SelectableChannel; import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SocketChannelEndPoint extends ChannelEndPoint { - private static final Logger LOG = Log.getLogger(SocketChannelEndPoint.class); + private static final Logger LOG = LoggerFactory.getLogger(SocketChannelEndPoint.class); private final Socket _socket; private final InetSocketAddress _local; private final InetSocketAddress _remote; @@ -77,7 +77,7 @@ public class SocketChannelEndPoint extends ChannelEndPoint } catch (IOException e) { - LOG.debug(e); + LOG.debug("Unable to shutdown output", e); } } } diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/WriteFlusher.java b/jetty-io/src/main/java/org/eclipse/jetty/io/WriteFlusher.java index b24c7f25d66..d75415dffee 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/WriteFlusher.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/WriteFlusher.java @@ -31,10 +31,10 @@ import java.util.concurrent.atomic.AtomicReference; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Invocable; import org.eclipse.jetty.util.thread.Invocable.InvocationType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A Utility class to help implement {@link EndPoint#write(Callback, ByteBuffer...)} by calling @@ -45,7 +45,7 @@ import org.eclipse.jetty.util.thread.Invocable.InvocationType; */ public abstract class WriteFlusher { - private static final Logger LOG = Log.getLogger(WriteFlusher.class); + private static final Logger LOG = LoggerFactory.getLogger(WriteFlusher.class); private static final boolean DEBUG = LOG.isDebugEnabled(); // Easy for the compiler to remove the code if DEBUG==false private static final ByteBuffer[] EMPTY_BUFFERS = new ByteBuffer[]{BufferUtil.EMPTY_BUFFER}; private static final EnumMap> __stateTransitions = new EnumMap<>(StateType.class); @@ -325,7 +325,7 @@ public abstract class WriteFlusher case IDLE: for (Throwable t : suppressed) { - LOG.warn(t); + LOG.warn("Failed Write Cause", t); } return; @@ -489,7 +489,7 @@ public abstract class WriteFlusher if (DEBUG) { LOG.debug("ignored: {} {}", cause, this); - LOG.ignore(cause); + LOG.trace("IGNORED", cause); } return false; diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java index 4b6d5b06424..a23e92e9e9f 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java @@ -43,9 +43,9 @@ import org.eclipse.jetty.io.WriteFlusher; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Invocable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A Connection that acts as an interceptor between an EndPoint providing SSL encrypted data @@ -79,7 +79,7 @@ import org.eclipse.jetty.util.thread.Invocable; */ public class SslConnection extends AbstractConnection implements Connection.UpgradeTo { - private static final Logger LOG = Log.getLogger(SslConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(SslConnection.class); private static final String TLS_1_3 = "TLSv1.3"; private enum HandshakeState @@ -930,7 +930,7 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr } catch (Throwable x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } } @@ -946,12 +946,12 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr { if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING && isRequireCloseMessage()) throw x; - LOG.ignore(x); + LOG.trace("IGNORED", x); return x; } catch (Throwable x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); return x; } } @@ -1200,7 +1200,7 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr } catch (IOException e) { - LOG.debug(e); + LOG.debug("Incomplete flush?", e); close(e); write = BufferUtil.EMPTY_BUFFER; _flushState = FlushState.WRITING; @@ -1300,7 +1300,7 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr } catch (Throwable x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); endPoint.close(); } } @@ -1314,7 +1314,7 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr catch (Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Unable to close outbound", x); } } @@ -1339,7 +1339,7 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr } catch (Throwable x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); return true; } } @@ -1373,7 +1373,7 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr } catch (Throwable x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); return true; } } diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java index fc479ba2813..537174b8625 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/SocketChannelEndPointTest.java @@ -48,8 +48,6 @@ import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FutureCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.Scheduler; @@ -62,6 +60,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThan; @@ -75,7 +75,7 @@ import static org.junit.jupiter.api.Assertions.fail; @SuppressWarnings("Duplicates") public class SocketChannelEndPointTest { - private static final Logger LOG = Log.getLogger(SocketChannelEndPoint.class); + private static final Logger LOG = LoggerFactory.getLogger(SocketChannelEndPoint.class); public interface Scenario { @@ -673,7 +673,7 @@ public class SocketChannelEndPointTest @SuppressWarnings("Duplicates") public static class TestConnection extends AbstractConnection { - private static final Logger LOG = Log.getLogger(TestConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(TestConnection.class); volatile FutureCallback _blockingRead; final AtomicInteger _blockAt; @@ -814,13 +814,13 @@ public class SocketChannelEndPointTest catch (InterruptedException | EofException e) { if (LOG.isDebugEnabled()) - LOG.debug(e); + LOG.debug("Fill interrupted", e); else LOG.info(e.getClass().getName()); } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to fill from endpoint", e); } } } diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/SslConnectionTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SslConnectionTest.java index 43678aca45a..3ad5bdd737e 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/SslConnectionTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/SslConnectionTest.java @@ -42,7 +42,6 @@ import org.eclipse.jetty.io.ssl.SslConnection; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.FutureCallback; -import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.Scheduler; @@ -50,6 +49,8 @@ import org.eclipse.jetty.util.thread.TimerScheduler; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -60,6 +61,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class SslConnectionTest { + private static final Logger LOG = LoggerFactory.getLogger(SslConnectionTest.class); + private static final int TIMEOUT = 1000000; private static ByteBufferPool __byteBufferPool = new LeakTrackingByteBufferPool(new MappedByteBufferPool.Tagged()); @@ -250,11 +253,11 @@ public class SslConnectionTest } catch (InterruptedException | EofException e) { - Log.getRootLogger().ignore(e); + LOG.trace("IGNORED", e); } catch (Exception e) { - Log.getRootLogger().warn(e); + LOG.warn("During onFillable", e); } finally { diff --git a/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/JAASLoginService.java b/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/JAASLoginService.java index 84dcd36dae4..23ec9436cde 100644 --- a/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/JAASLoginService.java +++ b/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/JAASLoginService.java @@ -48,8 +48,8 @@ import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.util.ArrayUtil; import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * JAASLoginService @@ -60,7 +60,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class JAASLoginService extends AbstractLifeCycle implements LoginService { - private static final Logger LOG = Log.getLogger(JAASLoginService.class); + private static final Logger LOG = LoggerFactory.getLogger(JAASLoginService.class); public static final String DEFAULT_ROLE_CLASS_NAME = "org.eclipse.jetty.jaas.JAASRole"; public static final String[] DEFAULT_ROLE_CLASS_NAMES = {DEFAULT_ROLE_CLASS_NAME}; @@ -263,7 +263,7 @@ public class JAASLoginService extends AbstractLifeCycle implements LoginService } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } return null; } @@ -293,7 +293,7 @@ public class JAASLoginService extends AbstractLifeCycle implements LoginService } catch (LoginException e) { - LOG.warn(e); + LOG.warn("Failed to logout {}", user, e); } } diff --git a/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/AbstractDatabaseLoginModule.java b/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/AbstractDatabaseLoginModule.java index 8a2db300dd5..d28af395ef8 100644 --- a/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/AbstractDatabaseLoginModule.java +++ b/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/AbstractDatabaseLoginModule.java @@ -27,9 +27,9 @@ import java.util.Map; import javax.security.auth.Subject; import javax.security.auth.callback.CallbackHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Credential; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AbstractDatabaseLoginModule @@ -40,7 +40,7 @@ import org.eclipse.jetty.util.security.Credential; */ public abstract class AbstractDatabaseLoginModule extends AbstractLoginModule { - private static final Logger LOG = Log.getLogger(AbstractDatabaseLoginModule.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractDatabaseLoginModule.class); private String userQuery; private String rolesQuery; diff --git a/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/JDBCLoginModule.java b/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/JDBCLoginModule.java index 48da75fe002..df1b4627acc 100644 --- a/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/JDBCLoginModule.java +++ b/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/JDBCLoginModule.java @@ -25,8 +25,8 @@ import javax.security.auth.Subject; import javax.security.auth.callback.CallbackHandler; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * JDBCLoginModule @@ -39,7 +39,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class JDBCLoginModule extends AbstractDatabaseLoginModule { - private static final Logger LOG = Log.getLogger(JDBCLoginModule.class); + private static final Logger LOG = LoggerFactory.getLogger(JDBCLoginModule.class); private String dbDriver; private String dbUrl; diff --git a/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/LdapLoginModule.java b/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/LdapLoginModule.java index fc5eef8d330..9aa236f822c 100644 --- a/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/LdapLoginModule.java +++ b/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/LdapLoginModule.java @@ -46,9 +46,9 @@ import javax.security.auth.login.LoginException; import org.eclipse.jetty.jaas.callback.ObjectCallback; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Credential; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A LdapLoginModule for use with JAAS setups @@ -84,7 +84,7 @@ import org.eclipse.jetty.util.security.Credential; */ public class LdapLoginModule extends AbstractLoginModule { - private static final Logger LOG = Log.getLogger(LdapLoginModule.class); + private static final Logger LOG = LoggerFactory.getLogger(LdapLoginModule.class); /** * hostname of the ldap server @@ -450,17 +450,13 @@ public class LdapLoginModule extends AbstractLoginModule catch (IOException e) { if (_debug) - { - LOG.info(e); - } + LOG.info("Login failure", e); throw new LoginException("IO Error performing login."); } catch (AuthenticationException e) { if (_debug) - { - LOG.info(e); - } + LOG.info("Login failure", e); return false; } catch (LoginException e) @@ -470,7 +466,7 @@ public class LdapLoginModule extends AbstractLoginModule catch (Exception e) { if (_debug) - LOG.info(e); + LOG.info("Login failure", e); throw new LoginException("Error obtaining user info"); } } diff --git a/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/PropertyFileLoginModule.java b/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/PropertyFileLoginModule.java index f929e66ee97..73b733e5061 100644 --- a/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/PropertyFileLoginModule.java +++ b/jetty-jaas/src/main/java/org/eclipse/jetty/jaas/spi/PropertyFileLoginModule.java @@ -29,9 +29,9 @@ import javax.security.auth.callback.CallbackHandler; import org.eclipse.jetty.security.AbstractLoginService; import org.eclipse.jetty.security.PropertyUserStore; import org.eclipse.jetty.server.UserIdentity; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Credential; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * PropertyFileLoginModule @@ -40,7 +40,7 @@ public class PropertyFileLoginModule extends AbstractLoginModule { public static final String DEFAULT_FILENAME = "realm.properties"; - private static final Logger LOG = Log.getLogger(PropertyFileLoginModule.class); + private static final Logger LOG = LoggerFactory.getLogger(PropertyFileLoginModule.class); private static ConcurrentHashMap _propertyUserStores = new ConcurrentHashMap(); diff --git a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticator.java b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticator.java index 9a110eda17f..a005f5f6528 100644 --- a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticator.java +++ b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticator.java @@ -44,15 +44,15 @@ import org.eclipse.jetty.security.authentication.SessionAuthentication; import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.Authentication.User; import org.eclipse.jetty.server.UserIdentity; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @version $Rev: 4793 $ $Date: 2009-03-19 00:00:01 +0100 (Thu, 19 Mar 2009) $ */ public class JaspiAuthenticator extends LoginAuthenticator { - private static final Logger LOG = Log.getLogger(JaspiAuthenticator.class.getName()); + private static final Logger LOG = LoggerFactory.getLogger(JaspiAuthenticator.class.getName()); private final ServerAuthConfig _authConfig; diff --git a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticatorFactory.java b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticatorFactory.java index 710ff6f91c5..cfbf05c9e23 100644 --- a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticatorFactory.java +++ b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticatorFactory.java @@ -37,12 +37,12 @@ import org.eclipse.jetty.security.DefaultAuthenticatorFactory; import org.eclipse.jetty.security.IdentityService; import org.eclipse.jetty.security.LoginService; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JaspiAuthenticatorFactory extends DefaultAuthenticatorFactory { - private static final Logger LOG = Log.getLogger(JaspiAuthenticatorFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(JaspiAuthenticatorFactory.class); private static String MESSAGE_LAYER = "HTTP"; @@ -120,7 +120,7 @@ public class JaspiAuthenticatorFactory extends DefaultAuthenticatorFactory } catch (AuthException e) { - LOG.warn(e); + LOG.warn("Failed to get ServerAuthConfig", e); } return authenticator; } diff --git a/jetty-jaspi/src/test/java/org/eclipse/jetty/security/jaspi/BasicAuthModule.java b/jetty-jaspi/src/test/java/org/eclipse/jetty/security/jaspi/BasicAuthModule.java index a15393b0f91..7b7f412af1e 100644 --- a/jetty-jaspi/src/test/java/org/eclipse/jetty/security/jaspi/BasicAuthModule.java +++ b/jetty-jaspi/src/test/java/org/eclipse/jetty/security/jaspi/BasicAuthModule.java @@ -32,13 +32,13 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.security.jaspi.modules.BaseAuthModule; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Constraint; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class BasicAuthModule extends BaseAuthModule { - private static final Logger LOG = Log.getLogger(BasicAuthModule.class); + private static final Logger LOG = LoggerFactory.getLogger(BasicAuthModule.class); private String realmName; diff --git a/jetty-jmx/pom.xml b/jetty-jmx/pom.xml index 639ef6aaa5f..9115002325a 100644 --- a/jetty-jmx/pom.xml +++ b/jetty-jmx/pom.xml @@ -18,7 +18,7 @@ maven-surefire-plugin - @{argLine} ${jetty.surefire.argLine} --add-opens org.eclipse.jetty.jmx/org.eclipse.jetty.jmx=ALL-UNNAMED --add-opens org.eclipse.jetty.jmx/org.eclipse.jetty.util.log.jmx=ALL-UNNAMED + @{argLine} ${jetty.surefire.argLine} --add-opens org.eclipse.jetty.jmx/org.eclipse.jetty.jmx=ALL-UNNAMED --add-opens org.eclipse.jetty.jmx/org.eclipse.jetty.logging.jmx=ALL-UNNAMED @@ -42,6 +42,13 @@ jetty-util ${project.version} + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + provided + true + com.openpojo diff --git a/jetty-jmx/src/main/config/etc/jetty-jmx.xml b/jetty-jmx/src/main/config/etc/jetty-jmx.xml index 24c0e2031d4..052fa7cc506 100644 --- a/jetty-jmx/src/main/config/etc/jetty-jmx.xml +++ b/jetty-jmx/src/main/config/etc/jetty-jmx.xml @@ -21,12 +21,5 @@ - - - - - - - diff --git a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ConnectorServer.java b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ConnectorServer.java index 255e2750403..6a287c07226 100644 --- a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ConnectorServer.java +++ b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ConnectorServer.java @@ -43,10 +43,10 @@ import javax.rmi.ssl.SslRMIClientSocketFactory; import org.eclipse.jetty.util.HostPort; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.ShutdownThread; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

LifeCycle wrapper for JMXConnectorServer.

@@ -61,7 +61,7 @@ import org.eclipse.jetty.util.thread.ShutdownThread; public class ConnectorServer extends AbstractLifeCycle { public static final String RMI_REGISTRY_CLIENT_SOCKET_FACTORY_ATTRIBUTE = "com.sun.jndi.rmi.factory.socket"; - private static final Logger LOG = Log.getLogger(ConnectorServer.class); + private static final Logger LOG = LoggerFactory.getLogger(ConnectorServer.class); private JMXServiceURL _jmxURL; private final Map _environment; @@ -183,7 +183,7 @@ public class ConnectorServer extends AbstractLifeCycle } catch (Throwable ex) { - LOG.ignore(ex); + LOG.trace("IGNORED", ex); } RMIClientSocketFactory csf = _sslContextFactory == null ? null : new SslRMIClientSocketFactory(); @@ -208,7 +208,7 @@ public class ConnectorServer extends AbstractLifeCycle } catch (Exception ex) { - LOG.ignore(ex); + LOG.trace("IGNORED", ex); } finally { diff --git a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java index d1f9bfb9350..f8db4c44bd2 100644 --- a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java +++ b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java @@ -45,8 +45,8 @@ import org.eclipse.jetty.util.component.Container; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.Destroyable; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Container class for the MBean instances @@ -54,7 +54,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("The component that registers beans as MBeans") public class MBeanContainer implements Container.InheritedListener, Dumpable, Destroyable { - private static final Logger LOG = Log.getLogger(MBeanContainer.class.getName()); + private static final Logger LOG = LoggerFactory.getLogger(MBeanContainer.class.getName()); private static final ConcurrentMap __unique = new ConcurrentHashMap<>(); private static final Container ROOT = new ContainerLifeCycle(); @@ -436,11 +436,11 @@ public class MBeanContainer implements Container.InheritedListener, Dumpable, De } catch (MBeanRegistrationException | InstanceNotFoundException x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } catch (Throwable x) { - LOG.warn(x); + LOG.warn("Unable to unregister {}", objectName, x); } } } diff --git a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MetaData.java b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MetaData.java index 2d960d64dc9..7af48fb4f6c 100644 --- a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MetaData.java +++ b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MetaData.java @@ -47,12 +47,12 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; import org.eclipse.jetty.util.annotation.Name; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; class MetaData { - private static final Logger LOG = Log.getLogger(MetaData.class); + private static final Logger LOG = LoggerFactory.getLogger(MetaData.class); private static final MBeanAttributeInfo[] NO_ATTRIBUTES = new MBeanAttributeInfo[0]; private static final MBeanConstructorInfo[] NO_CONSTRUCTORS = new MBeanConstructorInfo[0]; private static final MBeanOperationInfo[] NO_OPERATIONS = new MBeanOperationInfo[0]; diff --git a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ObjectMBean.java b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ObjectMBean.java index 6d848c9d0a3..72478e58b73 100644 --- a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ObjectMBean.java +++ b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ObjectMBean.java @@ -27,8 +27,8 @@ import javax.management.MBeanInfo; import javax.management.ObjectName; import javax.management.ReflectionException; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A dynamic MBean that can wrap an arbitrary Object instance.

@@ -44,7 +44,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class ObjectMBean implements DynamicMBean { - private static final Logger LOG = Log.getLogger(ObjectMBean.class); + private static final Logger LOG = LoggerFactory.getLogger(ObjectMBean.class); protected final Object _managed; private MetaData _metaData; @@ -154,7 +154,7 @@ public class ObjectMBean implements DynamicMBean catch (Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Unable to get attribute {}", name, x); } } return results; @@ -188,7 +188,7 @@ public class ObjectMBean implements DynamicMBean catch (Throwable x) { if (LOG.isDebugEnabled()) - LOG.debug(x); + LOG.debug("Unable to get Attribute {}", attribute, x); } } return results; diff --git a/jetty-jmx/src/test/java/com/acme/jmx/DerivedMBean.java b/jetty-jmx/src/test/java/com/acme/jmx/DerivedMBean.java index 32cb90e664f..f3d8782b119 100644 --- a/jetty-jmx/src/test/java/com/acme/jmx/DerivedMBean.java +++ b/jetty-jmx/src/test/java/com/acme/jmx/DerivedMBean.java @@ -23,13 +23,13 @@ import org.eclipse.jetty.jmx.ObjectMBean; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ManagedObject("Derived MBean Wrapper") public class DerivedMBean extends ObjectMBean { - private static final Logger LOG = Log.getLogger(DerivedMBean.class); + private static final Logger LOG = LoggerFactory.getLogger(DerivedMBean.class); public DerivedMBean(Object managedObject) { diff --git a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/ContextFactory.java b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/ContextFactory.java index 498e1f5853a..96a9a1f2ba0 100644 --- a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/ContextFactory.java +++ b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/ContextFactory.java @@ -32,8 +32,8 @@ import javax.naming.spi.ObjectFactory; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ContextFactory @@ -58,7 +58,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class ContextFactory implements ObjectFactory { - private static final Logger LOG = Log.getLogger(ContextFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(ContextFactory.class); /** * Map of classloaders to contexts. diff --git a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/DataSourceCloser.java b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/DataSourceCloser.java index bdb37b92469..c76a7cb0cde 100644 --- a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/DataSourceCloser.java +++ b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/DataSourceCloser.java @@ -25,8 +25,8 @@ import javax.sql.DataSource; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.Destroyable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Close a DataSource. @@ -36,7 +36,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class DataSourceCloser implements Destroyable { - private static final Logger LOG = Log.getLogger(DataSourceCloser.class); + private static final Logger LOG = LoggerFactory.getLogger(DataSourceCloser.class); final DataSource _datasource; final String _shutdown; @@ -74,7 +74,7 @@ public class DataSourceCloser implements Destroyable } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to shutdown datasource {}", _datasource, e); } try @@ -85,7 +85,7 @@ public class DataSourceCloser implements Destroyable } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to close datasource {}", _datasource, e); } } } diff --git a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/InitialContextFactory.java b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/InitialContextFactory.java index 7f7ac6498c8..d25796e7187 100644 --- a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/InitialContextFactory.java +++ b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/InitialContextFactory.java @@ -27,8 +27,8 @@ import javax.naming.NameParser; import javax.naming.NamingException; import org.eclipse.jetty.jndi.local.localContextRoot; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * InitialContextFactory.java @@ -40,7 +40,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class InitialContextFactory implements javax.naming.spi.InitialContextFactory { - private static final Logger LOG = Log.getLogger(InitialContextFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(InitialContextFactory.class); public static class DefaultParser implements NameParser { diff --git a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/NamingContext.java b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/NamingContext.java index 87b9e71c762..43f803a28e0 100644 --- a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/NamingContext.java +++ b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/NamingContext.java @@ -46,8 +46,8 @@ import javax.naming.Referenceable; import javax.naming.spi.NamingManager; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * NamingContext @@ -60,7 +60,7 @@ import org.eclipse.jetty.util.log.Logger; @SuppressWarnings("unchecked") public class NamingContext implements Context, Dumpable { - private static final Logger LOG = Log.getLogger(NamingContext.class); + private static final Logger LOG = LoggerFactory.getLogger(NamingContext.class); private static final List __empty = Collections.emptyList(); public static final String DEEP_BINDING = "org.eclipse.jetty.jndi.deepBinding"; public static final String LOCK_PROPERTY = "org.eclipse.jetty.jndi.lock"; diff --git a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/NamingUtil.java b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/NamingUtil.java index 5c822ae6014..b24824a973d 100644 --- a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/NamingUtil.java +++ b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/NamingUtil.java @@ -28,15 +28,15 @@ import javax.naming.NameParser; import javax.naming.NamingEnumeration; import javax.naming.NamingException; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Naming Utility Methods */ public class NamingUtil { - private static final Logger LOG = Log.getLogger(NamingUtil.class); + private static final Logger LOG = LoggerFactory.getLogger(NamingUtil.class); /** * Bind an object to a context ensuring all sub-contexts diff --git a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/java/javaRootURLContext.java b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/java/javaRootURLContext.java index 786ae6874b0..a36353c8023 100644 --- a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/java/javaRootURLContext.java +++ b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/java/javaRootURLContext.java @@ -29,8 +29,8 @@ import javax.naming.StringRefAddr; import org.eclipse.jetty.jndi.ContextFactory; import org.eclipse.jetty.jndi.NamingContext; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // This is a required name for JNDI // @checkstyle-disable-check : TypeNameCheck @@ -44,7 +44,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class javaRootURLContext implements Context { - private static final Logger LOG = Log.getLogger(javaRootURLContext.class); + private static final Logger LOG = LoggerFactory.getLogger(javaRootURLContext.class); public static final String URL_PREFIX = "java:"; @@ -73,7 +73,7 @@ public class javaRootURLContext implements Context } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to bind default NamingContext to: comp", e); } } diff --git a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/java/javaURLContextFactory.java b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/java/javaURLContextFactory.java index 0b329d6cf3d..3df8d71013d 100644 --- a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/java/javaURLContextFactory.java +++ b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/java/javaURLContextFactory.java @@ -24,8 +24,8 @@ import javax.naming.Name; import javax.naming.NamingException; import javax.naming.spi.ObjectFactory; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // This is a required name for JNDI // @checkstyle-disable-check : TypeNameCheck @@ -37,7 +37,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class javaURLContextFactory implements ObjectFactory { - private static final Logger LOG = Log.getLogger(javaURLContextFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(javaURLContextFactory.class); /** * Either return a new context or the resolution of a url. diff --git a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/local/localContextRoot.java b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/local/localContextRoot.java index 364f3dafc67..56ca5bf9dbd 100644 --- a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/local/localContextRoot.java +++ b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/local/localContextRoot.java @@ -38,8 +38,8 @@ import javax.naming.Referenceable; import javax.naming.spi.NamingManager; import org.eclipse.jetty.jndi.NamingContext; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // This is a required name for JNDI // @checkstyle-disable-check : TypeNameCheck @@ -51,7 +51,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class localContextRoot implements Context { - private static final Logger LOG = Log.getLogger(localContextRoot.class); + private static final Logger LOG = LoggerFactory.getLogger(localContextRoot.class); protected static final NamingContext __root = new NamingRoot(); private final Hashtable _env; @@ -142,7 +142,7 @@ public class localContextRoot implements Context } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to dereference {}, {}", ctx, firstComponent, e); throw new NamingException(e.getMessage()); } } diff --git a/jetty-jndi/src/test/java/org/eclipse/jetty/jndi/java/TestJNDI.java b/jetty-jndi/src/test/java/org/eclipse/jetty/jndi/java/TestJNDI.java index 61371acb3cf..f173ce5a20e 100644 --- a/jetty-jndi/src/test/java/org/eclipse/jetty/jndi/java/TestJNDI.java +++ b/jetty-jndi/src/test/java/org/eclipse/jetty/jndi/java/TestJNDI.java @@ -41,10 +41,10 @@ import org.eclipse.jetty.jndi.NamingContext; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.HandlerList; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -58,7 +58,7 @@ import static org.junit.jupiter.api.Assertions.fail; */ public class TestJNDI { - private static final Logger LOG = Log.getLogger(TestJNDI.class); + private static final Logger LOG = LoggerFactory.getLogger(TestJNDI.class); static { diff --git a/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionDataStore.java b/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionDataStore.java index 537efca5958..b72d7fbca7f 100644 --- a/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionDataStore.java +++ b/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionDataStore.java @@ -43,8 +43,8 @@ import org.eclipse.jetty.util.ClassLoadingObjectInputStream; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * MongoSessionDataStore @@ -97,7 +97,7 @@ import org.eclipse.jetty.util.log.Logger; public class MongoSessionDataStore extends NoSqlSessionDataStore { - private static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(MongoSessionDataStore.class); /** * Special attribute for a session that is context-specific diff --git a/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/JwtDecoder.java b/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/JwtDecoder.java index 8d4ff89c836..2ce4ababc8c 100644 --- a/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/JwtDecoder.java +++ b/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/JwtDecoder.java @@ -24,15 +24,15 @@ import java.util.Base64; import java.util.Map; import org.eclipse.jetty.util.ajax.JSON; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Used to decode the ID Token from the base64 encrypted JSON Web Token (JWT). */ public class JwtDecoder { - private static final Logger LOG = Log.getLogger(JwtDecoder.class); + private static final Logger LOG = LoggerFactory.getLogger(JwtDecoder.class); /** * Decodes a JSON Web Token (JWT) into a Map of claims. diff --git a/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdAuthenticator.java b/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdAuthenticator.java index 1054f58f4db..94703d1d1e1 100644 --- a/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdAuthenticator.java +++ b/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdAuthenticator.java @@ -45,9 +45,9 @@ import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.util.MultiMap; import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.UrlEncoded; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Constraint; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Implements authentication using OpenId Connect on top of OAuth 2.0. @@ -64,7 +64,7 @@ import org.eclipse.jetty.util.security.Constraint; */ public class OpenIdAuthenticator extends LoginAuthenticator { - private static final Logger LOG = Log.getLogger(OpenIdAuthenticator.class); + private static final Logger LOG = LoggerFactory.getLogger(OpenIdAuthenticator.class); public static final String CLAIMS = "org.eclipse.jetty.security.openid.claims"; public static final String RESPONSE = "org.eclipse.jetty.security.openid.response"; diff --git a/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdConfiguration.java b/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdConfiguration.java index e7591f524c9..73f2269ac0a 100644 --- a/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdConfiguration.java +++ b/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdConfiguration.java @@ -30,9 +30,9 @@ import org.eclipse.jetty.client.http.HttpClientTransportOverHTTP; import org.eclipse.jetty.io.ClientConnector; import org.eclipse.jetty.util.ajax.JSON; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Holds the configuration for an OpenID Connect service. @@ -42,7 +42,7 @@ import org.eclipse.jetty.util.ssl.SslContextFactory; */ public class OpenIdConfiguration extends ContainerLifeCycle { - private static final Logger LOG = Log.getLogger(OpenIdConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(OpenIdConfiguration.class); private static final String CONFIG_PATH = "/.well-known/openid-configuration"; private final HttpClient httpClient; diff --git a/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdCredentials.java b/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdCredentials.java index 20ba2ec6119..07c6f6fc22d 100644 --- a/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdCredentials.java +++ b/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdCredentials.java @@ -29,8 +29,8 @@ import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.client.util.FormContentProvider; import org.eclipse.jetty.util.Fields; import org.eclipse.jetty.util.ajax.JSON; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

The credentials of an user to be authenticated with OpenID Connect. This will contain @@ -44,7 +44,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class OpenIdCredentials implements Serializable { - private static final Logger LOG = Log.getLogger(OpenIdCredentials.class); + private static final Logger LOG = LoggerFactory.getLogger(OpenIdCredentials.class); private static final long serialVersionUID = 4766053233370044796L; private final String redirectUri; diff --git a/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdLoginService.java b/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdLoginService.java index c7b6b4ac6c6..bfded720934 100644 --- a/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdLoginService.java +++ b/jetty-openid/src/main/java/org/eclipse/jetty/security/openid/OpenIdLoginService.java @@ -27,8 +27,8 @@ import org.eclipse.jetty.security.IdentityService; import org.eclipse.jetty.security.LoginService; import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The implementation of {@link LoginService} required to use OpenID Connect. @@ -39,7 +39,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class OpenIdLoginService extends ContainerLifeCycle implements LoginService { - private static final Logger LOG = Log.getLogger(OpenIdLoginService.class); + private static final Logger LOG = LoggerFactory.getLogger(OpenIdLoginService.class); private final OpenIdConfiguration configuration; private final LoginService loginService; @@ -94,7 +94,7 @@ public class OpenIdLoginService extends ContainerLifeCycle implements LoginServi } catch (Throwable e) { - LOG.warn(e); + LOG.warn("Unable to redeem auth code", e); return null; } diff --git a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/ContainerTldBundleDiscoverer.java b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/ContainerTldBundleDiscoverer.java index bc0ee230091..c5a50ee839b 100644 --- a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/ContainerTldBundleDiscoverer.java +++ b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/ContainerTldBundleDiscoverer.java @@ -33,10 +33,10 @@ import org.eclipse.jetty.osgi.boot.JettyBootstrapActivator; import org.eclipse.jetty.osgi.boot.OSGiMetaInfConfiguration; import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper; import org.eclipse.jetty.osgi.boot.utils.TldBundleDiscoverer; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.Bundle; import org.osgi.framework.FrameworkUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ContainerTldBundleDiscoverer @@ -66,7 +66,7 @@ import org.osgi.framework.FrameworkUtil; public class ContainerTldBundleDiscoverer implements TldBundleDiscoverer { - private static final Logger LOG = Log.getLogger(ContainerTldBundleDiscoverer.class); + private static final Logger LOG = LoggerFactory.getLogger(ContainerTldBundleDiscoverer.class); private static String DEFAULT_JSP_FACTORY_IMPL_CLASS = "org.apache.jasper.runtime.JspFactoryImpl"; /** diff --git a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/JSTLBundleDiscoverer.java b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/JSTLBundleDiscoverer.java index accad4162c9..c85aaa42d6a 100644 --- a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/JSTLBundleDiscoverer.java +++ b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/JSTLBundleDiscoverer.java @@ -29,10 +29,10 @@ import org.eclipse.jetty.deploy.DeploymentManager; import org.eclipse.jetty.osgi.boot.JettyBootstrapActivator; import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper; import org.eclipse.jetty.osgi.boot.utils.TldBundleDiscoverer; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.Bundle; import org.osgi.framework.FrameworkUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * JSTLBundleDiscoverer @@ -47,7 +47,7 @@ import org.osgi.framework.FrameworkUtil; */ public class JSTLBundleDiscoverer implements TldBundleDiscoverer { - private static final Logger LOG = Log.getLogger(JSTLBundleDiscoverer.class); + private static final Logger LOG = LoggerFactory.getLogger(JSTLBundleDiscoverer.class); /** * Default name of a class that belongs to the jstl bundle. From that class diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java index a3148e9b7cd..8db88e052e8 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java @@ -28,13 +28,13 @@ import org.eclipse.jetty.annotations.AnnotationParser.Handler; import org.eclipse.jetty.osgi.boot.OSGiMetaInfConfiguration; import org.eclipse.jetty.osgi.boot.OSGiWebappConstants; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.statistic.CounterStatistic; import org.eclipse.jetty.webapp.WebAppContext; import org.osgi.framework.Bundle; import org.osgi.framework.Constants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Extend the AnnotationConfiguration to support OSGi: @@ -43,7 +43,7 @@ import org.osgi.framework.Constants; */ public class AnnotationConfiguration extends org.eclipse.jetty.annotations.AnnotationConfiguration { - private static final Logger LOG = Log.getLogger(org.eclipse.jetty.annotations.AnnotationConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(org.eclipse.jetty.annotations.AnnotationConfiguration.class); public class BundleParserTask extends ParserTask { diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractContextProvider.java index 9372f9b58fc..4c7d6b3e8b8 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractContextProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractContextProvider.java @@ -30,12 +30,12 @@ import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelperFactory; import org.eclipse.jetty.osgi.boot.utils.OSGiClassLoader; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.JarResource; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.xml.XmlConfiguration; import org.osgi.framework.Bundle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AbstractContextProvider @@ -45,7 +45,7 @@ import org.osgi.framework.Bundle; */ public abstract class AbstractContextProvider extends AbstractLifeCycle implements AppProvider { - private static final Logger LOG = Log.getLogger(AbstractContextProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractContextProvider.class); private DeploymentManager _deploymentManager; diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractOSGiApp.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractOSGiApp.java index 10fa4e81c67..ee52bf382a2 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractOSGiApp.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractOSGiApp.java @@ -27,12 +27,12 @@ import org.eclipse.jetty.deploy.App; import org.eclipse.jetty.deploy.AppProvider; import org.eclipse.jetty.deploy.DeploymentManager; import org.eclipse.jetty.server.handler.ContextHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.osgi.framework.Bundle; import org.osgi.framework.FrameworkUtil; import org.osgi.framework.ServiceRegistration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AbstractOSGiApp @@ -41,7 +41,7 @@ import org.osgi.framework.ServiceRegistration; */ public abstract class AbstractOSGiApp extends App { - private static final Logger LOG = Log.getLogger(AbstractOSGiApp.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractOSGiApp.class); protected Bundle _bundle; protected Dictionary _properties; @@ -175,7 +175,7 @@ public abstract class AbstractOSGiApp extends App } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to find relative override location: {}", bundleOverrideLocation, e); } } if (res != null) diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java index 6f1b71fdbdd..cd34e0d677e 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java @@ -33,8 +33,6 @@ import org.eclipse.jetty.osgi.boot.internal.webapp.OSGiWebappClassLoader; import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelperFactory; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.JarResource; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.WebAppClassLoader; @@ -44,6 +42,8 @@ import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; import org.osgi.service.packageadmin.PackageAdmin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AbstractWebAppProvider @@ -53,7 +53,7 @@ import org.osgi.service.packageadmin.PackageAdmin; */ public abstract class AbstractWebAppProvider extends AbstractLifeCycle implements AppProvider { - private static final Logger LOG = Log.getLogger(AbstractWebAppProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractWebAppProvider.class); private boolean _parentLoaderPriority; diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java index 8e5a0ff6268..a7a0e60d622 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java @@ -28,14 +28,14 @@ import java.util.Map; import org.eclipse.jetty.deploy.App; import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleEvent; import org.osgi.framework.FrameworkUtil; import org.osgi.framework.ServiceRegistration; import org.osgi.util.tracker.BundleTracker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * BundleContextProvider @@ -44,7 +44,7 @@ import org.osgi.util.tracker.BundleTracker; */ public class BundleContextProvider extends AbstractContextProvider implements BundleProvider { - private static final Logger LOG = Log.getLogger(AbstractContextProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractContextProvider.class); private Map _appMap = new HashMap(); @@ -79,7 +79,7 @@ public class BundleContextProvider extends AbstractContextProvider implements Bu } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to add bundle {}", bundle, e); } return null; } @@ -93,7 +93,7 @@ public class BundleContextProvider extends AbstractContextProvider implements Bu } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to remove bundle {}", bundle, e); } } } @@ -131,7 +131,7 @@ public class BundleContextProvider extends AbstractContextProvider implements Bu } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to unregister {}", _serviceRegForBundles, e); } } } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java index 466b9f9c6a2..ba6d78fd28e 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java @@ -27,14 +27,14 @@ import org.eclipse.jetty.deploy.App; import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper; import org.eclipse.jetty.osgi.boot.utils.Util; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleEvent; import org.osgi.framework.FrameworkUtil; import org.osgi.framework.ServiceRegistration; import org.osgi.util.tracker.BundleTracker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * BundleWebAppProvider @@ -43,7 +43,7 @@ import org.osgi.util.tracker.BundleTracker; */ public class BundleWebAppProvider extends AbstractWebAppProvider implements BundleProvider { - private static final Logger LOG = Log.getLogger(AbstractWebAppProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractWebAppProvider.class); /** * Map of Bundle to App. Used when a Bundle contains a webapp. @@ -79,7 +79,7 @@ public class BundleWebAppProvider extends AbstractWebAppProvider implements Bund } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to add bundle {}", bundle, e); } return null; } @@ -93,7 +93,7 @@ public class BundleWebAppProvider extends AbstractWebAppProvider implements Bund } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to remove bundle {}", bundle, e); } } } @@ -129,7 +129,7 @@ public class BundleWebAppProvider extends AbstractWebAppProvider implements Bund } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to unregister {}", _serviceRegForBundles, e); } } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java index 9b40fabaf79..cb994215815 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java @@ -22,13 +22,13 @@ import org.eclipse.jetty.osgi.boot.internal.serverfactory.DefaultJettyAtJettyHom import org.eclipse.jetty.osgi.boot.internal.serverfactory.JettyServerServiceTracker; import org.eclipse.jetty.osgi.boot.utils.internal.PackageAdminServiceTracker; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceRegistration; import org.osgi.util.tracker.ServiceTracker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * JettyBootstrapActivator @@ -41,7 +41,7 @@ import org.osgi.util.tracker.ServiceTracker; */ public class JettyBootstrapActivator implements BundleActivator { - private static final Logger LOG = Log.getLogger(JettyBootstrapActivator.class); + private static final Logger LOG = LoggerFactory.getLogger(JettyBootstrapActivator.class); private static JettyBootstrapActivator INSTANCE = null; diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiMetaInfConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiMetaInfConfiguration.java index b3a7e198fdb..6386b3a3a87 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiMetaInfConfiguration.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiMetaInfConfiguration.java @@ -35,8 +35,6 @@ import java.util.regex.Pattern; import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelperFactory; import org.eclipse.jetty.osgi.boot.utils.Util; import org.eclipse.jetty.osgi.boot.utils.internal.PackageAdminServiceTracker; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.ResourceCollection; import org.eclipse.jetty.webapp.Configuration; @@ -45,6 +43,8 @@ import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.webapp.WebInfConfiguration; import org.osgi.framework.Bundle; import org.osgi.framework.FrameworkUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * OSGiWebInfConfiguration @@ -53,7 +53,7 @@ import org.osgi.framework.FrameworkUtil; */ public class OSGiMetaInfConfiguration extends MetaInfConfiguration { - private static final Logger LOG = Log.getLogger(WebInfConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(WebInfConfiguration.class); /** * Comma separated list of symbolic names of bundles that contain tlds that should be considered diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java index 45b2fe64542..a3787f7c7e3 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java @@ -29,8 +29,6 @@ import org.eclipse.jetty.deploy.DeploymentManager; import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper; import org.eclipse.jetty.osgi.boot.utils.Util; import org.eclipse.jetty.server.handler.ContextHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.Constants; @@ -39,6 +37,8 @@ import org.osgi.framework.FrameworkUtil; import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceRegistration; import org.osgi.util.tracker.ServiceTracker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ServiceContextProvider @@ -47,7 +47,7 @@ import org.osgi.util.tracker.ServiceTracker; */ public class ServiceContextProvider extends AbstractContextProvider implements ServiceProvider { - private static final Logger LOG = Log.getLogger(AbstractContextProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractContextProvider.class); private Map _serviceMap = new HashMap<>(); @@ -221,7 +221,7 @@ public class ServiceContextProvider extends AbstractContextProvider implements S } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to unregister {}", _serviceRegForServices, e); } } super.doStop(); diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java index 3437facef48..7f0ce92d89e 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java @@ -29,8 +29,6 @@ import org.eclipse.jetty.deploy.DeploymentManager; import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper; import org.eclipse.jetty.osgi.boot.utils.Util; import org.eclipse.jetty.server.handler.ContextHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.WebAppContext; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; @@ -39,6 +37,8 @@ import org.osgi.framework.FrameworkUtil; import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceRegistration; import org.osgi.util.tracker.ServiceTracker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ServiceWebAppProvider @@ -47,7 +47,7 @@ import org.osgi.util.tracker.ServiceTracker; */ public class ServiceWebAppProvider extends AbstractWebAppProvider implements ServiceProvider { - private static final Logger LOG = Log.getLogger(AbstractWebAppProvider.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractWebAppProvider.class); /** * Map of ServiceRef to App. Used when it is an osgi service that is a WebAppContext. @@ -253,7 +253,7 @@ public class ServiceWebAppProvider extends AbstractWebAppProvider implements Ser } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to unregister {}", _serviceRegForServices, e); } } super.doStop(); diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java index b89b887b2d8..59bcd04a251 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java @@ -35,12 +35,12 @@ import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelperFactory; import org.eclipse.jetty.osgi.boot.utils.OSGiClassLoader; import org.eclipse.jetty.osgi.boot.utils.Util; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.JarResource; import org.eclipse.jetty.util.resource.Resource; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * DefaultJettyAtJettyHomeHelper @@ -54,7 +54,7 @@ import org.osgi.framework.BundleContext; */ public class DefaultJettyAtJettyHomeHelper { - private static final Logger LOG = Log.getLogger(DefaultJettyAtJettyHomeHelper.class); + private static final Logger LOG = LoggerFactory.getLogger(DefaultJettyAtJettyHomeHelper.class); /** * contains a comma separated list of paths to the etc/jetty-*.xml files @@ -214,7 +214,7 @@ public class DefaultJettyAtJettyHomeHelper } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed to start Jetty at Jetty Home", e); throw e; } finally diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/JettyServerServiceTracker.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/JettyServerServiceTracker.java index de5a0438596..3e082f89ead 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/JettyServerServiceTracker.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/JettyServerServiceTracker.java @@ -23,11 +23,11 @@ import java.util.Hashtable; import org.eclipse.jetty.osgi.boot.OSGiServerConstants; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.Bundle; import org.osgi.framework.ServiceReference; import org.osgi.util.tracker.ServiceTrackerCustomizer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * JettyServerServiceTracker @@ -37,7 +37,7 @@ import org.osgi.util.tracker.ServiceTrackerCustomizer; */ public class JettyServerServiceTracker implements ServiceTrackerCustomizer { - private static Logger LOG = Log.getLogger(JettyServerServiceTracker.class.getName()); + private static Logger LOG = LoggerFactory.getLogger(JettyServerServiceTracker.class.getName()); @Override public Object addingService(ServiceReference sr) @@ -65,7 +65,7 @@ public class JettyServerServiceTracker implements ServiceTrackerCustomizer } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed to start server {}", name, e); return sr.getBundle().getBundleContext().getService(sr); } } @@ -82,15 +82,15 @@ public class JettyServerServiceTracker implements ServiceTrackerCustomizer { if (service instanceof ServerInstanceWrapper) { + ServerInstanceWrapper wrapper = (ServerInstanceWrapper)service; try { - ServerInstanceWrapper wrapper = (ServerInstanceWrapper)service; wrapper.stop(); LOG.info("Stopped Server {}", wrapper.getManagedServerName()); } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed to stop server {}", wrapper.getManagedServerName(), e); } } } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java index f7b82911f16..e8b2bcb3db2 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java @@ -51,10 +51,10 @@ import org.eclipse.jetty.osgi.boot.utils.Util; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ContextHandlerCollection; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.xml.XmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ServerInstanceWrapper @@ -73,7 +73,7 @@ public class ServerInstanceWrapper private static Collection __containerTldBundleDiscoverers = new ArrayList<>(); - private static Logger LOG = Log.getLogger(ServerInstanceWrapper.class.getName()); + private static final Logger LOG = LoggerFactory.getLogger(ServerInstanceWrapper.class.getName()); private final String _managedServerName; @@ -278,7 +278,7 @@ public class ServerInstanceWrapper } catch (Exception x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } } throw e; @@ -300,7 +300,7 @@ public class ServerInstanceWrapper } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed to stop server", e); } } @@ -356,7 +356,7 @@ public class ServerInstanceWrapper } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed to add BundleAppProvider to DeploymentManager", e); } } @@ -370,7 +370,7 @@ public class ServerInstanceWrapper } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed to add ServiceWebAppProvider to DeploymentManager", e); } } @@ -383,7 +383,7 @@ public class ServerInstanceWrapper } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed to add BundleContextProvider to DeploymentManager", e); } } @@ -396,7 +396,7 @@ public class ServerInstanceWrapper } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed to add ServiceContextProvider to DeploymentManager", e); } } } @@ -438,7 +438,7 @@ public class ServerInstanceWrapper } catch (Throwable mfe) { - LOG.warn(mfe); + LOG.warn("Unable to process legacy lib folder {}", tok, mfe); } } return libURLs; diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/OSGiWebappClassLoader.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/OSGiWebappClassLoader.java index e75a236ca35..6d68c9a4de6 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/OSGiWebappClassLoader.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/OSGiWebappClassLoader.java @@ -34,13 +34,13 @@ import javax.servlet.http.HttpServlet; import org.eclipse.jetty.osgi.boot.utils.BundleClassLoaderHelperFactory; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.WebAppClassLoader; import org.eclipse.jetty.webapp.WebAppContext; import org.osgi.framework.Bundle; import org.osgi.framework.BundleReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * OSGiWebappClassLoader @@ -51,7 +51,7 @@ import org.osgi.framework.BundleReference; public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleReference { - private static final Logger __logger = Log.getLogger(OSGiWebappClassLoader.class.getName()); + private static final Logger LOG = LoggerFactory.getLogger(OSGiWebappClassLoader.class.getName()); /** * when a logging framework is setup in the osgi classloaders, it can access @@ -214,7 +214,7 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe } else { - __logger.info("Did not add " + path + " to the classloader of the webapp " + getContext()); + LOG.info("Did not add " + path + " to the classloader of the webapp " + getContext()); } } } @@ -266,7 +266,7 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe catch (IOException e) { // nevermind. just trying our best - __logger.ignore(e); + LOG.trace("IGNORED", e); } return true; } @@ -300,7 +300,7 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe catch (Throwable t) { // humf that will hurt if it does not work. - __logger.warn("Unable to set webappcontext", t); + LOG.warn("Unable to set webappcontext", t); } } } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleClassLoaderHelperFactory.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleClassLoaderHelperFactory.java index e0c14d0d945..8a9e2c41da9 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleClassLoaderHelperFactory.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleClassLoaderHelperFactory.java @@ -18,8 +18,8 @@ package org.eclipse.jetty.osgi.boot.utils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * BundleClassLoaderHelperFactory @@ -28,7 +28,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class BundleClassLoaderHelperFactory { - private static final Logger LOG = Log.getLogger(BundleClassLoaderHelperFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(BundleClassLoaderHelperFactory.class); private static BundleClassLoaderHelperFactory _instance = new BundleClassLoaderHelperFactory(); @@ -53,7 +53,7 @@ public class BundleClassLoaderHelperFactory } catch (Throwable t) { - LOG.ignore(t); + LOG.trace("IGNORED", t); } return helper; diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleFileLocatorHelperFactory.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleFileLocatorHelperFactory.java index 9d3330cf5e1..479a200a78a 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleFileLocatorHelperFactory.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleFileLocatorHelperFactory.java @@ -18,8 +18,8 @@ package org.eclipse.jetty.osgi.boot.utils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * BundleFileLocatorHelperFactory @@ -28,7 +28,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class BundleFileLocatorHelperFactory { - private static final Logger LOG = Log.getLogger(BundleFileLocatorHelperFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(BundleFileLocatorHelperFactory.class); private static BundleFileLocatorHelperFactory _instance = new BundleFileLocatorHelperFactory(); @@ -52,7 +52,7 @@ public class BundleFileLocatorHelperFactory } catch (Throwable t) { - LOG.ignore(t); + LOG.trace("IGNORED", t); } return helper; } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/OSGiClassLoader.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/OSGiClassLoader.java index bb90555a943..256e4e5aa4f 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/OSGiClassLoader.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/OSGiClassLoader.java @@ -26,9 +26,9 @@ import java.util.Collections; import java.util.Enumeration; import java.util.List; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.Bundle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * OSGiClassLoader @@ -38,7 +38,7 @@ import org.osgi.framework.Bundle; */ public class OSGiClassLoader extends URLClassLoader { - private static final Logger LOG = Log.getLogger(OSGiClassLoader.class); + private static final Logger LOG = LoggerFactory.getLogger(OSGiClassLoader.class); private Bundle _bundle; private ClassLoader _osgiBundleClassLoader; diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultBundleClassLoaderHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultBundleClassLoaderHelper.java index 1547adf02ab..ced85389b5e 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultBundleClassLoaderHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultBundleClassLoaderHelper.java @@ -23,9 +23,9 @@ import java.lang.reflect.Method; import java.util.List; import org.eclipse.jetty.osgi.boot.utils.BundleClassLoaderHelper; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.Bundle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * DefaultBundleClassLoaderHelper @@ -35,7 +35,7 @@ import org.osgi.framework.Bundle; */ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper { - private static final Logger LOG = Log.getLogger(BundleClassLoaderHelper.class); + private static final Logger LOG = LoggerFactory.getLogger(BundleClassLoaderHelper.class); private static enum OSGiContainerType { @@ -80,7 +80,7 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper } catch (ClassNotFoundException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } try @@ -91,7 +91,7 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper } catch (ClassNotFoundException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } try @@ -112,7 +112,7 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper } catch (ClassNotFoundException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } try @@ -123,7 +123,7 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper } catch (ClassNotFoundException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } LOG.warn("Unknown OSGi container type"); @@ -153,7 +153,7 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper } catch (ClassNotFoundException e) { - LOG.warn(e); + LOG.warn("Unable to load bundle activator {}", bundleActivator, e); } } @@ -207,6 +207,7 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper { if (osgiContainer == OSGiContainerType.EquinoxOld) { + String bundleLoaderName = "org.eclipse.osgi.internal.loader.BundleLoader"; try { if (Equinox_BundleHost_getBundleLoader_method == null) @@ -219,19 +220,14 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper if (Equinox_BundleLoader_createClassLoader_method == null && bundleLoader != null) { Equinox_BundleLoader_createClassLoader_method = - bundleLoader.getClass().getClassLoader().loadClass("org.eclipse.osgi.internal.loader.BundleLoader").getDeclaredMethod("createClassLoader", new Class[]{}); + bundleLoader.getClass().getClassLoader().loadClass(bundleLoaderName).getDeclaredMethod("createClassLoader", new Class[]{}); Equinox_BundleLoader_createClassLoader_method.setAccessible(true); } return (ClassLoader)Equinox_BundleLoader_createClassLoader_method.invoke(bundleLoader, new Object[]{}); } - catch (ClassNotFoundException t) - { - LOG.warn(t); - return null; - } catch (Throwable t) { - LOG.warn(t); + LOG.warn("Unable to get equinox bundle classloader", t); return null; } } @@ -252,7 +248,7 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to get equinox luna bundle classloader", e); return null; } } @@ -288,7 +284,7 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to get felix bundle classloader", e); return null; } } @@ -320,21 +316,23 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to get field {}", Felix_BundleImpl_m_Modules_Field, e); return null; } } if (Felix_ModuleImpl_m_ClassLoader_Field == null && currentModuleImpl != null) { + String felixFrameworkModuleImplClassName = "org.apache.felix.framework.ModuleImpl"; + String felixFrameworkModuleImplClassLoaderField = "m_classLoader"; try { - Felix_ModuleImpl_m_ClassLoader_Field = bundle.getClass().getClassLoader().loadClass("org.apache.felix.framework.ModuleImpl").getDeclaredField("m_classLoader"); + Felix_ModuleImpl_m_ClassLoader_Field = bundle.getClass().getClassLoader().loadClass(felixFrameworkModuleImplClassName).getDeclaredField(felixFrameworkModuleImplClassLoaderField); Felix_ModuleImpl_m_ClassLoader_Field.setAccessible(true); } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to find field {}.{}", felixFrameworkModuleImplClassName, felixFrameworkModuleImplClassLoaderField, e); return null; } } @@ -351,7 +349,7 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to get field {}", Felix_ModuleImpl_m_ClassLoader_Field, e); return null; } @@ -367,13 +365,13 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to get field {}", Felix_ModuleImpl_m_ClassLoader_Field, e); return null; } } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to load old felix container", e); return null; } } @@ -424,7 +422,7 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to load Concierge platform", e); return null; } } diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml index c83cbf2cc75..0c13244b308 100644 --- a/jetty-osgi/test-jetty-osgi/pom.xml +++ b/jetty-osgi/test-jetty-osgi/pom.xml @@ -409,6 +409,12 @@ jetty-test-helper test + + org.slf4j + slf4j-api + ${slf4j.version} + test + org.slf4j slf4j-log4j12 diff --git a/jetty-osgi/test-jetty-osgi/src/main/resources/jetty-logging.properties b/jetty-osgi/test-jetty-osgi/src/main/resources/jetty-logging.properties index 147cf004df8..c2be11c689a 100644 --- a/jetty-osgi/test-jetty-osgi/src/main/resources/jetty-logging.properties +++ b/jetty-osgi/test-jetty-osgi/src/main/resources/jetty-logging.properties @@ -1 +1 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog +org.eclipse.jetty.LEVEL=INFO \ No newline at end of file diff --git a/jetty-osgi/test-jetty-osgi/src/test/resources/log4j.properties b/jetty-osgi/test-jetty-osgi/src/test/resources/log4j.properties deleted file mode 100644 index 8bcbd0700c6..00000000000 --- a/jetty-osgi/test-jetty-osgi/src/test/resources/log4j.properties +++ /dev/null @@ -1,16 +0,0 @@ -# LOG4J levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL -# -log4j.rootLogger=ALL,CONSOLE - -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -#log4j.appender.CONSOLE.threshold=INFO -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -#log4j.appender.CONSOLE.layout.ConversionPattern=%d %t [%5p][%c{1}] %m%n -log4j.appender.CONSOLE.layout.ConversionPattern=%d [%5p][%c] %m%n - -# Level tuning -# log4j.logger.org.eclipse.jetty=DEBUG -# log4j.logger.org.eclipse.jetty.security=DEBUG -log4j.logger.shaded.org.eclipse.aether=WARN -log4j.logger.shaded.org.apache.http=WARN -log4j.logger.org.ops4j=WARN diff --git a/jetty-osgi/test-jetty-osgi/src/test/resources/log4j.xml b/jetty-osgi/test-jetty-osgi/src/test/resources/log4j.xml new file mode 100644 index 00000000000..fd9c89961b1 --- /dev/null +++ b/jetty-osgi/test-jetty-osgi/src/test/resources/log4j.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/ContainerInitializer.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/ContainerInitializer.java index 7392d0b77f3..b4ff90919a7 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/ContainerInitializer.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/ContainerInitializer.java @@ -32,13 +32,13 @@ import javax.servlet.ServletContainerInitializer; import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ContainerInitializer { - private static final Logger LOG = Log.getLogger(ContainerInitializer.class); + private static final Logger LOG = LoggerFactory.getLogger(ContainerInitializer.class); protected final ServletContainerInitializer _target; protected final Class[] _interestedTypes; diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/Injection.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/Injection.java index a8d4061fa52..ff71908e735 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/Injection.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/Injection.java @@ -27,8 +27,8 @@ import javax.naming.InitialContext; import javax.naming.NamingException; import org.eclipse.jetty.util.IntrospectionUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Injection @@ -39,7 +39,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class Injection { - private static final Logger LOG = Log.getLogger(Injection.class); + private static final Logger LOG = LoggerFactory.getLogger(Injection.class); private final Class _targetClass; private final String _jndiName; @@ -205,7 +205,7 @@ public class Injection } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to inject field {} with {}", field, injectable, e); throw new IllegalStateException("Inject failed for field " + field.getName()); } } @@ -227,7 +227,7 @@ public class Injection } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to inject method {} with {}", method, injectable, e); throw new IllegalStateException("Inject failed for method " + method.getName()); } } diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/InjectionCollection.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/InjectionCollection.java index 757ddb19961..7d7133b3f7d 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/InjectionCollection.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/InjectionCollection.java @@ -26,8 +26,8 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.CopyOnWriteArraySet; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * InjectionCollection @@ -39,7 +39,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class InjectionCollection { - private static final Logger LOG = Log.getLogger(InjectionCollection.class); + private static final Logger LOG = LoggerFactory.getLogger(InjectionCollection.class); public static final String INJECTION_COLLECTION = "org.eclipse.jetty.injectionCollection"; diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/LifeCycleCallbackCollection.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/LifeCycleCallbackCollection.java index a75d1d1efed..a5de0b0467d 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/LifeCycleCallbackCollection.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/LifeCycleCallbackCollection.java @@ -27,8 +27,8 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.CopyOnWriteArraySet; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * LifeCycleCallbackCollection @@ -43,7 +43,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class LifeCycleCallbackCollection { - private static final Logger LOG = Log.getLogger(LifeCycleCallbackCollection.class); + private static final Logger LOG = LoggerFactory.getLogger(LifeCycleCallbackCollection.class); public static final String LIFECYCLE_CALLBACK_COLLECTION = "org.eclipse.jetty.lifecyleCallbackCollection"; diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/PreDestroyCallback.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/PreDestroyCallback.java index 15c8b531c47..3e0132bfa48 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/PreDestroyCallback.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/PreDestroyCallback.java @@ -21,15 +21,15 @@ package org.eclipse.jetty.plus.annotation; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * PreDestroyCallback */ public class PreDestroyCallback extends LifeCycleCallback { - private static final Logger LOG = Log.getLogger(PreDestroyCallback.class); + private static final Logger LOG = LoggerFactory.getLogger(PreDestroyCallback.class); /** * @param clazz the class object to be injected diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/RunAsCollection.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/RunAsCollection.java index a563c2dd350..45305b17ec2 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/RunAsCollection.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/RunAsCollection.java @@ -22,15 +22,15 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * RunAsCollection */ public class RunAsCollection { - private static final Logger LOG = Log.getLogger(RunAsCollection.class); + private static final Logger LOG = LoggerFactory.getLogger(RunAsCollection.class); public static final String RUNAS_COLLECTION = "org.eclipse.jetty.runAsCollection"; private ConcurrentMap _runAsMap = new ConcurrentHashMap();//map of classname to run-as diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/jndi/NamingEntry.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/jndi/NamingEntry.java index 7d63349b364..95e1961bd3f 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/jndi/NamingEntry.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/jndi/NamingEntry.java @@ -26,8 +26,8 @@ import javax.naming.NameParser; import javax.naming.NamingException; import org.eclipse.jetty.jndi.NamingUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * NamingEntry @@ -42,7 +42,7 @@ import org.eclipse.jetty.util.log.Logger; */ public abstract class NamingEntry { - private static final Logger LOG = Log.getLogger(NamingEntry.class); + private static final Logger LOG = LoggerFactory.getLogger(NamingEntry.class); public static final String __contextName = "__"; //all NamingEntries stored in context called "__" protected final Object _scope; protected final String _jndiName; //the name representing the object associated with the NamingEntry @@ -115,7 +115,7 @@ public abstract class NamingEntry } catch (NamingException e) { - LOG.warn(e); + LOG.warn("Unable to unbind ENC", e); } } @@ -134,7 +134,7 @@ public abstract class NamingEntry } catch (NamingException e) { - LOG.warn(e); + LOG.warn("Unable to release: {} and {}", _objectNameString, _namingEntryNameString, e); } } diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/jndi/NamingEntryUtil.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/jndi/NamingEntryUtil.java index 70d5b3f6b4c..89dabeed499 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/jndi/NamingEntryUtil.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/jndi/NamingEntryUtil.java @@ -31,12 +31,12 @@ import javax.naming.NamingEnumeration; import javax.naming.NamingException; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class NamingEntryUtil { - private static final Logger LOG = Log.getLogger(NamingEntryUtil.class); + private static final Logger LOG = LoggerFactory.getLogger(NamingEntryUtil.class); /** * Link a name in a webapp's java:/comp/evn namespace to a pre-existing @@ -196,7 +196,7 @@ public class NamingEntryUtil } catch (NamingException e) { - LOG.warn(e); + LOG.warn("Unable to get name for scope {}", scope, e); return null; } } diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/jndi/Transaction.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/jndi/Transaction.java index f57ec23ad37..384d69455fd 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/jndi/Transaction.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/jndi/Transaction.java @@ -26,8 +26,8 @@ import javax.naming.NamingException; import javax.transaction.UserTransaction; import org.eclipse.jetty.jndi.NamingUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Transaction @@ -36,7 +36,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class Transaction extends NamingEntry { - private static final Logger LOG = Log.getLogger(Transaction.class); + private static final Logger LOG = LoggerFactory.getLogger(Transaction.class); public static final String USER_TRANSACTION = "UserTransaction"; public static void bindToENC() @@ -109,7 +109,7 @@ public class Transaction extends NamingEntry } catch (NamingException e) { - LOG.warn(e); + LOG.warn("Unable to unbind java:comp/{}", getJndiName(), e); } } } diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/security/DataSourceLoginService.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/security/DataSourceLoginService.java index 524c065c210..6d486fc45f1 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/security/DataSourceLoginService.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/security/DataSourceLoginService.java @@ -36,9 +36,9 @@ import org.eclipse.jetty.plus.jndi.NamingEntryUtil; import org.eclipse.jetty.security.AbstractLoginService; import org.eclipse.jetty.security.IdentityService; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Credential; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * DataSourceUserRealm @@ -48,7 +48,7 @@ import org.eclipse.jetty.util.security.Credential; */ public class DataSourceLoginService extends AbstractLoginService { - private static final Logger LOG = Log.getLogger(DataSourceLoginService.class); + private static final Logger LOG = LoggerFactory.getLogger(DataSourceLoginService.class); private String _jndiName = "javax.sql.DataSource/default"; private DataSource _datasource; diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/EnvConfiguration.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/EnvConfiguration.java index ef5749faccf..20f22c47d90 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/EnvConfiguration.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/EnvConfiguration.java @@ -36,8 +36,6 @@ import org.eclipse.jetty.jndi.local.localContextRoot; import org.eclipse.jetty.plus.jndi.EnvEntry; import org.eclipse.jetty.plus.jndi.NamingDump; import org.eclipse.jetty.plus.jndi.NamingEntryUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.AbstractConfiguration; import org.eclipse.jetty.webapp.FragmentConfiguration; @@ -47,13 +45,15 @@ import org.eclipse.jetty.webapp.WebAppClassLoader; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.webapp.WebXmlConfiguration; import org.eclipse.jetty.xml.XmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * EnvConfiguration */ public class EnvConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(EnvConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(EnvConfiguration.class); private static final String JETTY_ENV_BINDINGS = "org.eclipse.jetty.jndi.EnvConfiguration"; private Resource jettyEnvXmlResource; @@ -189,7 +189,7 @@ public class EnvConfiguration extends AbstractConfiguration } catch (NameNotFoundException e) { - LOG.warn(e); + LOG.warn("Unable to destroy InitialContext", e); } finally { @@ -214,7 +214,7 @@ public class EnvConfiguration extends AbstractConfiguration } catch (NameNotFoundException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); LOG.debug("No jndi entries scoped to webapp {}", context); } catch (NamingException e) diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/PlusConfiguration.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/PlusConfiguration.java index ce0fe7a2965..93efd634941 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/PlusConfiguration.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/PlusConfiguration.java @@ -27,21 +27,21 @@ import org.eclipse.jetty.jndi.NamingContext; import org.eclipse.jetty.plus.annotation.InjectionCollection; import org.eclipse.jetty.plus.annotation.LifeCycleCallbackCollection; import org.eclipse.jetty.plus.jndi.Transaction; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.AbstractConfiguration; import org.eclipse.jetty.webapp.FragmentConfiguration; import org.eclipse.jetty.webapp.JettyWebXmlConfiguration; import org.eclipse.jetty.webapp.MetaInfConfiguration; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.webapp.WebXmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Configuration */ public class PlusConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(PlusConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(PlusConfiguration.class); private Integer _key; diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/PlusDecorator.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/PlusDecorator.java index 589ec0ef72d..6c5d6a74bf7 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/PlusDecorator.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/PlusDecorator.java @@ -22,16 +22,16 @@ import org.eclipse.jetty.plus.annotation.InjectionCollection; import org.eclipse.jetty.plus.annotation.LifeCycleCallbackCollection; import org.eclipse.jetty.plus.annotation.RunAsCollection; import org.eclipse.jetty.util.Decorator; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.WebAppContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * PlusDecorator */ public class PlusDecorator implements Decorator { - private static final Logger LOG = Log.getLogger(PlusDecorator.class); + private static final Logger LOG = LoggerFactory.getLogger(PlusDecorator.class); protected WebAppContext _context; diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/PlusDescriptorProcessor.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/PlusDescriptorProcessor.java index 3f1a7cae13f..faa5e4fe6de 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/PlusDescriptorProcessor.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/PlusDescriptorProcessor.java @@ -36,21 +36,21 @@ import org.eclipse.jetty.plus.jndi.Link; import org.eclipse.jetty.plus.jndi.NamingEntry; import org.eclipse.jetty.plus.jndi.NamingEntryUtil; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.Descriptor; import org.eclipse.jetty.webapp.FragmentDescriptor; import org.eclipse.jetty.webapp.IterativeDescriptorProcessor; import org.eclipse.jetty.webapp.Origin; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.xml.XmlParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * PlusDescriptorProcessor */ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor { - private static final Logger LOG = Log.getLogger(PlusDescriptorProcessor.class); + private static final Logger LOG = LoggerFactory.getLogger(PlusDescriptorProcessor.class); public PlusDescriptorProcessor() { diff --git a/jetty-proxy/pom.xml b/jetty-proxy/pom.xml index 0066877b80f..49da3737eb8 100644 --- a/jetty-proxy/pom.xml +++ b/jetty-proxy/pom.xml @@ -57,6 +57,10 @@ jetty-alpn-client ${project.version} + + org.slf4j + slf4j-api + org.eclipse.jetty @@ -70,6 +74,12 @@ ${project.version} test + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AfterContentTransformer.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AfterContentTransformer.java index 7950d08f201..9169004064a 100644 --- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AfterContentTransformer.java +++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AfterContentTransformer.java @@ -35,8 +35,8 @@ import java.util.List; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.component.Destroyable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A specialized transformer for {@link AsyncMiddleManServlet} that performs @@ -58,7 +58,7 @@ import org.eclipse.jetty.util.log.Logger; */ public abstract class AfterContentTransformer implements AsyncMiddleManServlet.ContentTransformer, Destroyable { - private static final Logger LOG = Log.getLogger(AfterContentTransformer.class); + private static final Logger LOG = LoggerFactory.getLogger(AfterContentTransformer.class); private final List sourceBuffers = new ArrayList<>(); private Path overflowDirectory = Paths.get(System.getProperty("java.io.tmpdir")); @@ -290,7 +290,7 @@ public abstract class AfterContentTransformer implements AsyncMiddleManServlet.C } catch (IOException x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } } diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AsyncMiddleManServlet.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AsyncMiddleManServlet.java index 220384292e7..e119cf44f15 100644 --- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AsyncMiddleManServlet.java +++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AsyncMiddleManServlet.java @@ -55,8 +55,8 @@ import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.CountingCallback; import org.eclipse.jetty.util.IteratingCallback; import org.eclipse.jetty.util.component.Destroyable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Servlet 3.1 asynchronous proxy servlet with capability @@ -757,7 +757,7 @@ public class AsyncMiddleManServlet extends AbstractProxyServlet public static class GZIPContentTransformer implements ContentTransformer { - private static final Logger logger = Log.getLogger(GZIPContentTransformer.class); + private static final Logger logger = LoggerFactory.getLogger(GZIPContentTransformer.class); private final List buffers = new ArrayList<>(2); private final ContentTransformer transformer; diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ConnectHandler.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ConnectHandler.java index e5a1246067f..9cd10814def 100644 --- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ConnectHandler.java +++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ConnectHandler.java @@ -56,17 +56,17 @@ import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.HostPort; import org.eclipse.jetty.util.Promise; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Implementation of a {@link Handler} that supports HTTP CONNECT.

*/ public class ConnectHandler extends HandlerWrapper { - protected static final Logger LOG = Log.getLogger(ConnectHandler.class); + protected static final Logger LOG = LoggerFactory.getLogger(ConnectHandler.class); private final Set whiteList = new HashSet<>(); private final Set blackList = new HashSet<>(); @@ -319,7 +319,7 @@ public class ConnectHandler extends HandlerWrapper } catch (Throwable x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } } diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyConnection.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyConnection.java index e1367691561..196ff272b66 100644 --- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyConnection.java +++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyConnection.java @@ -29,7 +29,7 @@ import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IteratingCallback; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; public abstract class ProxyConnection extends AbstractConnection { diff --git a/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/AsyncMiddleManServletTest.java b/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/AsyncMiddleManServletTest.java index a77330e3765..bb0b2f5c20d 100644 --- a/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/AsyncMiddleManServletTest.java +++ b/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/AsyncMiddleManServletTest.java @@ -74,13 +74,13 @@ import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.Utf8StringBuilder; import org.eclipse.jetty.util.ajax.JSON; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.OS; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -92,7 +92,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @Disabled("See issue #3974") public class AsyncMiddleManServletTest { - private static final Logger LOG = Log.getLogger(AsyncMiddleManServletTest.class); + private static final Logger LOG = LoggerFactory.getLogger(AsyncMiddleManServletTest.class); private static final String PROXIED_HEADER = "X-Proxied"; private HttpClient client; diff --git a/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletLoadTest.java b/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletLoadTest.java index ec13fbdc1c8..3a1ede5507b 100644 --- a/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletLoadTest.java +++ b/jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ProxyServletLoadTest.java @@ -43,13 +43,13 @@ import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.ProcessorUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -64,7 +64,7 @@ public class ProxyServletLoadTest .stream().map(Arguments::of); } - private static final Logger LOG = Log.getLogger(ProxyServletLoadTest.class); + private static final Logger LOG = LoggerFactory.getLogger(ProxyServletLoadTest.class); private static final String PROXIED_HEADER = "X-Proxied"; private HttpClient client; diff --git a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/AttributeNormalizer.java b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/AttributeNormalizer.java index e8b25300053..3f68329e5e9 100644 --- a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/AttributeNormalizer.java +++ b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/AttributeNormalizer.java @@ -38,9 +38,9 @@ import java.util.regex.Pattern; import java.util.stream.Stream; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Normalize Attribute to String. @@ -62,7 +62,7 @@ import org.eclipse.jetty.util.resource.Resource; */ public class AttributeNormalizer { - private static final Logger LOG = Log.getLogger(AttributeNormalizer.class); + private static final Logger LOG = LoggerFactory.getLogger(AttributeNormalizer.class); private static final Pattern __propertyPattern = Pattern.compile("(?<=[^$]|^)\\$\\{([^}]*)\\}"); private static class Attribute @@ -326,7 +326,7 @@ public class AttributeNormalizer } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed to normalize {}", o, e); } return String.valueOf(o); } @@ -376,7 +376,7 @@ public class AttributeNormalizer } catch (IOException ignore) { - LOG.ignore(ignore); + LOG.trace("IGNORED", ignore); } if (path.startsWith(a.path)) diff --git a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/ExtraXmlDescriptorProcessor.java b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/ExtraXmlDescriptorProcessor.java index fe14c738a49..9e4f29d695f 100644 --- a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/ExtraXmlDescriptorProcessor.java +++ b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/ExtraXmlDescriptorProcessor.java @@ -18,12 +18,12 @@ package org.eclipse.jetty.quickstart; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.Descriptor; import org.eclipse.jetty.webapp.IterativeDescriptorProcessor; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.xml.XmlParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ExtraXmlDescriptorProcessor @@ -33,7 +33,7 @@ import org.eclipse.jetty.xml.XmlParser; public class ExtraXmlDescriptorProcessor extends IterativeDescriptorProcessor { - private static final Logger LOG = Log.getLogger(ExtraXmlDescriptorProcessor.class); + private static final Logger LOG = LoggerFactory.getLogger(ExtraXmlDescriptorProcessor.class); private final StringBuilder _buffer = new StringBuilder(); private final boolean _showOrigin; diff --git a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/PreconfigureQuickStartWar.java b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/PreconfigureQuickStartWar.java index 362554360a1..6534eed84ce 100644 --- a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/PreconfigureQuickStartWar.java +++ b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/PreconfigureQuickStartWar.java @@ -24,16 +24,16 @@ import org.eclipse.jetty.annotations.AnnotationConfiguration; import org.eclipse.jetty.plus.webapp.EnvConfiguration; import org.eclipse.jetty.plus.webapp.PlusConfiguration; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.JarResource; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.xml.XmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class PreconfigureQuickStartWar { - private static final Logger LOG = Log.getLogger(PreconfigureQuickStartWar.class); + private static final Logger LOG = LoggerFactory.getLogger(PreconfigureQuickStartWar.class); static final boolean ORIGIN = LOG.isDebugEnabled(); public static void main(String... args) throws Exception diff --git a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartConfiguration.java b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartConfiguration.java index b71c56b5a85..35ba26a4055 100644 --- a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartConfiguration.java +++ b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartConfiguration.java @@ -29,8 +29,6 @@ import org.eclipse.jetty.annotations.AnnotationDecorator; import org.eclipse.jetty.annotations.ServletContainerInitializersStarter; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.AbstractConfiguration; import org.eclipse.jetty.webapp.Configuration; @@ -39,6 +37,8 @@ import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.webapp.WebDescriptor; import org.eclipse.jetty.webapp.WebInfConfiguration; import org.eclipse.jetty.webapp.WebXmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * QuickStartConfiguration @@ -47,7 +47,7 @@ import org.eclipse.jetty.webapp.WebXmlConfiguration; */ public class QuickStartConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(QuickStartConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(QuickStartConfiguration.class); public static final Set> __replacedConfigurations = new HashSet<>(); public static final String ORIGIN_ATTRIBUTE = "org.eclipse.jetty.quickstart.origin"; diff --git a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartGeneratorConfiguration.java b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartGeneratorConfiguration.java index 59f864b93a5..0cf047c4c87 100644 --- a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartGeneratorConfiguration.java +++ b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartGeneratorConfiguration.java @@ -53,8 +53,6 @@ import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletMapping; import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.webapp.AbstractConfiguration; @@ -64,6 +62,8 @@ import org.eclipse.jetty.webapp.MetaInfConfiguration; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.webapp.WebInfConfiguration; import org.eclipse.jetty.xml.XmlAppendable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * QuickStartGeneratorConfiguration @@ -77,7 +77,7 @@ import org.eclipse.jetty.xml.XmlAppendable; */ public class QuickStartGeneratorConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(QuickStartGeneratorConfiguration.class); + static final Logger LOG = LoggerFactory.getLogger(QuickStartGeneratorConfiguration.class); public static final String ORIGIN = "org.eclipse.jetty.originAttribute"; public static final String DEFAULT_ORIGIN_ATTRIBUTE_NAME = "origin"; diff --git a/jetty-rewrite/src/main/config/modules/rewrite-customizer.mod b/jetty-rewrite/src/main/config/modules/rewrite-customizer.mod index 5caea6942c8..a1231ca8def 100644 --- a/jetty-rewrite/src/main/config/modules/rewrite-customizer.mod +++ b/jetty-rewrite/src/main/config/modules/rewrite-customizer.mod @@ -1,4 +1,4 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html [description] Enables a rewrite Rules container as a request customizer on diff --git a/jetty-rewrite/src/main/config/modules/rewrite.mod b/jetty-rewrite/src/main/config/modules/rewrite.mod index 939acebdd12..3d9bb91b074 100644 --- a/jetty-rewrite/src/main/config/modules/rewrite.mod +++ b/jetty-rewrite/src/main/config/modules/rewrite.mod @@ -1,11 +1,11 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html [description] Enables the jetty-rewrite handler. Specific rewrite rules must be added to either to etc/jetty-rewrite.xml or a custom xml/module [provides] -rewrite +rewrite|default [depend] server diff --git a/jetty-rewrite/src/main/java/org/eclipse/jetty/rewrite/handler/RuleContainer.java b/jetty-rewrite/src/main/java/org/eclipse/jetty/rewrite/handler/RuleContainer.java index db153cefdd4..a1eff8f762d 100644 --- a/jetty-rewrite/src/main/java/org/eclipse/jetty/rewrite/handler/RuleContainer.java +++ b/jetty-rewrite/src/main/java/org/eclipse/jetty/rewrite/handler/RuleContainer.java @@ -28,8 +28,8 @@ import org.eclipse.jetty.util.ArrayUtil; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Base container to group rules. Can be extended so that the contained rules @@ -38,7 +38,7 @@ import org.eclipse.jetty.util.log.Logger; public class RuleContainer extends Rule implements Dumpable { public static final String ORIGINAL_QUERYSTRING_ATTRIBUTE_SUFFIX = ".QUERYSTRING"; - private static final Logger LOG = Log.getLogger(RuleContainer.class); + private static final Logger LOG = LoggerFactory.getLogger(RuleContainer.class); protected Rule[] _rules; diff --git a/jetty-rewrite/src/main/java/org/eclipse/jetty/rewrite/handler/ValidUrlRule.java b/jetty-rewrite/src/main/java/org/eclipse/jetty/rewrite/handler/ValidUrlRule.java index 5d6406cf61b..e159703cf02 100644 --- a/jetty-rewrite/src/main/java/org/eclipse/jetty/rewrite/handler/ValidUrlRule.java +++ b/jetty-rewrite/src/main/java/org/eclipse/jetty/rewrite/handler/ValidUrlRule.java @@ -23,8 +23,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This rule can be used to protect against invalid unicode characters in a url making it into applications. @@ -38,7 +38,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class ValidUrlRule extends Rule { - private static final Logger LOG = Log.getLogger(ValidUrlRule.class); + private static final Logger LOG = LoggerFactory.getLogger(ValidUrlRule.class); String _code = "400"; String _message = "Illegal Url"; diff --git a/jetty-runner/src/main/java/org/eclipse/jetty/runner/Runner.java b/jetty-runner/src/main/java/org/eclipse/jetty/runner/Runner.java index 991fc300257..0e67904d8f4 100644 --- a/jetty-runner/src/main/java/org/eclipse/jetty/runner/Runner.java +++ b/jetty-runner/src/main/java/org/eclipse/jetty/runner/Runner.java @@ -53,13 +53,13 @@ import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.StatisticsServlet; import org.eclipse.jetty.util.RolloverFileOutputStream; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.webapp.MetaInfConfiguration; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.xml.XmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Runner @@ -71,7 +71,7 @@ import org.eclipse.jetty.xml.XmlConfiguration; @Deprecated public class Runner { - private static final Logger LOG = Log.getLogger(Runner.class); + private static final Logger LOG = LoggerFactory.getLogger(Runner.class); public static final String[] PLUS_CONFIGURATION_CLASSES = { diff --git a/jetty-security/pom.xml b/jetty-security/pom.xml index ed204799803..a173d4ea82c 100644 --- a/jetty-security/pom.xml +++ b/jetty-security/pom.xml @@ -50,7 +50,17 @@ jetty-server ${project.version}
+ + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.tests jetty-http-tools diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/AbstractLoginService.java b/jetty-security/src/main/java/org/eclipse/jetty/security/AbstractLoginService.java index a0471ea722f..3584be44c36 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/AbstractLoginService.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/AbstractLoginService.java @@ -25,16 +25,16 @@ import javax.servlet.ServletRequest; import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Credential; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AbstractLoginService */ public abstract class AbstractLoginService extends ContainerLifeCycle implements LoginService { - private static final Logger LOG = Log.getLogger(AbstractLoginService.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractLoginService.class); protected IdentityService _identityService = new DefaultIdentityService(); protected String _name; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/ConfigurableSpnegoLoginService.java b/jetty-security/src/main/java/org/eclipse/jetty/security/ConfigurableSpnegoLoginService.java index f4082925312..9f521f9a277 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/ConfigurableSpnegoLoginService.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/ConfigurableSpnegoLoginService.java @@ -36,14 +36,14 @@ import javax.servlet.http.HttpSession; import org.eclipse.jetty.security.authentication.AuthorizationService; import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.ietf.jgss.GSSContext; import org.ietf.jgss.GSSCredential; import org.ietf.jgss.GSSException; import org.ietf.jgss.GSSManager; import org.ietf.jgss.GSSName; import org.ietf.jgss.Oid; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A configurable (as opposed to using system properties) SPNEGO LoginService.

@@ -58,7 +58,7 @@ import org.ietf.jgss.Oid; */ public class ConfigurableSpnegoLoginService extends ContainerLifeCycle implements LoginService { - private static final Logger LOG = Log.getLogger(ConfigurableSpnegoLoginService.class); + private static final Logger LOG = LoggerFactory.getLogger(ConfigurableSpnegoLoginService.class); private final GSSManager _gssManager = GSSManager.getInstance(); private final String _realm; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java b/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java index 68851c767da..fae59423c75 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java @@ -47,9 +47,9 @@ import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Constraint; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ConstraintSecurityHandler @@ -60,7 +60,7 @@ import org.eclipse.jetty.util.security.Constraint; */ public class ConstraintSecurityHandler extends SecurityHandler implements ConstraintAware { - private static final Logger LOG = Log.getLogger(SecurityHandler.class); //use same as SecurityHandler + private static final Logger LOG = LoggerFactory.getLogger(SecurityHandler.class); //use same as SecurityHandler private static final String OMISSION_SUFFIX = ".omission"; private static final String ALL_METHODS = "*"; @@ -744,12 +744,14 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr Set paths = getPathsWithUncoveredHttpMethods(); if (paths != null && !paths.isEmpty()) { + ContextHandler.Context currentContext = ContextHandler.getCurrentContext(); + for (String p : paths) { - LOG.warn("{} has uncovered http methods for path: {}", ContextHandler.getCurrentContext(), p); + LOG.warn("{} has uncovered http methods for path: {}", currentContext, p); } if (LOG.isDebugEnabled()) - LOG.debug(new Throwable()); + LOG.debug("{} has uncovered http methods", currentContext, new Throwable()); return true; } return false; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/HashLoginService.java b/jetty-security/src/main/java/org/eclipse/jetty/security/HashLoginService.java index 0730a9bc324..12ab94ec680 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/HashLoginService.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/HashLoginService.java @@ -23,8 +23,8 @@ import java.util.Set; import java.util.stream.Collectors; import org.eclipse.jetty.server.UserIdentity; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Properties User Realm. @@ -44,7 +44,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class HashLoginService extends AbstractLoginService { - private static final Logger LOG = Log.getLogger(HashLoginService.class); + private static final Logger LOG = LoggerFactory.getLogger(HashLoginService.class); private String _config; private boolean hotReload = false; // default is not to reload diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/JDBCLoginService.java b/jetty-security/src/main/java/org/eclipse/jetty/security/JDBCLoginService.java index ec49dc2f716..67c35d85eb6 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/JDBCLoginService.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/JDBCLoginService.java @@ -31,10 +31,10 @@ import java.util.Properties; import javax.servlet.ServletRequest; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.security.Credential; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * HashMapped User Realm with JDBC as data source. @@ -51,7 +51,7 @@ import org.eclipse.jetty.util.security.Credential; */ public class JDBCLoginService extends AbstractLoginService { - private static final Logger LOG = Log.getLogger(JDBCLoginService.class); + private static final Logger LOG = LoggerFactory.getLogger(JDBCLoginService.class); protected String _config; protected String _jdbcDriver; @@ -284,7 +284,7 @@ public class JDBCLoginService extends AbstractLoginService } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } _con = null; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/PropertyUserStore.java b/jetty-security/src/main/java/org/eclipse/jetty/security/PropertyUserStore.java index 080691002f7..aec9c720f95 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/PropertyUserStore.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/PropertyUserStore.java @@ -35,12 +35,12 @@ import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.PathWatcher; import org.eclipse.jetty.util.PathWatcher.PathWatchEvent; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.JarFileResource; import org.eclipse.jetty.util.resource.PathResource; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.security.Credential; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

This class monitors a property file of the format mentioned below @@ -59,7 +59,7 @@ import org.eclipse.jetty.util.security.Credential; */ public class PropertyUserStore extends UserStore implements PathWatcher.Listener { - private static final Logger LOG = Log.getLogger(PropertyUserStore.class); + private static final Logger LOG = LoggerFactory.getLogger(PropertyUserStore.class); protected Path _configPath; protected PathWatcher _pathWatcher; @@ -305,7 +305,7 @@ public class PropertyUserStore extends UserStore implements PathWatcher.Listener } catch (IOException e) { - LOG.warn(e); + LOG.warn("Unable to load users", e); } } diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java b/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java index e2a907b53ef..3629f069db5 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java @@ -42,8 +42,8 @@ import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ContextHandler.Context; import org.eclipse.jetty.server.handler.HandlerWrapper; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Abstract SecurityHandler. @@ -61,7 +61,7 @@ import org.eclipse.jetty.util.log.Logger; */ public abstract class SecurityHandler extends HandlerWrapper implements Authenticator.AuthConfiguration { - private static final Logger LOG = Log.getLogger(SecurityHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(SecurityHandler.class); private static final List __knownAuthenticatorFactories = new ArrayList<>(); private boolean _checkWelcomeFiles = false; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/ConfigurableSpnegoAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/ConfigurableSpnegoAuthenticator.java index 25902b67170..4861a25cdbf 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/ConfigurableSpnegoAuthenticator.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/ConfigurableSpnegoAuthenticator.java @@ -38,9 +38,9 @@ import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.Authentication.User; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.UserIdentity; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Constraint; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A LoginAuthenticator that uses SPNEGO and the GSS API to authenticate requests.

@@ -52,7 +52,7 @@ import org.eclipse.jetty.util.security.Constraint; */ public class ConfigurableSpnegoAuthenticator extends LoginAuthenticator { - private static final Logger LOG = Log.getLogger(ConfigurableSpnegoAuthenticator.class); + private static final Logger LOG = LoggerFactory.getLogger(ConfigurableSpnegoAuthenticator.class); private final String _authMethod; private Duration _authenticationDuration = Duration.ofNanos(-1); diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DeferredAuthentication.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DeferredAuthentication.java index a83d086912d..71a25034bac 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DeferredAuthentication.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DeferredAuthentication.java @@ -39,12 +39,12 @@ import org.eclipse.jetty.security.UserAuthentication; import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class DeferredAuthentication implements Authentication.Deferred { - private static final Logger LOG = Log.getLogger(DeferredAuthentication.class); + private static final Logger LOG = LoggerFactory.getLogger(DeferredAuthentication.class); protected final LoginAuthenticator _authenticator; private Object _previousAssociation; @@ -74,7 +74,7 @@ public class DeferredAuthentication implements Authentication.Deferred } catch (ServerAuthException e) { - LOG.debug(e); + LOG.debug("Unable to authenticate {}", request, e); } return this; @@ -95,7 +95,7 @@ public class DeferredAuthentication implements Authentication.Deferred } catch (ServerAuthException e) { - LOG.debug(e); + LOG.debug("Unable to authenticate {}", request, e); } return this; } diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java index 74b07ffcb9f..d97750c1f45 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java @@ -44,10 +44,10 @@ import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.util.security.Credential; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The nonce max age in ms can be set with the {@link SecurityHandler#setInitParameter(String, String)} @@ -56,7 +56,7 @@ import org.eclipse.jetty.util.security.Credential; */ public class DigestAuthenticator extends LoginAuthenticator { - private static final Logger LOG = Log.getLogger(DigestAuthenticator.class); + private static final Logger LOG = LoggerFactory.getLogger(DigestAuthenticator.class); private final SecureRandom _random = new SecureRandom(); private long _maxNonceAgeMs = 60 * 1000; @@ -275,7 +275,7 @@ public class DigestAuthenticator extends LoginAuthenticator } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } return -1; } @@ -384,7 +384,7 @@ public class DigestAuthenticator extends LoginAuthenticator } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to process digest", e); } return false; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java index 98694577ab2..383dfd6f274 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java @@ -47,9 +47,9 @@ import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.util.MultiMap; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Constraint; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * FORM Authenticator. @@ -66,7 +66,7 @@ import org.eclipse.jetty.util.security.Constraint; */ public class FormAuthenticator extends LoginAuthenticator { - private static final Logger LOG = Log.getLogger(FormAuthenticator.class); + private static final Logger LOG = LoggerFactory.getLogger(FormAuthenticator.class); public static final String __FORM_LOGIN_PAGE = "org.eclipse.jetty.security.form_login_page"; public static final String __FORM_ERROR_PAGE = "org.eclipse.jetty.security.form_error_page"; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java index 04db751c6d1..1c9ac1a659a 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginAuthenticator.java @@ -30,12 +30,12 @@ import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Response; import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.server.session.Session; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class LoginAuthenticator implements Authenticator { - private static final Logger LOG = Log.getLogger(LoginAuthenticator.class); + private static final Logger LOG = LoggerFactory.getLogger(LoginAuthenticator.class); protected LoginService _loginService; protected IdentityService _identityService; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/SessionAuthentication.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/SessionAuthentication.java index 8349bd21dae..8092529925d 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/SessionAuthentication.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/SessionAuthentication.java @@ -30,8 +30,8 @@ import org.eclipse.jetty.security.AbstractUserAuthentication; import org.eclipse.jetty.security.LoginService; import org.eclipse.jetty.security.SecurityHandler; import org.eclipse.jetty.server.UserIdentity; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * SessionAuthentication @@ -43,7 +43,7 @@ import org.eclipse.jetty.util.log.Logger; public class SessionAuthentication extends AbstractUserAuthentication implements Serializable, HttpSessionActivationListener, HttpSessionBindingListener { - private static final Logger LOG = Log.getLogger(SessionAuthentication.class); + private static final Logger LOG = LoggerFactory.getLogger(SessionAuthentication.class); private static final long serialVersionUID = -4643200685888258706L; diff --git a/jetty-security/src/test/resources/jetty-logging.properties b/jetty-security/src/test/resources/jetty-logging.properties index e6d3c167d1f..bd86a8c5369 100755 --- a/jetty-security/src/test/resources/jetty-logging.properties +++ b/jetty-security/src/test/resources/jetty-logging.properties @@ -1,6 +1,5 @@ # Setup default logging implementation for during testing # Jetty Logging using jetty-slf4j-impl #org.eclipse.jetty.LEVEL=DEBUG - #org.eclipse.jetty.util.PathWatcher.LEVEL=DEBUG #org.eclipse.jetty.util.PathWatcher.Noisy.LEVEL=OFF diff --git a/jetty-server/src/main/config/modules/bytebufferpool.mod b/jetty-server/src/main/config/modules/bytebufferpool.mod index 7a813148b6e..d4b28f9244d 100644 --- a/jetty-server/src/main/config/modules/bytebufferpool.mod +++ b/jetty-server/src/main/config/modules/bytebufferpool.mod @@ -3,6 +3,9 @@ DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-m [description] Configures the ByteBufferPool used by ServerConnectors. +[depends] +logging + [xml] etc/jetty-bytebufferpool.xml diff --git a/jetty-server/src/main/config/modules/server.mod b/jetty-server/src/main/config/modules/server.mod index 6118e9abeac..8e76acec0d0 100644 --- a/jetty-server/src/main/config/modules/server.mod +++ b/jetty-server/src/main/config/modules/server.mod @@ -1,4 +1,4 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html +# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html [description] Enables the core Jetty server on the classpath. diff --git a/jetty-server/src/main/config/modules/threadpool.mod b/jetty-server/src/main/config/modules/threadpool.mod index c0201b3c7e0..36541ef9664 100644 --- a/jetty-server/src/main/config/modules/threadpool.mod +++ b/jetty-server/src/main/config/modules/threadpool.mod @@ -3,6 +3,9 @@ DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-m [description] Enables the Server thread pool. +[depends] +logging + [xml] etc/jetty-threadpool.xml diff --git a/jetty-server/src/main/java/module-info.java b/jetty-server/src/main/java/module-info.java index 3bba30e7b79..f7153549730 100644 --- a/jetty-server/src/main/java/module-info.java +++ b/jetty-server/src/main/java/module-info.java @@ -25,9 +25,9 @@ module org.eclipse.jetty.server exports org.eclipse.jetty.server.jmx to org.eclipse.jetty.jmx; exports org.eclipse.jetty.server.session; - requires transitive org.slf4j; requires transitive jetty.servlet.api; requires transitive org.eclipse.jetty.http; + requires transitive org.slf4j; // Only required if using DatabaseAdaptor/JDBCSessionDataStore. requires static java.sql; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java index e9dfdcf08ba..357286a7c82 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java @@ -48,13 +48,13 @@ import org.eclipse.jetty.util.component.Container; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.Graceful; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.AutoLock; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.util.thread.ThreadPoolBudget; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

An abstract implementation of {@link Connector} that provides a {@link ConnectionFactory} mechanism @@ -141,7 +141,7 @@ import org.eclipse.jetty.util.thread.ThreadPoolBudget; @ManagedObject("Abstract implementation of the Connector Interface") public abstract class AbstractConnector extends ContainerLifeCycle implements Connector, Dumpable { - protected static final Logger LOG = Log.getLogger(AbstractConnector.class); + protected static final Logger LOG = LoggerFactory.getLogger(AbstractConnector.class); private final AutoLock _lock = new AutoLock(); private final Condition _setAccepting = _lock.newCondition(); @@ -643,17 +643,17 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co { if (ex instanceof InterruptedException) { - LOG.debug(ex); + LOG.debug("Accept Interrupted", ex); return true; } if (ex instanceof ClosedByInterruptException) { - LOG.debug(ex); + LOG.debug("Accept Closed by Interrupt", ex); return false; } - LOG.warn(ex); + LOG.warn("Accept Failure", ex); try { // Arbitrary sleep to avoid spin looping. @@ -664,13 +664,13 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co } catch (Throwable x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } return false; } else { - LOG.ignore(ex); + LOG.trace("IGNORED", ex); return false; } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNetworkConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNetworkConnector.java index d7e7c5d5131..69ff10b546a 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNetworkConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNetworkConnector.java @@ -110,7 +110,7 @@ public abstract class AbstractNetworkConnector extends AbstractConnector impleme { if (isOpen()) return super.handleAcceptFailure(ex); - LOG.ignore(ex); + LOG.trace("IGNORED", ex); return false; } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AcceptRateLimit.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AcceptRateLimit.java index 075835712e4..28d9ca77db4 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AcceptRateLimit.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AcceptRateLimit.java @@ -30,10 +30,10 @@ import org.eclipse.jetty.util.annotation.ManagedOperation; import org.eclipse.jetty.util.annotation.Name; import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.component.Container; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.statistic.RateStatistic; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A Listener that limits the rate at which new connections are accepted

@@ -62,7 +62,7 @@ import org.eclipse.jetty.util.thread.Scheduler; @ManagedObject public class AcceptRateLimit extends AbstractLifeCycle implements SelectorManager.AcceptListener, Runnable { - private static final Logger LOG = Log.getLogger(AcceptRateLimit.class); + private static final Logger LOG = LoggerFactory.getLogger(AcceptRateLimit.class); private final Server _server; private final List _connectors = new ArrayList<>(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncRequestLogWriter.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncRequestLogWriter.java index 6fe2a637de3..f1a9ba6cb88 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncRequestLogWriter.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncRequestLogWriter.java @@ -23,15 +23,15 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; import org.eclipse.jetty.util.BlockingArrayQueue; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * An asynchronously writing RequestLogWriter */ public class AsyncRequestLogWriter extends RequestLogWriter { - private static final Logger LOG = Log.getLogger(AsyncRequestLogWriter.class); + private static final Logger LOG = LoggerFactory.getLogger(AsyncRequestLogWriter.class); private final BlockingQueue _queue; private transient AsyncRequestLogWriter.WriterThread _thread; private boolean _warnedFull; @@ -81,11 +81,11 @@ public class AsyncRequestLogWriter extends RequestLogWriter } catch (InterruptedException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } catch (Throwable t) { - LOG.warn(t); + LOG.warn("Failed to write log", t); } } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/CachedContentFactory.java b/jetty-server/src/main/java/org/eclipse/jetty/server/CachedContentFactory.java index 9db3480edd9..3d4cc0f52de 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/CachedContentFactory.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/CachedContentFactory.java @@ -44,14 +44,14 @@ import org.eclipse.jetty.http.PreEncodedHttpField; import org.eclipse.jetty.http.PrecompressedHttpContent; import org.eclipse.jetty.http.ResourceHttpContent; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.ResourceFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class CachedContentFactory implements HttpContent.ContentFactory { - private static final Logger LOG = Log.getLogger(CachedContentFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(CachedContentFactory.class); private static final Map NO_PRECOMPRESSED = Collections.unmodifiableMap(Collections.emptyMap()); private final ConcurrentMap _cache; @@ -334,7 +334,7 @@ public class CachedContentFactory implements HttpContent.ContentFactory catch (IOException | IllegalArgumentException e) { if (LOG.isDebugEnabled()) - LOG.debug(e); + LOG.debug("Unable to get Indirect Buffer for {}", resource, e); } return null; } @@ -351,7 +351,7 @@ public class CachedContentFactory implements HttpContent.ContentFactory catch (IOException | IllegalArgumentException e) { if (LOG.isDebugEnabled()) - LOG.debug(e); + LOG.debug("Unable to get Mapped Buffer for {}", resource, e); } return null; } @@ -365,7 +365,7 @@ public class CachedContentFactory implements HttpContent.ContentFactory catch (IOException | IllegalArgumentException e) { if (LOG.isDebugEnabled()) - LOG.debug(e); + LOG.debug("Unable to get Direct Buffer for {}", resource, e); } return null; } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ConnectionLimit.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ConnectionLimit.java index 2cbab41e39e..054923a2862 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ConnectionLimit.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ConnectionLimit.java @@ -33,8 +33,8 @@ import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.Name; import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.component.Container; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A Listener that limits the number of Connections.

@@ -60,7 +60,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject public class ConnectionLimit extends AbstractLifeCycle implements Listener, SelectorManager.AcceptListener { - private static final Logger LOG = Log.getLogger(ConnectionLimit.class); + private static final Logger LOG = LoggerFactory.getLogger(ConnectionLimit.class); private final Server _server; private final List _connectors = new ArrayList<>(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Cookies.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Cookies.java index e24bfc37cf5..f4bea7da7d5 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Cookies.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Cookies.java @@ -25,8 +25,8 @@ import javax.servlet.http.Cookie; import org.eclipse.jetty.http.ComplianceViolation; import org.eclipse.jetty.http.CookieCompliance; import org.eclipse.jetty.http.CookieCutter; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Cookie parser @@ -38,7 +38,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class Cookies extends CookieCutter { - protected static final Logger LOG = Log.getLogger(Cookies.class); + protected static final Logger LOG = LoggerFactory.getLogger(Cookies.class); protected final List _rawFields = new ArrayList<>(); protected final List _cookieList = new ArrayList<>(); private int _addedFields; @@ -137,7 +137,8 @@ public class Cookies extends CookieCutter } catch (Exception e) { - LOG.debug(e); + LOG.debug("Unable to add Cookie name={}, value={}, domain={}, path={}, version={}, comment={}", + name, value, domain, path, version, comment, e); } } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java b/jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java index 2a55d850594..dca18dc01cd 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java @@ -42,8 +42,8 @@ import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.lang.invoke.MethodHandles.dropArguments; import static java.lang.invoke.MethodHandles.foldArguments; @@ -271,7 +271,7 @@ import static java.lang.invoke.MethodType.methodType; @ManagedObject("Custom format request log") public class CustomRequestLog extends ContainerLifeCycle implements RequestLog { - protected static final Logger LOG = Log.getLogger(CustomRequestLog.class); + protected static final Logger LOG = LoggerFactory.getLogger(CustomRequestLog.class); public static final String DEFAULT_DATE_FORMAT = "dd/MMM/yyyy:HH:mm:ss ZZZ"; @@ -347,7 +347,7 @@ public class CustomRequestLog extends ContainerLifeCycle implements RequestLog } catch (Throwable e) { - LOG.warn(e); + LOG.warn("Unable to log request", e); } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/DebugListener.java b/jetty-server/src/main/java/org/eclipse/jetty/server/DebugListener.java index 275158ae1a2..0b62297ec6e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/DebugListener.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/DebugListener.java @@ -42,8 +42,8 @@ import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.Name; import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A Context Listener that produces additional debug. @@ -55,7 +55,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Debug Listener") public class DebugListener extends AbstractLifeCycle implements ServletContextListener { - private static final Logger LOG = Log.getLogger(DebugListener.class); + private static final Logger LOG = LoggerFactory.getLogger(DebugListener.class); private static final DateCache __date = new DateCache("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH); private final String _attr = String.format("__R%s@%x", this.getClass().getSimpleName(), System.identityHashCode(this)); @@ -140,7 +140,7 @@ public class DebugListener extends AbstractLifeCycle implements ServletContextLi } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to dump {}", handler, e); } } } @@ -192,7 +192,7 @@ public class DebugListener extends AbstractLifeCycle implements ServletContextLi if (_out != null) _out.printf("%s.%03d:%s%n", __date.formatNow(now), ms, s); if (LOG.isDebugEnabled()) - LOG.info(s); + LOG.debug(s); } final AsyncListener _asyncListener = new AsyncListener() diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/DetectorConnectionFactory.java b/jetty-server/src/main/java/org/eclipse/jetty/server/DetectorConnectionFactory.java index 74867150ffe..2e93350a9dc 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/DetectorConnectionFactory.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/DetectorConnectionFactory.java @@ -28,8 +28,8 @@ import org.eclipse.jetty.io.AbstractConnection; import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A {@link ConnectionFactory} combining multiple {@link Detecting} instances that will upgrade to @@ -37,7 +37,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class DetectorConnectionFactory extends AbstractConnectionFactory implements ConnectionFactory.Detecting { - private static final Logger LOG = Log.getLogger(DetectorConnectionFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(DetectorConnectionFactory.class); private final List _detectingConnectionFactories; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java index dfb319693f6..6801e9b669f 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java @@ -36,12 +36,12 @@ import org.eclipse.jetty.http.HttpURI; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.Attributes; import org.eclipse.jetty.util.MultiMap; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Dispatcher implements RequestDispatcher { - private static final Logger LOG = Log.getLogger(Dispatcher.class); + private static final Logger LOG = LoggerFactory.getLogger(Dispatcher.class); /** * Dispatch include attribute names diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HomeBaseWarning.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HomeBaseWarning.java index 138c532512f..0071afbda3e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HomeBaseWarning.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HomeBaseWarning.java @@ -24,8 +24,8 @@ import java.nio.file.Files; import java.nio.file.Path; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Display an optional Warning Message if the {jetty.home} and {jetty.base} are the same directory. @@ -34,7 +34,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class HomeBaseWarning { - private static final Logger LOG = Log.getLogger(HomeBaseWarning.class); + private static final Logger LOG = LoggerFactory.getLogger(HomeBaseWarning.class); public HomeBaseWarning() { @@ -59,7 +59,7 @@ public class HomeBaseWarning } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); // Can't definitively determine this state return; } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java index fdaf37a6510..15b917e5d4d 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java @@ -53,9 +53,9 @@ import org.eclipse.jetty.server.handler.ErrorHandler; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.SharedBlockingCallback.Blocker; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * HttpChannel represents a single endpoint for HTTP semantic processing. @@ -68,8 +68,8 @@ import org.eclipse.jetty.util.thread.Scheduler; */ public class HttpChannel implements Runnable, HttpOutput.Interceptor { - public static Listener NOOP_LISTENER = new Listener(){}; - private static final Logger LOG = Log.getLogger(HttpChannel.class); + public static Listener NOOP_LISTENER = new Listener() {}; + private static final Logger LOG = LoggerFactory.getLogger(HttpChannel.class); private final AtomicLong _requests = new AtomicLong(); private final Connector _connector; @@ -512,7 +512,7 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor catch (Throwable failure) { if ("org.eclipse.jetty.continuation.ContinuationThrowable".equals(failure.getClass().getName())) - LOG.ignore(failure); + LOG.trace("IGNORED", failure); else handleException(failure); } @@ -542,7 +542,7 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor } catch (Throwable x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); abort(x); } return false; @@ -803,7 +803,7 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor } catch (IOException e) { - LOG.debug(e); + LOG.debug("Unable to send bad message response", e); } finally { @@ -813,7 +813,7 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor } catch (Throwable e) { - LOG.debug(e); + LOG.debug("Unable to complete bad message", e); abort(e); } } @@ -872,7 +872,7 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor catch (Throwable failure) { if (LOG.isDebugEnabled()) - LOG.debug(failure); + LOG.debug("Unable to send response", failure); abort(failure); throw failure; } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelListeners.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelListeners.java index 8b0899f479d..f380ab54e56 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelListeners.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelListeners.java @@ -21,8 +21,8 @@ package org.eclipse.jetty.server; import java.nio.ByteBuffer; import java.util.Collection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A {@link HttpChannel.Listener} that holds a collection of @@ -32,7 +32,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class HttpChannelListeners implements HttpChannel.Listener { - static final Logger LOG = Log.getLogger(HttpChannel.class); + static final Logger LOG = LoggerFactory.getLogger(HttpChannel.class); public static HttpChannel.Listener NOOP = new HttpChannel.Listener() {}; private final NotifyRequest onRequestBegin; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelOverHttp.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelOverHttp.java index ec38a169b14..f02f299ab66 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelOverHttp.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelOverHttp.java @@ -40,15 +40,15 @@ import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.http.MetaData; import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.EndPoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * An HttpChannel customized to be transported over the HTTP/1 protocol */ public class HttpChannelOverHttp extends HttpChannel implements HttpParser.RequestHandler, ComplianceViolation.Listener { - private static final Logger LOG = Log.getLogger(HttpChannelOverHttp.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpChannelOverHttp.class); private static final HttpField PREAMBLE_UPGRADE_H2C = new HttpField(HttpHeader.UPGRADE, "h2c"); private final HttpFields _fields = new HttpFields(); private final MetaData.Request _metadata = new MetaData.Request(_fields); @@ -279,7 +279,7 @@ public class HttpChannelOverHttp extends HttpChannel implements HttpParser.Reque } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } onBadMessage(failure); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java index 0cad3483aad..0871e53b14b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java @@ -32,9 +32,9 @@ import org.eclipse.jetty.io.QuietException; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ContextHandler.Context; import org.eclipse.jetty.server.handler.ErrorHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static javax.servlet.RequestDispatcher.ERROR_EXCEPTION; import static javax.servlet.RequestDispatcher.ERROR_EXCEPTION_TYPE; @@ -48,7 +48,7 @@ import static javax.servlet.RequestDispatcher.ERROR_STATUS_CODE; */ public class HttpChannelState { - private static final Logger LOG = Log.getLogger(HttpChannelState.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpChannelState.class); private static final long DEFAULT_TIMEOUT = Long.getLong("org.eclipse.jetty.server.HttpChannelState.DEFAULT_TIMEOUT", 30000L); @@ -471,7 +471,7 @@ public class HttpChannelState case IDLE: case REGISTERED: break; - + default: throw new IllegalStateException(getStatusStringLocked()); } @@ -555,7 +555,7 @@ public class HttpChannelState catch (Throwable e) { // TODO Async Dispatch Error - LOG.warn(e); + LOG.warn("Async dispatch error", e); } } } @@ -664,8 +664,10 @@ public class HttpChannelState } catch (Throwable x) { - LOG.warn(x + " while invoking onTimeout listener " + listener); - LOG.debug(x); + if (LOG.isDebugEnabled()) + LOG.warn("{} while invoking onTimeout listener {}", x.toString(), listener, x); + else + LOG.warn("{} while invoking onTimeout listener {}", x.toString(), listener); } } } @@ -739,7 +741,7 @@ public class HttpChannelState if (!(failure instanceof QuietException)) LOG.warn(failure.toString()); if (LOG.isDebugEnabled()) - LOG.debug(failure); + LOG.debug("Async error", failure); } } @@ -809,8 +811,10 @@ public class HttpChannelState } catch (Throwable x) { - LOG.warn(x + " while invoking onError listener " + listener); - LOG.debug(x); + if (LOG.isDebugEnabled()) + LOG.warn("{} while invoking onError listener {}", x.toString(), listener, x); + else + LOG.warn("{} while invoking onError listener {}", x.toString(), listener); } } }); @@ -989,10 +993,12 @@ public class HttpChannelState { listener.onComplete(event); } - catch (Throwable e) + catch (Throwable x) { - LOG.warn(e + " while invoking onComplete listener " + listener); - LOG.debug(e); + if (LOG.isDebugEnabled()) + LOG.warn("{} while invoking onComplete listener {}", x.toString(), listener, x); + else + LOG.warn("{} while invoking onComplete listener {}", x.toString(), listener); } } }); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java index f7c1e92c006..d54aeaf2d47 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java @@ -46,15 +46,15 @@ import org.eclipse.jetty.io.WriteFlusher; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IteratingCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A {@link Connection} that handles the HTTP protocol.

*/ public class HttpConnection extends AbstractConnection implements Runnable, HttpTransport, WriteFlusher.Listener, Connection.UpgradeFrom, Connection.UpgradeTo { - private static final Logger LOG = Log.getLogger(HttpConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpConnection.class); public static final HttpField CONNECTION_CLOSE = new PreEncodedHttpField(HttpHeader.CONNECTION, HttpHeaderValue.CLOSE.asString()); private static final ThreadLocal __currentConnection = new ThreadLocal<>(); @@ -313,7 +313,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http LOG.debug("{} onFillable exit {} {}", this, _channel.getState(), BufferUtil.toDetailString(_requestBuffer)); } } - + /** * Fill and parse data looking for content * @@ -365,7 +365,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http } catch (IOException e) { - LOG.debug(e); + LOG.debug("Unable to fill from endpoint {}", getEndPoint(), e); _parser.atEOF(); return -1; } @@ -376,7 +376,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http private boolean parseRequestBuffer() { if (LOG.isDebugEnabled()) - LOG.debug("{} parse {} {}", this, BufferUtil.toDetailString(_requestBuffer)); + LOG.debug("{} parse {}", this, BufferUtil.toDetailString(_requestBuffer)); boolean handle = _parser.parseNext(_requestBuffer == null ? BufferUtil.EMPTY_BUFFER : _requestBuffer); @@ -494,9 +494,9 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http catch (RejectedExecutionException e) { if (getConnector().isRunning()) - LOG.warn(e); + LOG.warn("Failed dispatch of {}", this, e); else - LOG.ignore(e); + LOG.trace("IGNORED", e); getEndPoint().close(); } } @@ -641,11 +641,11 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http public String toConnectionString() { return String.format("%s@%x[p=%s,g=%s]=>%s", - getClass().getSimpleName(), - hashCode(), - _parser, - _generator, - _channel); + getClass().getSimpleName(), + hashCode(), + _parser, + _generator, + _channel); } private class Content extends HttpInput.Content @@ -742,10 +742,10 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http _callback = callback; _header = null; _shutdownOut = false; - + if (getConnector().isShutdown()) _generator.setPersistent(false); - + return true; } @@ -780,7 +780,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http { case NEED_INFO: throw new EofException("request lifecycle violation"); - + case NEED_HEADER: { _header = _bufferPool.acquire(Math.min(_config.getResponseHeaderSize(), _config.getOutputBufferSize()), useDirectByteBuffers); @@ -815,7 +815,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http BufferUtil.clear(chunk); BufferUtil.clear(_content); } - + byte gatherWrite = 0; long bytes = 0; if (BufferUtil.hasContent(_header)) @@ -858,9 +858,9 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http getEndPoint().write(this, _content); break; default: - succeeded(); + succeeded(); } - + return Action.SCHEDULED; } case SHUTDOWN_OUT: @@ -869,7 +869,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http continue; } case DONE: - { + { // If this is the end of the response and the connector was shutdown after response was committed, // we can't add the Connection:close header, but we are still allowed to close the connection // by shutting down the output. diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java index e38f968bedb..4d5e142b15b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java @@ -36,8 +36,8 @@ import org.eclipse.jetty.io.RuntimeIOException; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.component.Destroyable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * {@link HttpInput} provides an implementation of {@link ServletInputStream} for {@link HttpChannel}. @@ -121,7 +121,7 @@ public class HttpInput extends ServletInputStream implements Runnable } } - private static final Logger LOG = Log.getLogger(HttpInput.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpInput.class); static final Content EOF_CONTENT = new EofContent("EOF"); static final Content EARLY_EOF_CONTENT = new EofContent("EARLY_EOF"); @@ -660,7 +660,7 @@ public class HttpInput extends ServletInputStream implements Runnable } catch (Throwable e) { - LOG.debug(e); + LOG.debug("Unable to consume all input", e); _state = new ErrorState(e); return false; } @@ -714,7 +714,7 @@ public class HttpInput extends ServletInputStream implements Runnable } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return true; } } @@ -796,7 +796,7 @@ public class HttpInput extends ServletInputStream implements Runnable // without modifying the original failure. Throwable failure = new Throwable(_state.getError()); failure.addSuppressed(x); - LOG.debug(failure); + LOG.debug("HttpInput failure", failure); } } else @@ -887,8 +887,10 @@ public class HttpInput extends ServletInputStream implements Runnable } catch (Throwable e) { - LOG.warn(e.toString()); - LOG.debug(e); + if (LOG.isDebugEnabled()) + LOG.warn("Unable to notify listener", e); + else + LOG.warn("Unable to notify listener: {}", e.toString()); try { if (aeof || error == null) @@ -899,9 +901,12 @@ public class HttpInput extends ServletInputStream implements Runnable } catch (Throwable e2) { - LOG.warn(e2.toString()); - LOG.debug(e2); - throw new RuntimeIOException(e2); + String msg = "Unable to notify error to listener"; + if (LOG.isDebugEnabled()) + LOG.warn(msg, e2); + else + LOG.warn(msg + ": {}", e2.toString()); + throw new RuntimeIOException(msg, e2); } } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java index 9b99a4e3654..cf16784070e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java @@ -43,8 +43,8 @@ import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.IteratingCallback; import org.eclipse.jetty.util.SharedBlockingCallback; import org.eclipse.jetty.util.SharedBlockingCallback.Blocker; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

{@link HttpOutput} implements {@link ServletOutputStream} @@ -174,7 +174,7 @@ public class HttpOutput extends ServletOutputStream implements Runnable } } - private static Logger LOG = Log.getLogger(HttpOutput.class); + private static Logger LOG = LoggerFactory.getLogger(HttpOutput.class); private static final ThreadLocal _encoder = new ThreadLocal<>(); private final HttpChannel _channel; @@ -1269,7 +1269,7 @@ public class HttpOutput extends ServletOutputStream implements Runnable } catch (Throwable x) { - LOG.debug(x); + LOG.debug("Unable to access ReadableByteChannel for content {}", httpContent, x); } if (rbc != null) { @@ -1285,7 +1285,7 @@ public class HttpOutput extends ServletOutputStream implements Runnable } catch (Throwable x) { - LOG.debug(x); + LOG.debug("Unable to access InputStream for content {}", httpContent, x); } if (in != null) { @@ -1452,7 +1452,10 @@ public class HttpOutput extends ServletOutputStream implements Runnable catch (Throwable t) { if (LOG.isDebugEnabled()) - LOG.debug(t); + { + t.addSuppressed(error); + LOG.debug("Failed in call onError on {}", _writeListener, t); + } } finally { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/InclusiveByteRange.java b/jetty-server/src/main/java/org/eclipse/jetty/server/InclusiveByteRange.java index ab2e5e028c3..931538af2d1 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/InclusiveByteRange.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/InclusiveByteRange.java @@ -24,8 +24,8 @@ import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Byte range inclusive of end points. @@ -52,7 +52,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class InclusiveByteRange { - private static final Logger LOG = Log.getLogger(InclusiveByteRange.class); + private static final Logger LOG = LoggerFactory.getLogger(InclusiveByteRange.class); private long first; private long last; @@ -237,14 +237,14 @@ public class InclusiveByteRange catch (NumberFormatException e) { LOG.warn("Bad range format: {}", t); - LOG.ignore(e); + LOG.trace("IGNORED", e); } } } catch (Exception e) { LOG.warn("Bad range format: {}", t); - LOG.ignore(e); + LOG.trace("IGNORED", e); } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java index fe8c0073703..93de8472028 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java @@ -278,7 +278,7 @@ public class LocalConnector extends AbstractConnector } catch (Exception e) { - LOG.warn(e); + LOG.warn("Close wait failed", e); } } } @@ -304,7 +304,7 @@ public class LocalConnector extends AbstractConnector } catch (Exception e) { - LOG.warn(e); + LOG.warn("Close wait failed", e); } } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/LowResourceMonitor.java b/jetty-server/src/main/java/org/eclipse/jetty/server/LowResourceMonitor.java index 84e753c5bda..aea31be30a6 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/LowResourceMonitor.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/LowResourceMonitor.java @@ -32,11 +32,11 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.Name; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.util.thread.ThreadPool; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A monitor for low resources, low resources can be detected by: @@ -51,7 +51,7 @@ import org.eclipse.jetty.util.thread.ThreadPool; @ManagedObject("Monitor for low resource conditions and activate a low resource mode if detected") public class LowResourceMonitor extends ContainerLifeCycle { - private static final Logger LOG = Log.getLogger(LowResourceMonitor.class); + private static final Logger LOG = LoggerFactory.getLogger(LowResourceMonitor.class); protected final Server _server; private Scheduler _scheduler; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartFormInputStream.java b/jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartFormInputStream.java index bc7fe0445b4..12b9555fbad 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartFormInputStream.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartFormInputStream.java @@ -45,8 +45,8 @@ import org.eclipse.jetty.util.MultiException; import org.eclipse.jetty.util.MultiMap; import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * MultiPartInputStream @@ -89,7 +89,7 @@ public class MultiPartFormInputStream DELETED } - private static final Logger LOG = Log.getLogger(MultiPartFormInputStream.class); + private static final Logger LOG = LoggerFactory.getLogger(MultiPartFormInputStream.class); private final MultiMap _parts = new MultiMap<>(); private final InputStream _in; private final MultipartConfigElement _config; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartParser.java b/jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartParser.java index 04b6458d647..ae548530b7c 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartParser.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartParser.java @@ -28,8 +28,8 @@ import org.eclipse.jetty.http.HttpTokens; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.SearchPattern; import org.eclipse.jetty.util.Utf8StringBuilder; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A parser for MultiPart content type. @@ -39,7 +39,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class MultiPartParser { - public static final Logger LOG = Log.getLogger(MultiPartParser.class); + public static final Logger LOG = LoggerFactory.getLogger(MultiPartParser.class); // States public enum FieldState diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnection.java index c94745262b7..41cb9ec42a3 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnection.java @@ -27,12 +27,12 @@ import org.eclipse.jetty.io.AbstractConnection; import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class NegotiatingServerConnection extends AbstractConnection { - private static final Logger LOG = Log.getLogger(NegotiatingServerConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(NegotiatingServerConnection.class); public interface CipherDiscriminator { @@ -153,7 +153,7 @@ public abstract class NegotiatingServerConnection extends AbstractConnection } catch (IOException x) { - LOG.debug(x); + LOG.debug("Unable to fill from endpoint {}", getEndPoint(), x); close(); return -1; } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/OptionalSslConnectionFactory.java b/jetty-server/src/main/java/org/eclipse/jetty/server/OptionalSslConnectionFactory.java index 911afadfe6b..120dccc7854 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/OptionalSslConnectionFactory.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/OptionalSslConnectionFactory.java @@ -23,8 +23,8 @@ import java.nio.charset.StandardCharsets; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A ConnectionFactory whose connections detect whether the first bytes are @@ -36,7 +36,7 @@ import org.eclipse.jetty.util.log.Logger; @Deprecated public class OptionalSslConnectionFactory extends DetectorConnectionFactory { - private static final Logger LOG = Log.getLogger(OptionalSslConnectionFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(OptionalSslConnectionFactory.class); private final String _nextProtocol; /** diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java index cd6030d63e5..ddba526aab3 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java @@ -37,8 +37,8 @@ import org.eclipse.jetty.util.AttributesMap; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

ConnectionFactory for the PROXY Protocol.

@@ -50,7 +50,7 @@ import org.eclipse.jetty.util.log.Logger; public class ProxyConnectionFactory extends DetectorConnectionFactory { public static final String TLS_VERSION = "TLS_VERSION"; - private static final Logger LOG = Log.getLogger(ProxyConnectionFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(ProxyConnectionFactory.class); public ProxyConnectionFactory() { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/PushBuilderImpl.java b/jetty-server/src/main/java/org/eclipse/jetty/server/PushBuilderImpl.java index b87ce48d3fd..78c78ac5508 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/PushBuilderImpl.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/PushBuilderImpl.java @@ -28,15 +28,15 @@ import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.http.HttpURI; import org.eclipse.jetty.http.MetaData; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * */ public class PushBuilderImpl implements PushBuilder { - private static final Logger LOG = Log.getLogger(PushBuilderImpl.class); + private static final Logger LOG = LoggerFactory.getLogger(PushBuilderImpl.class); private static final HttpField JettyPush = new HttpField("x-http2-push", "PushBuilder"); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java index 3837c9b511f..6abada24f58 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java @@ -95,8 +95,8 @@ import org.eclipse.jetty.util.MultiMap; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.UrlEncoded; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Jetty Request. @@ -142,7 +142,7 @@ public class Request implements HttpServletRequest { public static final String __MULTIPART_CONFIG_ELEMENT = "org.eclipse.jetty.multipartConfig"; - private static final Logger LOG = Log.getLogger(Request.class); + private static final Logger LOG = LoggerFactory.getLogger(Request.class); private static final Collection __defaultLocale = Collections.singleton(Locale.getDefault()); private static final int INPUT_NONE = 0; private static final int INPUT_STREAM = 1; @@ -189,7 +189,7 @@ public class Request implements HttpServletRequest return null; } - + public static HttpServletMapping getServletMapping(PathSpec pathSpec, String servletPath, String servletName) { final MappingMatch match; @@ -230,7 +230,7 @@ public class Request implements HttpServletRequest match = null; mapping = servletPath; } - + return new HttpServletMapping() { @Override @@ -262,10 +262,10 @@ public class Request implements HttpServletRequest @Override public String toString() { - return "HttpServletMapping{matchValue=" + getMatchValue() + - ", pattern=" + getPattern() + ", servletName=" + getServletName() + + return "HttpServletMapping{matchValue=" + getMatchValue() + + ", pattern=" + getPattern() + ", servletName=" + getServletName() + ", mappingMatch=" + getMappingMatch() + "}"; - } + } }; } @@ -552,9 +552,9 @@ public class Request implements HttpServletRequest catch (UnsupportedEncodingException e) { if (LOG.isDebugEnabled()) - LOG.warn(e); + LOG.warn("Unable to decode query", e); else - LOG.warn(e.toString()); + LOG.warn("Unable to decode query - {}", e.toString()); } } } @@ -595,8 +595,9 @@ public class Request implements HttpServletRequest } catch (IOException e) { - LOG.debug(e); - throw new RuntimeIOException(e); + String msg = "Unable to extract content parameters"; + LOG.debug(msg, e); + throw new RuntimeIOException(msg, e); } } } @@ -634,8 +635,9 @@ public class Request implements HttpServletRequest } catch (IOException e) { - LOG.debug(e); - throw new RuntimeIOException(e); + String msg = "Unable to extract form parameters"; + LOG.debug(msg, e); + throw new RuntimeIOException(msg, e); } } @@ -1023,7 +1025,7 @@ public class Request implements HttpServletRequest } catch (java.net.UnknownHostException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } @@ -1055,7 +1057,7 @@ public class Request implements HttpServletRequest } catch (java.net.UnknownHostException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } return null; } @@ -1374,7 +1376,7 @@ public class Request implements HttpServletRequest } catch (java.net.UnknownHostException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } return null; } @@ -1790,7 +1792,7 @@ public class Request implements HttpServletRequest } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); _reader = null; } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/RequestLogWriter.java b/jetty-server/src/main/java/org/eclipse/jetty/server/RequestLogWriter.java index da32b803a58..b9c3b9e666d 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/RequestLogWriter.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/RequestLogWriter.java @@ -28,8 +28,8 @@ import org.eclipse.jetty.util.RolloverFileOutputStream; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Writer which outputs pre-formatted request log strings to a file using {@link RolloverFileOutputStream}. @@ -37,7 +37,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Request Log writer which writes to file") public class RequestLogWriter extends AbstractLifeCycle implements RequestLog.Writer { - private static final Logger LOG = Log.getLogger(RequestLogWriter.class); + private static final Logger LOG = LoggerFactory.getLogger(RequestLogWriter.class); private String _filename; private boolean _append; @@ -230,7 +230,7 @@ public class RequestLogWriter extends AbstractLifeCycle implements RequestLog.Wr } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } if (_out != null && _closeOut) try @@ -239,7 +239,7 @@ public class RequestLogWriter extends AbstractLifeCycle implements RequestLog.Wr } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } _out = null; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java index 23d9b68af02..b8ce35ebdb2 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java @@ -54,9 +54,9 @@ import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.MultiPartOutputStream; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.util.Arrays.stream; import static java.util.Collections.emptyList; @@ -67,7 +67,7 @@ import static org.eclipse.jetty.http.HttpHeaderValue.IDENTITY; */ public class ResourceService { - private static final Logger LOG = Log.getLogger(ResourceService.class); + private static final Logger LOG = LoggerFactory.getLogger(ResourceService.class); private static final PreEncodedHttpField ACCEPT_RANGES = new PreEncodedHttpField(HttpHeader.ACCEPT_RANGES, "bytes"); @@ -297,7 +297,7 @@ public class ResourceService } catch (IllegalArgumentException e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("Failed to serve resource: {}", pathInContext, e); if (!response.isCommitted()) response.sendError(500, e.getMessage()); } @@ -705,10 +705,11 @@ public class ResourceService @Override public void failed(Throwable x) { + String msg = "Failed to send content"; if (x instanceof IOException) - LOG.debug(x); + LOG.debug(msg, x); else - LOG.warn(x); + LOG.warn(msg, x); context.complete(); content.release(); } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java index 21ebfb9bc83..cc5d1e26a6c 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java @@ -62,15 +62,15 @@ import org.eclipse.jetty.util.AtomicBiInteger; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

{@link Response} provides the implementation for {@link HttpServletResponse}.

*/ public class Response implements HttpServletResponse { - private static final Logger LOG = Log.getLogger(Response.class); + private static final Logger LOG = LoggerFactory.getLogger(Response.class); private static final int __MIN_BUFFER_SIZE = 1; private static final HttpField __EXPIRES_01JAN1970 = new PreEncodedHttpField(HttpHeader.EXPIRES, DateGenerator.__01Jan1970); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ResponseWriter.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ResponseWriter.java index cc8291587be..58787784d82 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ResponseWriter.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ResponseWriter.java @@ -28,8 +28,8 @@ import javax.servlet.ServletResponse; import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.io.RuntimeIOException; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Specialized PrintWriter for servlet Responses @@ -43,7 +43,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class ResponseWriter extends PrintWriter { - private static final Logger LOG = Log.getLogger(ResponseWriter.class); + private static final Logger LOG = LoggerFactory.getLogger(ResponseWriter.class); private static final String __lineSeparator = System.getProperty("line.separator"); private static final String __trueln = "true" + __lineSeparator; private static final String __falseln = "false" + __lineSeparator; @@ -114,7 +114,7 @@ public class ResponseWriter extends PrintWriter } if (LOG.isDebugEnabled()) - LOG.debug(th); + LOG.debug("PrintWriter Error is set", th); } @Override @@ -194,7 +194,7 @@ public class ResponseWriter extends PrintWriter } catch (InterruptedIOException ex) { - LOG.debug(ex); + LOG.debug("Write interrupted", ex); Thread.currentThread().interrupt(); } catch (IOException ex) @@ -216,7 +216,7 @@ public class ResponseWriter extends PrintWriter } catch (InterruptedIOException ex) { - LOG.debug(ex); + LOG.debug("Write interrupted", ex); Thread.currentThread().interrupt(); } catch (IOException ex) @@ -244,7 +244,7 @@ public class ResponseWriter extends PrintWriter } catch (InterruptedIOException ex) { - LOG.debug(ex); + LOG.debug("Write interrupted", ex); Thread.currentThread().interrupt(); } catch (IOException ex) @@ -328,7 +328,7 @@ public class ResponseWriter extends PrintWriter } catch (InterruptedIOException ex) { - LOG.debug(ex); + LOG.debug("write interrupted", ex); Thread.currentThread().interrupt(); } catch (IOException ex) @@ -356,7 +356,7 @@ public class ResponseWriter extends PrintWriter } catch (InterruptedIOException ex) { - LOG.debug(ex); + LOG.debug("Write interrupted", ex); Thread.currentThread().interrupt(); } catch (IOException ex) @@ -403,7 +403,7 @@ public class ResponseWriter extends PrintWriter } catch (InterruptedIOException ex) { - LOG.debug(ex); + LOG.debug("Write interrupted", ex); Thread.currentThread().interrupt(); } catch (IOException ex) @@ -429,7 +429,7 @@ public class ResponseWriter extends PrintWriter } catch (InterruptedIOException ex) { - LOG.debug(ex); + LOG.debug("Write interrupted", ex); Thread.currentThread().interrupt(); } catch (IOException ex) @@ -491,7 +491,7 @@ public class ResponseWriter extends PrintWriter } catch (InterruptedIOException ex) { - LOG.debug(ex); + LOG.debug("format interrupted", ex); Thread.currentThread().interrupt(); } catch (IOException ex) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/SameFileAliasChecker.java b/jetty-server/src/main/java/org/eclipse/jetty/server/SameFileAliasChecker.java index f64a4bf5b22..c56a403598b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/SameFileAliasChecker.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/SameFileAliasChecker.java @@ -23,10 +23,10 @@ import java.nio.file.Files; import java.nio.file.Path; import org.eclipse.jetty.server.handler.ContextHandler.AliasCheck; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.PathResource; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Alias checking for working with FileSystems that normalize access to the @@ -47,7 +47,7 @@ import org.eclipse.jetty.util.resource.Resource; */ public class SameFileAliasChecker implements AliasCheck { - private static final Logger LOG = Log.getLogger(SameFileAliasChecker.class); + private static final Logger LOG = LoggerFactory.getLogger(SameFileAliasChecker.class); @Override public boolean check(String uri, Resource resource) @@ -71,7 +71,7 @@ public class SameFileAliasChecker implements AliasCheck } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } return false; } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/SecureRequestCustomizer.java b/jetty-server/src/main/java/org/eclipse/jetty/server/SecureRequestCustomizer.java index c48c28d31b6..2649849d554 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/SecureRequestCustomizer.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/SecureRequestCustomizer.java @@ -35,11 +35,11 @@ import org.eclipse.jetty.io.ssl.SslConnection; import org.eclipse.jetty.io.ssl.SslConnection.DecryptedEndPoint; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.annotation.Name; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SniX509ExtendedKeyManager; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.ssl.X509; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Customizer that extracts the attribute from an {@link SSLContext} @@ -48,7 +48,7 @@ import org.eclipse.jetty.util.ssl.X509; */ public class SecureRequestCustomizer implements HttpConfiguration.Customizer { - private static final Logger LOG = Log.getLogger(SecureRequestCustomizer.class); + private static final Logger LOG = LoggerFactory.getLogger(SecureRequestCustomizer.class); /** * The name of the SSLSession attribute that will contain any cached information. @@ -298,7 +298,7 @@ public class SecureRequestCustomizer implements HttpConfiguration.Customizer } catch (Exception e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("Unable to customize request with encryption details", e); } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java index 431fe297598..d9ade6e27d4 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java @@ -55,12 +55,12 @@ import org.eclipse.jetty.util.annotation.Name; import org.eclipse.jetty.util.component.AttributeContainerMap; import org.eclipse.jetty.util.component.Graceful; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.AutoLock; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.ShutdownThread; import org.eclipse.jetty.util.thread.ThreadPool; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Jetty HTTP Servlet Server. @@ -72,7 +72,7 @@ import org.eclipse.jetty.util.thread.ThreadPool; @ManagedObject(value = "Jetty HTTP Servlet server") public class Server extends HandlerWrapper implements Attributes { - private static final Logger LOG = Log.getLogger(Server.class); + private static final Logger LOG = LoggerFactory.getLogger(Server.class); private final AttributeContainerMap _attributes = new AttributeContainerMap(); private final ThreadPool _threadPool; @@ -682,7 +682,7 @@ public class Server extends HandlerWrapper implements Attributes } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to build server URI", e); return null; } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java index 683ed96ec5b..5baaa6988ff 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java @@ -367,7 +367,7 @@ public class ServerConnector extends AbstractNetworkConnector } catch (IOException e) { - LOG.warn(e); + LOG.warn("Unable to close {}", serverChannel, e); } } } @@ -401,7 +401,7 @@ public class ServerConnector extends AbstractNetworkConnector } catch (SocketException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandler.java index f04b6630cba..7b4e440be18 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandler.java @@ -34,8 +34,8 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AbstractHandler. @@ -51,7 +51,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Jetty Handler") public abstract class AbstractHandler extends ContainerLifeCycle implements Handler { - private static final Logger LOG = Log.getLogger(AbstractHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractHandler.class); private Server _server; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandlerContainer.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandlerContainer.java index 6e7f126f39f..474f6107240 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandlerContainer.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandlerContainer.java @@ -25,8 +25,8 @@ import java.util.List; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.HandlerContainer; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Abstract Handler Container. @@ -34,7 +34,7 @@ import org.eclipse.jetty.util.log.Logger; */ public abstract class AbstractHandlerContainer extends AbstractHandler implements HandlerContainer { - private static final Logger LOG = Log.getLogger(AbstractHandlerContainer.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractHandlerContainer.class); public AbstractHandlerContainer() { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AllowSymLinkAliasChecker.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AllowSymLinkAliasChecker.java index 54cf6e2b7b2..6ed9fc44835 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AllowSymLinkAliasChecker.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AllowSymLinkAliasChecker.java @@ -22,10 +22,10 @@ import java.nio.file.Files; import java.nio.file.Path; import org.eclipse.jetty.server.handler.ContextHandler.AliasCheck; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.PathResource; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Symbolic Link AliasChecker. @@ -36,7 +36,7 @@ import org.eclipse.jetty.util.resource.Resource; */ public class AllowSymLinkAliasChecker implements AliasCheck { - private static final Logger LOG = Log.getLogger(AllowSymLinkAliasChecker.class); + private static final Logger LOG = LoggerFactory.getLogger(AllowSymLinkAliasChecker.class); @Override public boolean check(String uri, Resource resource) @@ -64,7 +64,7 @@ public class AllowSymLinkAliasChecker implements AliasCheck } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } return false; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/BufferedResponseHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/BufferedResponseHandler.java index 400d4f6b819..c7b839ee995 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/BufferedResponseHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/BufferedResponseHandler.java @@ -41,8 +41,8 @@ import org.eclipse.jetty.util.IncludeExclude; import org.eclipse.jetty.util.IteratingCallback; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Buffered Response Handler @@ -63,7 +63,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class BufferedResponseHandler extends HandlerWrapper { - static final Logger LOG = Log.getLogger(BufferedResponseHandler.class); + static final Logger LOG = LoggerFactory.getLogger(BufferedResponseHandler.class); private final IncludeExclude _methods = new IncludeExclude<>(); private final IncludeExclude _paths = new IncludeExclude<>(PathSpecSet.class); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java index 93b199cfc42..ef33e3d66b8 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java @@ -85,9 +85,8 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.DumpableCollection; import org.eclipse.jetty.util.component.Graceful; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** @@ -129,7 +128,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu private static final String UNIMPLEMENTED_USE_SERVLET_CONTEXT_HANDLER = "Unimplemented {} - use org.eclipse.jetty.servlet.ServletContextHandler"; - private static final Logger LOG = Log.getLogger(ContextHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ContextHandler.class); private static final ThreadLocal __context = new ThreadLocal<>(); @@ -191,7 +190,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu private String[] _vhosts; // Host name portion, matching _vconnectors array private boolean[] _vhostswildcard; private String[] _vconnectors; // connector portion, matching _vhosts array - private org.slf4j.Logger _logger; + private Logger _logger; private boolean _allowNullPathInfo; private int _maxFormKeys = Integer.getInteger(MAX_FORM_KEYS_KEY, DEFAULT_MAX_FORM_KEYS); private int _maxFormContentSize = Integer.getInteger(MAX_FORM_CONTENT_SIZE_KEY, DEFAULT_MAX_FORM_CONTENT_SIZE); @@ -521,9 +520,10 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu StringBuilder classpath = new StringBuilder(); for (int i = 0; i < urls.length; i++) { + URL url = urls[i]; try { - Resource resource = newResource(urls[i]); + Resource resource = newResource(url); File file = resource.getFile(); if (file != null && file.exists()) { @@ -534,7 +534,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } catch (IOException e) { - LOG.debug(e); + LOG.debug("Could not found resource: {}", url, e); } } if (classpath.length() == 0) @@ -735,12 +735,12 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } } - public org.slf4j.Logger getLogger() + public Logger getLogger() { return _logger; } - public void setLogger(org.slf4j.Logger logger) + public void setLogger(Logger logger) { _logger = logger; } @@ -944,7 +944,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } catch (Throwable e) { - LOG.warn(e); + LOG.warn("Unable to exit scope", e); } } } @@ -1259,7 +1259,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } catch (Throwable e) { - LOG.warn(e); + LOG.warn("Unable to enter scope", e); } } } @@ -1280,7 +1280,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } catch (Throwable e) { - LOG.warn(e); + LOG.warn("Unable to exit scope", e); } } } @@ -1578,7 +1578,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu catch (Exception e) { LOG.warn(e.toString()); - LOG.debug(e); + LOG.debug("Unable to set baseResource: {}", resourceBase, e); throw new IllegalArgumentException(resourceBase); } } @@ -1791,7 +1791,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } return null; @@ -1888,7 +1888,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } return Collections.emptySet(); } @@ -2090,7 +2090,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } return null; } @@ -2117,7 +2117,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } return null; @@ -2148,7 +2148,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return null; } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java index 340016f7d3d..a7e72064c5d 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java @@ -38,9 +38,9 @@ import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.Trie; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.SerializedExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This {@link org.eclipse.jetty.server.handler.HandlerCollection} is creates a @@ -53,7 +53,7 @@ import org.eclipse.jetty.util.thread.SerializedExecutor; @ManagedObject("Context Handler Collection") public class ContextHandlerCollection extends HandlerCollection { - private static final Logger LOG = Log.getLogger(ContextHandlerCollection.class); + private static final Logger LOG = LoggerFactory.getLogger(ContextHandlerCollection.class); private final SerializedExecutor _serializedExecutor = new SerializedExecutor(); public ContextHandlerCollection() diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java index 839f25faa62..67c7c1b3efb 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java @@ -36,9 +36,9 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.nio.charset.StandardCharsets.UTF_8; @@ -52,7 +52,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; */ public class DefaultHandler extends AbstractHandler { - private static final Logger LOG = Log.getLogger(DefaultHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(DefaultHandler.class); final long _faviconModified = (System.currentTimeMillis() / 1000) * 1000L; final byte[] _favicon; @@ -61,10 +61,11 @@ public class DefaultHandler extends AbstractHandler public DefaultHandler() { + String faviconRef = "/org/eclipse/jetty/favicon.ico"; byte[] favbytes = null; try { - URL fav = getClass().getResource("/org/eclipse/jetty/favicon.ico"); + URL fav = getClass().getResource(faviconRef); if (fav != null) { Resource r = Resource.newResource(fav); @@ -73,7 +74,7 @@ public class DefaultHandler extends AbstractHandler } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to find default favicon: {}", faviconRef, e); } finally { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java index 24d131e506e..3cf51e905ea 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java @@ -48,8 +48,8 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Handler for Error pages @@ -61,7 +61,7 @@ import org.eclipse.jetty.util.log.Logger; public class ErrorHandler extends AbstractHandler { // TODO This classes API needs to be majorly refactored/cleanup in jetty-10 - private static final Logger LOG = Log.getLogger(ErrorHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ErrorHandler.class); public static final String ERROR_PAGE = "org.eclipse.jetty.server.error_page"; public static final String ERROR_CONTEXT = "org.eclipse.jetty.server.error_context"; @@ -113,7 +113,7 @@ public class ErrorHandler extends AbstractHandler } catch (ServletException e) { - LOG.debug(e); + LOG.debug("Unable to call error dispatcher", e); if (response.isCommitted()) return; } @@ -206,7 +206,7 @@ public class ErrorHandler extends AbstractHandler } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } return null; @@ -254,7 +254,7 @@ public class ErrorHandler extends AbstractHandler } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } if (charset == null) @@ -327,9 +327,10 @@ public class ErrorHandler extends AbstractHandler } catch (BufferOverflowException e) { - LOG.warn("Error page too large: {} {} {}", code, message, request); if (LOG.isDebugEnabled()) - LOG.warn(e); + LOG.warn("Error page too large: {} {} {}", code, message, request, e); + else + LOG.warn("Error page too large: {} {} {}", code, message, request); baseRequest.getResponse().resetContent(); if (!_disableStacks) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/InetAccessHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/InetAccessHandler.java index 07d6b2fb347..e35b6bce96d 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/InetAccessHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/InetAccessHandler.java @@ -34,8 +34,8 @@ import org.eclipse.jetty.util.IncludeExcludeSet; import org.eclipse.jetty.util.InetAddressPattern; import org.eclipse.jetty.util.InetAddressSet; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.eclipse.jetty.server.handler.InetAccessSet.AccessTuple; import static org.eclipse.jetty.server.handler.InetAccessSet.PatternTuple; @@ -51,7 +51,7 @@ import static org.eclipse.jetty.server.handler.InetAccessSet.PatternTuple; */ public class InetAccessHandler extends HandlerWrapper { - private static final Logger LOG = Log.getLogger(InetAccessHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(InetAccessHandler.class); private final IncludeExcludeSet _set = new IncludeExcludeSet<>(InetAccessSet.class); @@ -97,11 +97,14 @@ public class InetAccessHandler extends HandlerWrapper public void include(String... patterns) { for (String pattern : patterns) + { include(pattern); + } } /** * Includes an InetAccess entry. + * * @param connectorName optional name of a connector to include. * @param addressPattern optional InetAddress pattern to include. * @param pathSpec optional pathSpec to include. @@ -144,11 +147,14 @@ public class InetAccessHandler extends HandlerWrapper public void exclude(String... patterns) { for (String pattern : patterns) + { exclude(pattern); + } } /** * Excludes an InetAccess entry. + * * @param connectorName optional name of a connector to exclude. * @param addressPattern optional InetAddress pattern to exclude. * @param pathSpec optional pathSpec to exclude. @@ -204,7 +210,9 @@ public class InetAccessHandler extends HandlerWrapper public void excludeConnectors(String... names) { for (String name : names) + { excludeConnector(name); + } } /** diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ManagedAttributeListener.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ManagedAttributeListener.java index 88e67a268e4..e7450c9afb7 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ManagedAttributeListener.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ManagedAttributeListener.java @@ -26,15 +26,15 @@ import javax.servlet.ServletContextAttributeListener; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Enable Jetty style JMX MBeans from within a Context */ public class ManagedAttributeListener implements ServletContextListener, ServletContextAttributeListener { - private static final Logger LOG = Log.getLogger(ManagedAttributeListener.class); + private static final Logger LOG = LoggerFactory.getLogger(ManagedAttributeListener.class); final Set _managedAttributes = new HashSet<>(); final ContextHandler _context; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java index 6d99bc10479..b3412f56f11 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java @@ -37,10 +37,10 @@ import org.eclipse.jetty.server.ResourceService; import org.eclipse.jetty.server.ResourceService.WelcomeFactory; import org.eclipse.jetty.server.handler.ContextHandler.Context; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.ResourceFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Resource Handler. @@ -50,7 +50,7 @@ import org.eclipse.jetty.util.resource.ResourceFactory; */ public class ResourceHandler extends HandlerWrapper implements ResourceFactory, WelcomeFactory { - private static final Logger LOG = Log.getLogger(ResourceHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ResourceHandler.class); Resource _baseResource; ContextHandler _context; @@ -174,7 +174,7 @@ public class ResourceHandler extends HandlerWrapper implements ResourceFactory, } catch (Exception e) { - LOG.debug(e); + LOG.debug("Unable to get Resource for {}", path, e); } return null; @@ -394,8 +394,7 @@ public class ResourceHandler extends HandlerWrapper implements ResourceFactory, } catch (Exception e) { - LOG.warn(e.toString()); - LOG.debug(e); + LOG.warn("Invalid Base Resource reference: {}", resourceBase, e); throw new IllegalArgumentException(resourceBase); } } @@ -416,8 +415,7 @@ public class ResourceHandler extends HandlerWrapper implements ResourceFactory, } catch (Exception e) { - LOG.warn(e.toString()); - LOG.debug(e); + LOG.warn("Invalid StyleSheet reference: {}", stylesheet, e); throw new IllegalArgumentException(stylesheet); } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java index 939c6c2d538..17201afb8d1 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java @@ -31,8 +31,8 @@ import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.NetworkConnector; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A handler that shuts the server down on a valid request. Used to do "soft" restarts from Java. @@ -74,7 +74,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class ShutdownHandler extends HandlerWrapper { - private static final Logger LOG = Log.getLogger(ShutdownHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ShutdownHandler.class); private final String _shutdownToken; private boolean _sendShutdownAtStart; @@ -206,7 +206,7 @@ public class ShutdownHandler extends HandlerWrapper } catch (InterruptedException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } catch (Exception e) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java index 9c85d0054df..dac8a1d49dc 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java @@ -39,15 +39,15 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; import org.eclipse.jetty.util.component.Graceful; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.statistic.CounterStatistic; import org.eclipse.jetty.util.statistic.SampleStatistic; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ManagedObject("Request Statistics Gathering") public class StatisticsHandler extends HandlerWrapper implements Graceful { - private static final Logger LOG = Log.getLogger(StatisticsHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(StatisticsHandler.class); private final AtomicLong _statsStartedAt = new AtomicLong(); private volatile Shutdown _shutdown; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ThreadLimitHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ThreadLimitHandler.java index 588438d029e..5fbf5105d59 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ThreadLimitHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ThreadLimitHandler.java @@ -46,9 +46,9 @@ import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedOperation; import org.eclipse.jetty.util.annotation.Name; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.AutoLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Handler to limit the threads per IP address for DOS protection

@@ -72,7 +72,7 @@ import org.eclipse.jetty.util.thread.AutoLock; */ public class ThreadLimitHandler extends HandlerWrapper { - private static final Logger LOG = Log.getLogger(ThreadLimitHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ThreadLimitHandler.class); private static final String REMOTE = "o.e.j.s.h.TLH.REMOTE"; private static final String PERMIT = "o.e.j.s.h.TLH.PASS"; @@ -140,7 +140,7 @@ public class ThreadLimitHandler extends HandlerWrapper } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } return _threadLimit; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java index baa9008fa3d..59da37ce07e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java @@ -48,8 +48,8 @@ import org.eclipse.jetty.util.RegexSet; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.compression.DeflaterPool; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A Handler that can dynamically GZIP uncompress requests, and compress responses. @@ -155,7 +155,7 @@ public class GzipHandler extends HandlerWrapper implements GzipFactory public static final String DEFLATE = "deflate"; public static final int DEFAULT_MIN_GZIP_SIZE = 32; public static final int BREAK_EVEN_GZIP_SIZE = 23; - private static final Logger LOG = Log.getLogger(GzipHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(GzipHandler.class); private static final HttpField X_CE_GZIP = new PreEncodedHttpField("X-Content-Encoding", "gzip"); private static final HttpField TE_CHUNKED = new PreEncodedHttpField(HttpHeader.TRANSFER_ENCODING, HttpHeaderValue.CHUNKED.asString()); private static final Pattern COMMA_GZIP = Pattern.compile(".*, *gzip"); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java index 0b6d4abe61a..3ec13e3a46b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java @@ -36,14 +36,14 @@ import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IteratingNestedCallback; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.eclipse.jetty.http.CompressedContentFormat.GZIP; public class GzipHttpOutputInterceptor implements HttpOutput.Interceptor { - public static Logger LOG = Log.getLogger(GzipHttpOutputInterceptor.class); + public static Logger LOG = LoggerFactory.getLogger(GzipHttpOutputInterceptor.class); private static final byte[] GZIP_HEADER = new byte[]{(byte)0x1f, (byte)0x8b, Deflater.DEFLATED, 0, 0, 0, 0, 0, 0, 0}; public static final HttpField VARY_ACCEPT_ENCODING_USER_AGENT = new PreEncodedHttpField(HttpHeader.VARY, HttpHeader.ACCEPT_ENCODING + ", " + HttpHeader.USER_AGENT); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/jmx/AbstractHandlerMBean.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/jmx/AbstractHandlerMBean.java index 766944974cf..bcbd95d7d0c 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/jmx/AbstractHandlerMBean.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/jmx/AbstractHandlerMBean.java @@ -25,12 +25,12 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.AbstractHandlerContainer; import org.eclipse.jetty.server.handler.ContextHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class AbstractHandlerMBean extends ObjectMBean { - private static final Logger LOG = Log.getLogger(AbstractHandlerMBean.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractHandlerMBean.class); public AbstractHandlerMBean(Object managedObject) { @@ -93,7 +93,7 @@ public class AbstractHandlerMBean extends ObjectMBean } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); name = context.getBaseResource().getName(); } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/resource/HttpContentRangeWriter.java b/jetty-server/src/main/java/org/eclipse/jetty/server/resource/HttpContentRangeWriter.java index 2ffeb9a8d37..d47247a0a66 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/resource/HttpContentRangeWriter.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/resource/HttpContentRangeWriter.java @@ -25,15 +25,15 @@ import java.nio.channels.SeekableByteChannel; import java.util.Objects; import org.eclipse.jetty.http.HttpContent; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Range Writer selection for HttpContent */ public class HttpContentRangeWriter { - private static final Logger LOG = Log.getLogger(HttpContentRangeWriter.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpContentRangeWriter.class); /** * Obtain a new RangeWriter for the supplied HttpContent. diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java index db995aefdff..a50daf4e2d8 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionCache.java @@ -29,9 +29,9 @@ import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.AutoLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AbstractSessionCache @@ -55,7 +55,7 @@ import org.eclipse.jetty.util.thread.AutoLock; @ManagedObject public abstract class AbstractSessionCache extends ContainerLifeCycle implements SessionCache { - static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(AbstractSessionCache.class); /** * The authoritative source of session data @@ -732,8 +732,7 @@ public abstract class AbstractSessionCache extends ContainerLifeCycle implements } catch (Exception e) { - LOG.warn("Passivation of idle session {} failed", session.getId()); - LOG.warn(e); + LOG.warn("Passivation of idle session {} failed", session.getId(), e); } } } @@ -824,8 +823,7 @@ public abstract class AbstractSessionCache extends ContainerLifeCycle implements } catch (Exception e) { - LOG.warn("Save of new session {} failed", id); - LOG.warn(e); + LOG.warn("Save of new session {} failed", id, e); } return session; } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java index bec6804ae1d..cf066e2a7d2 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionDataStore.java @@ -25,8 +25,8 @@ import java.util.concurrent.atomic.AtomicReference; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AbstractSessionDataStore @@ -34,7 +34,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject public abstract class AbstractSessionDataStore extends ContainerLifeCycle implements SessionDataStore { - static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(AbstractSessionDataStore.class); protected SessionContext _context; //context associated with this session data store protected int _gracePeriodSec = 60 * 60; //default of 1hr diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java index 68a235047b6..b6c10595b4b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/CachingSessionDataStore.java @@ -21,8 +21,8 @@ package org.eclipse.jetty.server.session; import java.util.Set; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * CachingSessionDataStore @@ -44,7 +44,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class CachingSessionDataStore extends ContainerLifeCycle implements SessionDataStore { - private static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(CachingSessionDataStore.class); /** * The actual store for the session data */ @@ -95,7 +95,7 @@ public class CachingSessionDataStore extends ContainerLifeCycle implements Sessi } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to load id {}", id, e); } if (d != null) @@ -168,7 +168,7 @@ public class CachingSessionDataStore extends ContainerLifeCycle implements Sessi } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable test exists on {}", id, e); } //then the delegate store diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/DatabaseAdaptor.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/DatabaseAdaptor.java index a0d68c2dc05..1a587bf31fd 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/DatabaseAdaptor.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/DatabaseAdaptor.java @@ -33,8 +33,8 @@ import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * DatabaseAdaptor @@ -47,7 +47,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class DatabaseAdaptor { - static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + static final Logger LOG = LoggerFactory.getLogger(DatabaseAdaptor.class); String _dbName; boolean _isLower; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionCache.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionCache.java index d848298f25c..aebc561d1ae 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionCache.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionCache.java @@ -25,9 +25,9 @@ import javax.servlet.http.HttpServletRequest; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.statistic.CounterStatistic; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * DefaultSessionCache @@ -37,7 +37,7 @@ import org.eclipse.jetty.util.statistic.CounterStatistic; @ManagedObject public class DefaultSessionCache extends AbstractSessionCache { - private static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(DefaultSessionCache.class); /** * The cache of sessions in a hashmap @@ -148,7 +148,7 @@ public class DefaultSessionCache extends AbstractSessionCache } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to store {}", session, e); } doDelete(session.getId()); //remove from memory session.setResident(false); @@ -162,7 +162,7 @@ public class DefaultSessionCache extends AbstractSessionCache } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionIdManager.java index 1a4dffee910..b59836fc5f1 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionIdManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/DefaultSessionIdManager.java @@ -32,8 +32,8 @@ import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * DefaultSessionIdManager @@ -50,7 +50,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject public class DefaultSessionIdManager extends ContainerLifeCycle implements SessionIdManager { - private static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(DefaultSessionIdManager.class); public static final String __NEW_SESSION_ID = "org.eclipse.jetty.server.newSessionId"; @@ -303,8 +303,7 @@ public class DefaultSessionIdManager extends ContainerLifeCycle implements Sessi } catch (Exception e) { - LOG.warn("Problem checking if id {} is in use", id); - LOG.warn(e); + LOG.warn("Problem checking if id {} is in use", id, e); return false; } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionDataStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionDataStore.java index 638ab27df7f..ee2201af200 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionDataStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/FileSessionDataStore.java @@ -41,8 +41,8 @@ import org.eclipse.jetty.util.MultiException; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * FileSessionDataStore @@ -52,7 +52,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject public class FileSessionDataStore extends AbstractSessionDataStore { - private static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(FileSessionDataStore.class); protected File _storeDir; protected boolean _deleteUnrestorableFiles = false; protected Map _sessionFileMap = new ConcurrentHashMap<>(); @@ -166,7 +166,7 @@ public class FileSessionDataStore extends AbstractSessionDataStore } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to get expired for {}", filename, e); } } @@ -220,13 +220,13 @@ public class FileSessionDataStore extends AbstractSessionDataStore } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to sweep file {}", p, e); } }); } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to walk path {}", _storeDir, e); } } @@ -258,8 +258,7 @@ public class FileSessionDataStore extends AbstractSessionDataStore } catch (NumberFormatException e) { - LOG.warn("Not valid session filename {}", p.getFileName()); - LOG.warn(e); + LOG.warn("Not valid session filename {}", p.getFileName(), e); } } @@ -300,8 +299,7 @@ public class FileSessionDataStore extends AbstractSessionDataStore } catch (Exception x) { - LOG.warn("Unable to delete unrestorable file {} for session {}", filename, id); - LOG.warn(x); + LOG.warn("Unable to delete unrestorable file {} for session {}", filename, id, x); } } throw e; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HouseKeeper.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HouseKeeper.java index 7dbf640c939..3179e7771f5 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HouseKeeper.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HouseKeeper.java @@ -24,10 +24,10 @@ import org.eclipse.jetty.server.SessionIdManager; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * HouseKeeper @@ -37,7 +37,7 @@ import org.eclipse.jetty.util.thread.Scheduler; @ManagedObject public class HouseKeeper extends AbstractLifeCycle { - private static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(HouseKeeper.class); public static final long DEFAULT_PERIOD_MS = 1000L * 60 * 10; protected SessionIdManager _sessionIdManager; @@ -252,7 +252,7 @@ public class HouseKeeper extends AbstractLifeCycle } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to scavenge", e); } } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionDataStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionDataStore.java index 7c61d2cb982..248eec4402a 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionDataStore.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionDataStore.java @@ -35,8 +35,8 @@ import org.eclipse.jetty.util.ClassLoadingObjectInputStream; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * JDBCSessionDataStore @@ -46,7 +46,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject public class JDBCSessionDataStore extends AbstractSessionDataStore { - static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(JDBCSessionDataStore.class); /** * Used for Oracle and other databases where "" is treated as NULL @@ -865,8 +865,7 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore } catch (Exception e) { - LOG.warn("{} Problem checking if potentially expired session {} exists in db", _context.getWorkerName(), k); - LOG.warn(e); + LOG.warn("{} Problem checking if potentially expired session {} exists in db", _context.getWorkerName(), k, e); } } } @@ -876,7 +875,7 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to get expired sessions", e); return expiredSessionKeys; //return whatever we got } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionCache.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionCache.java index 9fff4f4d9f9..437e469d61f 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionCache.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionCache.java @@ -21,6 +21,9 @@ package org.eclipse.jetty.server.session; import java.util.function.Function; import javax.servlet.http.HttpServletRequest; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * NullSessionCache * @@ -31,6 +34,8 @@ import javax.servlet.http.HttpServletRequest; */ public class NullSessionCache extends AbstractSessionCache { + private static final Logger LOG = LoggerFactory.getLogger(NullSessionCache.class); + /** * @param handler The SessionHandler related to this SessionCache */ diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionCacheFactory.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionCacheFactory.java index 4f3997b8fe5..fdf31c7fe1f 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionCacheFactory.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/NullSessionCacheFactory.java @@ -18,8 +18,8 @@ package org.eclipse.jetty.server.session; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * NullSessionCacheFactory @@ -28,7 +28,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class NullSessionCacheFactory extends AbstractSessionCacheFactory { - private static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(NullSessionCacheFactory.class); @Override public int getEvictionPolicy() diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/Session.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/Session.java index 0bf1d322369..2ab519ca2b7 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/Session.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/Session.java @@ -34,9 +34,9 @@ import javax.servlet.http.HttpSessionContext; import javax.servlet.http.HttpSessionEvent; import org.eclipse.jetty.io.CyclicTimeout; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.AutoLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Session @@ -55,7 +55,7 @@ import org.eclipse.jetty.util.thread.AutoLock; */ public class Session implements SessionHandler.SessionIf { - private static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(Session.class); /** * @@ -884,7 +884,7 @@ public class Session implements SessionHandler.SessionIf } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to invalidate Session {}", this, e); } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionData.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionData.java index 12253bc8fb6..63c5af54d5b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionData.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionData.java @@ -28,8 +28,8 @@ import java.util.concurrent.ConcurrentHashMap; import org.eclipse.jetty.util.ClassLoadingObjectInputStream; import org.eclipse.jetty.util.ClassVisibilityChecker; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * SessionData @@ -41,7 +41,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class SessionData implements Serializable { - private static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(SessionData.class); private static final long serialVersionUID = 1L; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java index 4477530055c..a3d624e5163 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java @@ -26,9 +26,11 @@ import java.util.Enumeration; import java.util.EventListener; import java.util.HashSet; import java.util.List; +import java.util.Objects; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.stream.Collectors; import javax.servlet.DispatcherType; import javax.servlet.ServletException; import javax.servlet.SessionCookieConfig; @@ -55,13 +57,13 @@ import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.statistic.CounterStatistic; import org.eclipse.jetty.util.statistic.SampleStatistic; import org.eclipse.jetty.util.thread.AutoLock; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.lang.Math.round; @@ -71,7 +73,7 @@ import static java.lang.Math.round; @ManagedObject public class SessionHandler extends ScopedHandler { - static final Logger LOG = Log.getLogger("org.eclipse.jetty.server.session"); + private static final Logger LOG = LoggerFactory.getLogger(SessionHandler.class); public static final EnumSet DEFAULT_TRACKING = EnumSet.of(SessionTrackingMode.COOKIE, SessionTrackingMode.URL); @@ -128,12 +130,12 @@ public class SessionHandler extends ScopedHandler @SuppressWarnings("unchecked") public static final Class[] SESSION_LISTENER_TYPES = new Class[] - { - HttpSessionAttributeListener.class, - HttpSessionIdListener.class, - HttpSessionListener.class - }; - + { + HttpSessionAttributeListener.class, + HttpSessionIdListener.class, + HttpSessionListener.class + }; + @Deprecated(since = "Servlet API 2.1") static final HttpSessionContext __nullSessionContext = new HttpSessionContext() { @@ -152,7 +154,7 @@ public class SessionHandler extends ScopedHandler return Collections.enumeration(Collections.EMPTY_LIST); } }; - + /** * Setting of max inactive interval for new sessions * -1 means no timeout @@ -215,7 +217,7 @@ public class SessionHandler extends ScopedHandler /** * Called by the {@link SessionHandler} when a session is first accessed by a request. - * + * * Updates the last access time for the session and generates a fresh cookie if necessary. * * @param session the session object @@ -236,7 +238,7 @@ public class SessionHandler extends ScopedHandler if (isUsingCookies() && (s.isIdChanged() || (getSessionCookieConfig().getMaxAge() > 0 && getRefreshCookieAge() > 0 && - ((now - s.getCookieSetTime()) / 1000 > getRefreshCookieAge())))) + ((now - s.getCookieSetTime()) / 1000 > getRefreshCookieAge())))) { HttpCookie cookie = getSessionCookie(session, _context == null ? "/" : (_context.getContextPath()), secure); s.cookieSet(); @@ -360,10 +362,10 @@ public class SessionHandler extends ScopedHandler } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to release Session {}", s, e); } } - + /** * Called when a response is about to be committed. * We might take this opportunity to persist the session @@ -382,7 +384,7 @@ public class SessionHandler extends ScopedHandler } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to commit Session {}", s, e); } } @@ -758,7 +760,7 @@ public class SessionHandler extends ScopedHandler } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to add Session {}", id, e); return null; } } @@ -791,6 +793,7 @@ public class SessionHandler extends ScopedHandler /** * Set if Session cookies should use HTTP Only + * * @param httpOnly True if cookies should be HttpOnly. * @see HttpCookie */ @@ -802,6 +805,7 @@ public class SessionHandler extends ScopedHandler /** * Set Session cookie sameSite mode. * Currently this is encoded in the session comment until sameSite is supported by {@link SessionCookieConfig} + * * @param sameSite The sameSite setting for Session cookies (or null for no sameSite setting) */ public void setSameSite(HttpCookie.SameSite sameSite) @@ -860,7 +864,7 @@ public class SessionHandler extends ScopedHandler { _sessionIdPathParameterName = (param == null || "none".equals(param)) ? null : param; _sessionIdPathParameterNamePrefix = (param == null || "none".equals(param)) - ? null : (";" + _sessionIdPathParameterName + "="); + ? null : (";" + _sessionIdPathParameterName + "="); } /** @@ -894,8 +898,7 @@ public class SessionHandler extends ScopedHandler } catch (Exception e) { - LOG.warn("Invalidating session {} found to be expired when requested", id); - LOG.warn(e); + LOG.warn("Invalidating session {} found to be expired when requested", id, e); } return null; @@ -907,8 +910,7 @@ public class SessionHandler extends ScopedHandler } catch (UnreadableSessionDataException e) { - LOG.warn("Error loading session {}", id); - LOG.warn(e); + LOG.warn("Error loading session {}", id, e); try { //tell id mgr to remove session from all other contexts @@ -916,14 +918,13 @@ public class SessionHandler extends ScopedHandler } catch (Exception x) { - LOG.warn("Error cross-context invalidating unreadable session {}", id); - LOG.warn(x); + LOG.warn("Error cross-context invalidating unreadable session {}", id, x); } return null; } catch (Exception other) { - LOG.warn(other); + LOG.warn("Unable to get Session", other); return null; } } @@ -1008,7 +1009,7 @@ public class SessionHandler extends ScopedHandler } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to remove Session", e); return null; } } @@ -1131,7 +1132,7 @@ public class SessionHandler extends ScopedHandler } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to renew Session Id {}:{} -> {}:{}", oldId, oldExtendedId, newId, newExtendedId, e); } finally { @@ -1143,7 +1144,7 @@ public class SessionHandler extends ScopedHandler } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to release {}", newId, e); } } } @@ -1192,7 +1193,7 @@ public class SessionHandler extends ScopedHandler } catch (Exception e) { - LOG.warn(e); + LOG.warn("Error during Session destroy listener", e); } //call the attribute removed listeners and finally mark it as invalid session.finishInvalidate(); @@ -1201,14 +1202,13 @@ public class SessionHandler extends ScopedHandler catch (IllegalStateException e) { if (LOG.isDebugEnabled()) - LOG.debug("Session {} already invalid", session); - LOG.ignore(e); + LOG.debug("Session {} already invalid", session, e); } } } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to delete Session {}", id, e); } } @@ -1243,13 +1243,15 @@ public class SessionHandler extends ScopedHandler } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to expire Session {}", id, e); } } } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed to check expiration on {}", + candidates.stream().map(Objects::toString).collect(Collectors.joining(", ", "[", "]")), + e); } } @@ -1300,7 +1302,7 @@ public class SessionHandler extends ScopedHandler //roundtrips to the persistent store. Only do this if the HouseKeeper that //does the scavenging is configured to actually scavenge if (_sessionIdManager.getSessionHouseKeeper() != null && - _sessionIdManager.getSessionHouseKeeper().getIntervalSec() > 0) + _sessionIdManager.getSessionHouseKeeper().getIntervalSec() > 0) { _candidateSessionIdsForExpiry.add(session.getId()); if (LOG.isDebugEnabled()) @@ -1349,6 +1351,7 @@ public class SessionHandler extends ScopedHandler * * Implementation of the javax.servlet.SessionCookieConfig. * SameSite configuration can be achieved by using setComment + * * @see HttpCookie */ public final class CookieConfig implements SessionCookieConfig @@ -1533,8 +1536,8 @@ public class SessionHandler extends ScopedHandler HttpCookie cookie = access(existingSession, request.isSecure()); // Handle changed ID or max-age refresh, but only if this is not a redispatched request if ((cookie != null) && - (request.getDispatcherType() == DispatcherType.ASYNC || - request.getDispatcherType() == DispatcherType.REQUEST)) + (request.getDispatcherType() == DispatcherType.ASYNC || + request.getDispatcherType() == DispatcherType.REQUEST)) baseRequest.getResponse().replaceCookie(cookie); } @@ -1616,7 +1619,7 @@ public class SessionHandler extends ScopedHandler LOG.debug("Got Session ID {} from cookie {}", id, sessionCookie); HttpSession s = getHttpSession(id); - + if (requestedSessionId == null) { //no previous id, always accept this one diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java index ddaa69406a3..17f07daaa05 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java @@ -38,14 +38,14 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.server.handler.HandlerWrapper; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -53,7 +53,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; @Tag("stress") public class AsyncStressTest { - private static final Logger LOG = Log.getLogger(AsyncStressTest.class); + private static final Logger LOG = LoggerFactory.getLogger(AsyncStressTest.class); protected QueuedThreadPool _threads = new QueuedThreadPool(); protected Server _server = new Server(_threads); @@ -252,7 +252,8 @@ public class AsyncStressTest System.err.println(uri + "==" + br.getHttpURI()); System.err.println(asyncContext + "==" + br.getHttpChannelState()); - LOG.warn(e); + LOG.warn("Unable to complete async: request={}, uri={}, asyncContext={}", + br, br.getHttpURI(), br.getHttpChannelState(), e); System.exit(1); } } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java index 693dbf1bf02..4540da0d5b5 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java @@ -40,12 +40,12 @@ import org.eclipse.jetty.io.ssl.SslConnection; import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.time.Duration.ofSeconds; import static org.hamcrest.MatcherAssert.assertThat; @@ -63,7 +63,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public abstract class ConnectorTimeoutTest extends HttpServerTestFixture { - protected static final Logger LOG = Log.getLogger(ConnectorTimeoutTest.class); + protected static final Logger LOG = LoggerFactory.getLogger(ConnectorTimeoutTest.class); protected static final int MAX_IDLE_TIME = 2000; private int sleepTime = MAX_IDLE_TIME + MAX_IDLE_TIME / 5; @@ -540,9 +540,9 @@ public abstract class ConnectorTimeoutTest extends HttpServerTestFixture assertThat(response, is("")); assertEquals(-1, is.read()); } - catch (Exception e) + catch (IOException e) { - LOG.warn(e); + LOG.warn("Unable to read stream", e); } }); assertTrue(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start < maximumTestRuntime); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/CustomResourcesMonitorTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/CustomResourcesMonitorTest.java index f814f95a9bc..37b2ceed3ac 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/CustomResourcesMonitorTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/CustomResourcesMonitorTest.java @@ -28,13 +28,13 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.TimerScheduler; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -132,7 +132,7 @@ public class CustomResourcesMonitorTest static class FileOnDirectoryMonitor implements LowResourceMonitor.LowResourceCheck { - private static final Logger LOG = Log.getLogger(FileOnDirectoryMonitor.class); + private static final Logger LOG = LoggerFactory.getLogger(FileOnDirectoryMonitor.class); private final Path _pathToMonitor; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/DumpHandler.java b/jetty-server/src/test/java/org/eclipse/jetty/server/DumpHandler.java index 41d15bd3d51..5cc61c2209f 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/DumpHandler.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/DumpHandler.java @@ -34,8 +34,8 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.MimeTypes; import org.eclipse.jetty.server.handler.AbstractHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Dump request handler. @@ -44,7 +44,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class DumpHandler extends AbstractHandler { - private static final Logger LOG = Log.getLogger(DumpHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(DumpHandler.class); String label = "Dump HttpHandler"; @@ -223,10 +223,7 @@ public class DumpHandler extends AbstractHandler } catch (IOException e) { - if (LOG.isDebugEnabled()) - LOG.warn(e); - else - LOG.warn(e.toString()); + LOG.warn("Failed to copy request content", e); writer.write(e.toString()); } } @@ -259,7 +256,7 @@ public class DumpHandler extends AbstractHandler } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java index d2acbc5c99c..579723dcaec 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java @@ -52,7 +52,6 @@ import org.eclipse.jetty.server.LocalConnector.LocalEndPoint; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.ErrorHandler; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -800,7 +799,7 @@ public class HttpConnectionTest @Test public void testBadHostPort() throws Exception { - Log.getLogger(HttpParser.class).info("badMessage: Number formate exception expected ..."); + LOG.info("badMessage: Number formate exception expected ..."); String response; response = connector.getResponse("GET http://localhost:EXPECTED_NUMBER_FORMAT_EXCEPTION/ HTTP/1.1\r\n" + @@ -844,7 +843,7 @@ public class HttpConnectionTest @Test public void testBadUTF8FallsbackTo8859() throws Exception { - Log.getLogger(HttpParser.class).info("badMessage: bad encoding expected ..."); + LOG.info("badMessage: bad encoding expected ..."); String response; response = connector.getResponse("GET /foo/bar%c0%00 HTTP/1.1\r\n" + @@ -946,7 +945,7 @@ public class HttpConnectionTest checkContains(response, offset, "12345"); offset = 0; - Log.getLogger(DumpHandler.class).info("Expecting java.io.UnsupportedEncodingException"); + LOG.info("Expecting java.io.UnsupportedEncodingException"); response = connector.getResponse("GET /R1 HTTP/1.1\r\n" + "Host: localhost\r\n" + "Transfer-Encoding: chunked\r\n" + diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java index bd2e83ce4fc..ff0cfc23ca9 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java @@ -49,7 +49,6 @@ import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; @@ -72,6 +71,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public abstract class HttpServerTestBase extends HttpServerTestFixture { private static final Logger LOG = LoggerFactory.getLogger(HttpServerTestBase.class); + private static final String REQUEST1_HEADER = "POST / HTTP/1.0\n" + "Host: localhost\n" + "Content-Type: text/xml; charset=utf-8\n" + @@ -203,10 +203,10 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture configureServer(new HelloWorldHandler()); try (Socket client = newSocket(_serverURI.getHost(), _serverURI.getPort()); - StacklessLogging stackless = new StacklessLogging(HttpConnection.class)) + StacklessLogging ignored = new StacklessLogging(HttpConnection.class)) { client.setSoTimeout(10000); - Log.getLogger(HttpConnection.class).info("expect request is too large, then ISE extra data ..."); + LOG.info("expect request is too large, then ISE extra data ..."); OutputStream os = client.getOutputStream(); byte[] buffer = new byte[64 * 1024]; @@ -234,9 +234,9 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture _httpConfiguration.setRequestHeaderSize(maxHeaderSize); try (Socket client = newSocket(_serverURI.getHost(), _serverURI.getPort()); - StacklessLogging stackless = new StacklessLogging(HttpConnection.class)) + StacklessLogging ignored = new StacklessLogging(HttpConnection.class)) { - Log.getLogger(HttpConnection.class).info("expect URI is too large"); + LOG.info("expect URI is too large"); OutputStream os = client.getOutputStream(); // Take into account the initial bytes for the HTTP method. @@ -295,9 +295,9 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture Socket client = newSocket(_serverURI.getHost(), _serverURI.getPort()); OutputStream os = client.getOutputStream(); - try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class)) + try (StacklessLogging ignored = new StacklessLogging(HttpChannel.class)) { - Log.getLogger(HttpChannel.class).info("Expecting ServletException: TEST handler exception..."); + LOG.info("Expecting ServletException: TEST handler exception..."); os.write(request.toString().getBytes()); os.flush(); @@ -324,9 +324,9 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture Socket client = newSocket(_serverURI.getHost(), _serverURI.getPort()); OutputStream os = client.getOutputStream(); - try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class)) + try (StacklessLogging ignored = new StacklessLogging(HttpChannel.class)) { - Log.getLogger(HttpChannel.class).info("Expecting ServletException: TEST handler exception..."); + LOG.info("Expecting ServletException: TEST handler exception..."); os.write(request.toString().getBytes()); os.flush(); @@ -394,9 +394,9 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture configureServer(new HelloWorldHandler()); try (Socket client = newSocket(_serverURI.getHost(), _serverURI.getPort()); - StacklessLogging stackless = new StacklessLogging(HttpConnection.class)) + StacklessLogging ignored = new StacklessLogging(HttpConnection.class)) { - Log.getLogger(HttpConnection.class).info("expect header is too large ..."); + LOG.info("expect header is too large ..."); OutputStream os = client.getOutputStream(); byte[] buffer = new byte[64 * 1024]; @@ -437,7 +437,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture } catch (Exception e) { - Log.getLogger(HttpServerTestBase.class).warn("TODO Early close???"); + LOG.warn("TODO Early close???"); // TODO #1832 evaluate why we sometimes get an early close on this test } } @@ -1308,7 +1308,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture configureServer(handler); try (Socket client = newSocket(_serverURI.getHost(), _serverURI.getPort()); - StacklessLogging stackless = new StacklessLogging(HttpChannel.class)) + StacklessLogging ignored = new StacklessLogging(HttpChannel.class)) { LOG.info("Expecting exception after commit then could not send 500...."); OutputStream os = client.getOutputStream(); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java index 4600d5c22d7..0c1493b0346 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java @@ -33,15 +33,17 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.HotSwapHandler; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +// @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck public class HttpServerTestFixture { - // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck - + private static final Logger LOG = LoggerFactory.getLogger(HttpServerTestFixture.class); + // Useful constants protected static final long PAUSE = 10L; protected static final int LOOPS = 50; @@ -115,7 +117,7 @@ public class HttpServerTestFixture @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - Log.getRootLogger().debug("handle " + target); + LOG.debug("handle " + target); baseRequest.setHandled(true); if (request.getContentType() != null) @@ -157,7 +159,7 @@ public class HttpServerTestFixture if (reader.read() >= 0) throw new IllegalStateException("Not closed"); - Log.getRootLogger().debug("handled " + target); + LOG.debug("handled " + target); } } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/LocalAsyncContextTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/LocalAsyncContextTest.java index 820fd22fe5d..7df75c6719c 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/LocalAsyncContextTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/LocalAsyncContextTest.java @@ -32,19 +32,19 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.server.handler.HandlerWrapper; import org.eclipse.jetty.server.session.SessionHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; public class LocalAsyncContextTest { - public static final Logger LOG = Log.getLogger(LocalAsyncContextTest.class); + public static final Logger LOG = LoggerFactory.getLogger(LocalAsyncContextTest.class); protected Server _server; protected SuspendHandler _handler; protected Connector _connector; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/NotAcceptingTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/NotAcceptingTest.java index bcee19746bc..75a846f62ab 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/NotAcceptingTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/NotAcceptingTest.java @@ -32,12 +32,13 @@ import org.eclipse.jetty.http.tools.HttpTester; import org.eclipse.jetty.server.LocalConnector.LocalEndPoint; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; import org.hamcrest.Matcher; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -45,6 +46,7 @@ import static org.junit.jupiter.api.Assertions.fail; public class NotAcceptingTest { + private static final Logger LOG = LoggerFactory.getLogger(NotAcceptingTest.class); private final long idleTimeout = 2000; Server server; LocalConnector localConnector; @@ -367,7 +369,7 @@ public class NotAcceptingTest server.start(); - Log.getLogger(ConnectionLimit.class).debug("CONNECT:"); + LOG.debug("CONNECT:"); try ( LocalEndPoint local0 = localConnector.connect(); LocalEndPoint local1 = localConnector.connect(); @@ -382,7 +384,7 @@ public class NotAcceptingTest { String expectedContent = "Hello" + System.lineSeparator(); - Log.getLogger(ConnectionLimit.class).debug("LOCAL:"); + LOG.debug("LOCAL:"); for (LocalEndPoint client : new LocalEndPoint[]{local0, local1, local2}) { client.addInputAndExecute(BufferUtil.toBuffer("GET /test HTTP/1.1\r\nHost:localhost\r\n\r\n")); @@ -391,7 +393,7 @@ public class NotAcceptingTest assertThat(response.getContent(), is(expectedContent)); } - Log.getLogger(ConnectionLimit.class).debug("NETWORK:"); + LOG.debug("NETWORK:"); for (Socket client : new Socket[]{blocking0, blocking1, blocking2, async0, async1, async2}) { HttpTester.Input in = HttpTester.from(client.getInputStream()); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java index 198392ae295..e6c0a0ce660 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java @@ -61,13 +61,13 @@ import org.eclipse.jetty.toolchain.test.FS; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -88,7 +88,7 @@ import static org.junit.jupiter.api.Assertions.fail; // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck public class RequestTest { - private static final Logger LOG = Log.getLogger(RequestTest.class); + private static final Logger LOG = LoggerFactory.getLogger(RequestTest.class); private Server _server; private LocalConnector _connector; private RequestHandler _handler; @@ -122,13 +122,13 @@ public class RequestTest _server.stop(); _server.join(); } - + @Test public void testRequestCharacterEncoding() throws Exception { AtomicReference result = new AtomicReference<>(null); AtomicReference overrideCharEncoding = new AtomicReference<>(null); - + _server.stop(); ContextHandler handler = new CharEncodingContextHandler(); _server.setHandler(handler); @@ -154,26 +154,26 @@ public class RequestTest } }; _server.start(); - + String request = "GET / HTTP/1.1\n" + "Host: whatever\r\n" + "Content-Type: text/html;charset=utf8\n" + "Connection: close\n" + "\n"; - + //test setting the default char encoding - handler.setDefaultRequestCharacterEncoding("ascii"); + handler.setDefaultRequestCharacterEncoding("ascii"); String response = _connector.getResponse(request); assertTrue(response.startsWith("HTTP/1.1 200")); assertEquals("ascii", result.get()); - + //test overriding the default char encoding with explicit encoding result.set(null); overrideCharEncoding.set("utf-16"); response = _connector.getResponse(request); assertTrue(response.startsWith("HTTP/1.1 200")); assertEquals("utf-16", result.get()); - + //test fallback to content-type encoding result.set(null); overrideCharEncoding.set(null); @@ -292,7 +292,7 @@ public class RequestTest assertNull(request.getCookies()); assertEquals("", request.getHeader("Name")); assertTrue(request.getHeaders("Name").hasMoreElements()); // empty - assertThrows(IllegalArgumentException.class, () -> request.getDateHeader("Name")); + assertThrows(IllegalArgumentException.class, () -> request.getDateHeader("Name")); assertEquals(-1, request.getDateHeader("Other")); return true; } @@ -500,7 +500,9 @@ public class RequestTest assertTimeoutPreemptively(Duration.ofSeconds(5), () -> { while (testTmpDir.list().length > 0) + { Thread.yield(); + } }); } @@ -596,7 +598,7 @@ public class RequestTest System.out.println(request); String responses = _connector.getResponse(request); - assertThat(responses,startsWith("HTTP/1.1 200")); + assertThat(responses, startsWith("HTTP/1.1 200")); } /** @@ -929,9 +931,9 @@ public class RequestTest "Connection: close\r\n" + "\r\n" + content; - Log.getRootLogger().debug("test l={}", l); + LOG.debug("test l={}", l); String response = _connector.getResponse(request); - Log.getRootLogger().debug(response); + LOG.debug(response); assertThat(response, containsString(" 200 OK")); assertEquals(l, length.get()); content += "x"; @@ -1419,7 +1421,7 @@ public class RequestTest "Host: whatever\n" + "Connection: close\n" + "\n"; - + _server.stop(); PathMappingHandler handler = new PathMappingHandler(null, null, null); _server.setHandler(handler); @@ -1428,7 +1430,7 @@ public class RequestTest assertTrue(response.startsWith("HTTP/1.1 200 OK")); assertThat("Response body content", response, containsString("HttpServletMapping{matchValue=, pattern=, servletName=, mappingMatch=null}")); _server.stop(); - + ServletPathSpec spec = new ServletPathSpec(""); handler = new PathMappingHandler(spec, spec.getPathMatch("foo"), "Something"); _server.setHandler(handler); @@ -1437,7 +1439,7 @@ public class RequestTest assertTrue(response.startsWith("HTTP/1.1 200 OK")); assertThat("Response body content", response, containsString("HttpServletMapping{matchValue=, pattern=, servletName=Something, mappingMatch=CONTEXT_ROOT}")); _server.stop(); - + spec = new ServletPathSpec("/"); handler = new PathMappingHandler(spec, "", "Default"); _server.setHandler(handler); @@ -1446,7 +1448,7 @@ public class RequestTest assertTrue(response.startsWith("HTTP/1.1 200 OK")); assertThat("Response body content", response, containsString("HttpServletMapping{matchValue=/, pattern=/, servletName=Default, mappingMatch=DEFAULT}")); _server.stop(); - + spec = new ServletPathSpec("/foo/*"); handler = new PathMappingHandler(spec, spec.getPathMatch("/foo/bar"), "BarServlet"); _server.setHandler(handler); @@ -1464,7 +1466,7 @@ public class RequestTest assertTrue(response.startsWith("HTTP/1.1 200 OK")); assertThat("Response body content", response, containsString("HttpServletMapping{matchValue=/foo/bar, pattern=*.jsp, servletName=JspServlet, mappingMatch=EXTENSION}")); _server.stop(); - + spec = new ServletPathSpec("/catalog"); handler = new PathMappingHandler(spec, spec.getPathMatch("/catalog"), "CatalogServlet"); _server.setHandler(handler); @@ -1474,7 +1476,7 @@ public class RequestTest assertThat("Response body content", response, containsString("HttpServletMapping{matchValue=catalog, pattern=/catalog, servletName=CatalogServlet, mappingMatch=EXACT}")); _server.stop(); } - + @Test public void testCookies() throws Exception { @@ -1858,7 +1860,7 @@ public class RequestTest assertNotNull(request.getParameterMap()); assertEquals(0, request.getParameterMap().size()); } - + interface RequestTester { boolean check(HttpServletRequest request, HttpServletResponse response) throws IOException; @@ -1986,14 +1988,14 @@ public class RequestTest private ContextHandler _handler; private String _contextPath; private String _name; - + public TestUserIdentityScope(ContextHandler handler, String contextPath, String name) { _handler = handler; _contextPath = contextPath; _name = name; } - + @Override public ContextHandler getContextHandler() { @@ -2024,14 +2026,14 @@ public class RequestTest private ServletPathSpec _spec; private String _servletPath; private String _servletName; - + public PathMappingHandler(ServletPathSpec spec, String servletPath, String servletName) { _spec = spec; _servletPath = servletPath; _servletName = servletName; } - + @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -2042,6 +2044,6 @@ public class RequestTest baseRequest.setUserIdentityScope(new TestUserIdentityScope(null, null, _servletName)); HttpServletMapping mapping = baseRequest.getHttpServletMapping(); response.getWriter().println(mapping); - } + } } } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java index 7821cd8a02f..306269754a8 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java @@ -38,7 +38,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.stream.Stream; - import javax.servlet.RequestDispatcher; import javax.servlet.ServletOutputStream; import javax.servlet.http.Cookie; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/StopTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/StopTest.java index 618398b0667..0e0f5a61870 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/StopTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/StopTest.java @@ -42,11 +42,11 @@ import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.FutureCallback; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.hamcrest.Matcher; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -63,6 +63,8 @@ import static org.junit.jupiter.api.Assertions.fail; public class StopTest { + private static final Logger LOG = LoggerFactory.getLogger(StopTest.class); + /** * Test completed writes during shutdown do not close output * @@ -248,7 +250,7 @@ public class StopTest @Test public void testSlowCloseNotGraceful() throws Exception { - Log.getLogger(QueuedThreadPool.class).info("Expect some threads can't be stopped"); + LOG.info("Expect some threads can't be stopped"); testSlowClose(0, 5000, lessThan(750L)); } @@ -260,7 +262,7 @@ public class StopTest @Test public void testSlowCloseTinyGraceful() throws Exception { - Log.getLogger(QueuedThreadPool.class).info("Expect some threads can't be stopped"); + LOG.info("Expect some threads can't be stopped"); testSlowClose(1, 5000, lessThan(1500L)); } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java index ae73c01523e..e8584388894 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java @@ -31,8 +31,6 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.server.handler.HandlerWrapper; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -41,6 +39,8 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnOs; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -54,7 +54,7 @@ import static org.junit.jupiter.api.condition.OS.MAC; @DisabledOnOs(MAC) // TODO: needs investigation public class StressTest { - private static final Logger LOG = Log.getLogger(StressTest.class); + private static final Logger LOG = LoggerFactory.getLogger(StressTest.class); private static QueuedThreadPool _threads; private static Server _server; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/InetAccessHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/InetAccessHandlerTest.java index cd7d5427783..bde3c271a5e 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/InetAccessHandlerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/InetAccessHandlerTest.java @@ -163,83 +163,89 @@ public class InetAccessHandlerTest public static Stream data() { Object[][] data = new Object[][] - { - // Empty lists 1 - {"", "", "", "", "", "200;200"}, + { + // Empty lists 1 + {"", "", "", "", "", "200;200"}, - // test simple filters - {"", "127.0.0.1", "", "", "", "200;200"}, - {"", "127.0.0.1-127.0.0.254", "", "", "", "200;200"}, - {"", "127.0.0.1-127.0.0.254", "", "", "", "200;200"}, - {"", "192.0.0.1", "", "", "", "403;403"}, - {"", "192.0.0.1-192.0.0.254", "", "", "", "403;403"}, + // test simple filters + {"", "127.0.0.1", "", "", "", "200;200"}, + {"", "127.0.0.1-127.0.0.254", "", "", "", "200;200"}, + {"", "127.0.0.1-127.0.0.254", "", "", "", "200;200"}, + {"", "192.0.0.1", "", "", "", "403;403"}, + {"", "192.0.0.1-192.0.0.254", "", "", "", "403;403"}, - // test includeConnector - {"", "127.0.0.1", "", "http_connector1", "", "200;200"}, - {"", "127.0.0.1-127.0.0.254", "", "http_connector1", "", "200;200"}, - {"", "192.0.0.1", "", "http_connector1", "", "200;403"}, - {"", "192.0.0.1-192.0.0.254", "", "http_connector1", "", "200;403"}, - {"", "192.0.0.1", "", "http_connector2", "", "403;200"}, - {"", "192.0.0.1-192.0.0.254", "", "http_connector2", "", "403;200"}, + // test includeConnector + {"", "127.0.0.1", "", "http_connector1", "", "200;200"}, + {"", "127.0.0.1-127.0.0.254", "", "http_connector1", "", "200;200"}, + {"", "192.0.0.1", "", "http_connector1", "", "200;403"}, + {"", "192.0.0.1-192.0.0.254", "", "http_connector1", "", "200;403"}, + {"", "192.0.0.1", "", "http_connector2", "", "403;200"}, + {"", "192.0.0.1-192.0.0.254", "", "http_connector2", "", "403;200"}, - // test includeConnector names where none of them match - {"", "127.0.0.1", "", "nothttp", "", "200;200"}, - {"", "127.0.0.1-127.0.0.254", "", "nothttp", "", "200;200"}, - {"", "192.0.0.1", "", "nothttp", "", "403;403"}, - {"", "192.0.0.1-192.0.0.254", "", "nothttp", "", "403;403"}, + // test includeConnector names where none of them match + {"", "127.0.0.1", "", "nothttp", "", "200;200"}, + {"", "127.0.0.1-127.0.0.254", "", "nothttp", "", "200;200"}, + {"", "192.0.0.1", "", "nothttp", "", "403;403"}, + {"", "192.0.0.1-192.0.0.254", "", "nothttp", "", "403;403"}, - // text excludeConnector - {"", "127.0.0.1", "", "", "http_connector1", "403;200"}, - {"", "127.0.0.1-127.0.0.254", "", "", "http_connector1", "403;200"}, - {"", "192.0.0.1", "", "", "http_connector1", "403;403"}, - {"", "192.0.0.1-192.0.0.254", "", "", "http_connector1", "403;403"}, - {"", "192.0.0.1", "", "", "http_connector2", "403;403"}, - {"", "192.0.0.1-192.0.0.254", "", "", "http_connector2", "403;403"}, + // text excludeConnector + {"", "127.0.0.1", "", "", "http_connector1", "403;200"}, + {"", "127.0.0.1-127.0.0.254", "", "", "http_connector1", "403;200"}, + {"", "192.0.0.1", "", "", "http_connector1", "403;403"}, + {"", "192.0.0.1-192.0.0.254", "", "", "http_connector1", "403;403"}, + {"", "192.0.0.1", "", "", "http_connector2", "403;403"}, + {"", "192.0.0.1-192.0.0.254", "", "", "http_connector2", "403;403"}, - // test excludeConnector where none of them match. - {"", "127.0.0.1", "", "", "nothttp", "200;200"}, - {"", "127.0.0.1-127.0.0.254", "", "", "nothttp", "200;200"}, - {"", "192.0.0.1", "", "", "nothttp", "403;403"}, - {"", "192.0.0.1-192.0.0.254", "", "", "nothttp", "403;403"}, + // test excludeConnector where none of them match. + {"", "127.0.0.1", "", "", "nothttp", "200;200"}, + {"", "127.0.0.1-127.0.0.254", "", "", "nothttp", "200;200"}, + {"", "192.0.0.1", "", "", "nothttp", "403;403"}, + {"", "192.0.0.1-192.0.0.254", "", "", "nothttp", "403;403"}, - // both connectors are excluded - {"", "127.0.0.1", "", "", "http_connector1;http_connector2", "403;403"}, - {"", "127.0.0.1-127.0.0.254", "", "", "http_connector1;http_connector2", "403;403"}, - {"", "192.0.0.1", "", "", "http_connector1;http_connector2", "403;403"}, - {"", "192.0.0.1-192.0.0.254", "", "", "http_connector1;http_connector2", "403;403"}, + // both connectors are excluded + {"", "127.0.0.1", "", "", "http_connector1;http_connector2", "403;403"}, + {"", "127.0.0.1-127.0.0.254", "", "", "http_connector1;http_connector2", "403;403"}, + {"", "192.0.0.1", "", "", "http_connector1;http_connector2", "403;403"}, + {"", "192.0.0.1-192.0.0.254", "", "", "http_connector1;http_connector2", "403;403"}, - // both connectors are included - {"", "127.0.0.1", "", "http_connector1;http_connector2", "", "200;200"}, - {"", "127.0.0.1-127.0.0.254", "", "http_connector1;http_connector2", "", "200;200"}, - {"", "192.0.0.1", "", "http_connector1;http_connector2", "", "200;200"}, - {"", "192.0.0.1-192.0.0.254", "", "http_connector1;http_connector2", "", "200;200"}, - {"", "", "127.0.0.1", "http_connector1;http_connector2", "", "403;403"}, + // both connectors are included + {"", "127.0.0.1", "", "http_connector1;http_connector2", "", "200;200"}, + {"", "127.0.0.1-127.0.0.254", "", "http_connector1;http_connector2", "", "200;200"}, + {"", "192.0.0.1", "", "http_connector1;http_connector2", "", "200;200"}, + {"", "192.0.0.1-192.0.0.254", "", "http_connector1;http_connector2", "", "200;200"}, + {"", "", "127.0.0.1", "http_connector1;http_connector2", "", "403;403"}, - // exclude takes precedence over include - {"", "127.0.0.1", "", "http_connector1;http_connector2", "http_connector1;http_connector2", "403;403"}, - {"", "127.0.0.1-127.0.0.254", "", "http_connector1;http_connector2", "http_connector1;http_connector2", "403;403"}, - {"", "192.0.0.1", "", "http_connector1;http_connector2", "http_connector1;http_connector2", "403;403"}, - {"", "192.0.0.1-192.0.0.254", "", "http_connector1;http_connector2", "http_connector1;http_connector2", "403;403"}, + // exclude takes precedence over include + {"", "127.0.0.1", "", "http_connector1;http_connector2", "http_connector1;http_connector2", "403;403"}, + { + "", "127.0.0.1-127.0.0.254", "", "http_connector1;http_connector2", "http_connector1;http_connector2", + "403;403" + }, + {"", "192.0.0.1", "", "http_connector1;http_connector2", "http_connector1;http_connector2", "403;403"}, + { + "", "192.0.0.1-192.0.0.254", "", "http_connector1;http_connector2", "http_connector1;http_connector2", + "403;403" + }, - // Test path specific include/exclude. - {"/testPath", "", "", "http_connector1", "", "200;403"}, - {"/", "127.0.0.1", "127.0.0.1|/testPath", "http_connector1", "", "200;200"}, - {"/testPath", "127.0.0.1", "127.0.0.1|/testPath", "http_connector1", "", "403;403"}, - {"/notTestPath", "127.0.1.11|/testPath", "", "http_connector1", "", "200;403"}, - {"/testPath", "127.0.1.11|/testPath", "", "http_connector1", "", "200;403"}, - {"/testPath", "127.0.0.13|/testPath;127.0.0.1|/testPath", "", "http_connector1", "", "200;200"}, - {"/testPath", "127.0.0.1", "127.0.0.1|/testPath", "http_connector1", "", "403;403"}, - {"/", "127.0.0.1", "127.0.0.1|/testPath", "http_connector1", "", "200;200"}, - {"/a/b", "", "127.0.0.1|/a/*", "", "", "403;403"}, - {"/b/a", "", "127.0.0.1|/a/*", "", "", "200;200"}, - {"/org/eclipse/jetty/test.html", "127.0.0.1|*.html", "127.0.0.1|*.xml", "", "", "200;200"}, - {"/org/eclipse/jetty/test.xml", "127.0.0.1|*.html", "127.0.0.1|*.xml", "", "", "403;403"}, - {"/org/eclipse/jetty/test.pdf", "127.0.0.1|*.html", "127.0.0.1|*.xml", "", "", "403;403"}, - {"/a/test.html", "", "127.0.0.1|*.html;127.0.0.10|/a/*", "", "", "403;403"}, - {"/foo/bar/test.xml", "127.0.0.1|/foo/*", "127.0.0.0-127.0.0.2|*.html", "", "", "200;200"}, - {"/foo/bar/test.html", "127.0.0.1|/foo/*", "127.0.0.0-127.0.0.2|*.html", "", "", "403;403"}, - {"/foo/bar/test.xml", "127.0.0.1|/foo/bar/*", "127.0.0.1|/foo/*", "", "", "403;403"}, - }; + // Test path specific include/exclude. + {"/testPath", "", "", "http_connector1", "", "200;403"}, + {"/", "127.0.0.1", "127.0.0.1|/testPath", "http_connector1", "", "200;200"}, + {"/testPath", "127.0.0.1", "127.0.0.1|/testPath", "http_connector1", "", "403;403"}, + {"/notTestPath", "127.0.1.11|/testPath", "", "http_connector1", "", "200;403"}, + {"/testPath", "127.0.1.11|/testPath", "", "http_connector1", "", "200;403"}, + {"/testPath", "127.0.0.13|/testPath;127.0.0.1|/testPath", "", "http_connector1", "", "200;200"}, + {"/testPath", "127.0.0.1", "127.0.0.1|/testPath", "http_connector1", "", "403;403"}, + {"/", "127.0.0.1", "127.0.0.1|/testPath", "http_connector1", "", "200;200"}, + {"/a/b", "", "127.0.0.1|/a/*", "", "", "403;403"}, + {"/b/a", "", "127.0.0.1|/a/*", "", "", "200;200"}, + {"/org/eclipse/jetty/test.html", "127.0.0.1|*.html", "127.0.0.1|*.xml", "", "", "200;200"}, + {"/org/eclipse/jetty/test.xml", "127.0.0.1|*.html", "127.0.0.1|*.xml", "", "", "403;403"}, + {"/org/eclipse/jetty/test.pdf", "127.0.0.1|*.html", "127.0.0.1|*.xml", "", "", "403;403"}, + {"/a/test.html", "", "127.0.0.1|*.html;127.0.0.10|/a/*", "", "", "403;403"}, + {"/foo/bar/test.xml", "127.0.0.1|/foo/*", "127.0.0.0-127.0.0.2|*.html", "", "", "200;200"}, + {"/foo/bar/test.html", "127.0.0.1|/foo/*", "127.0.0.0-127.0.0.2|*.html", "", "", "403;403"}, + {"/foo/bar/test.xml", "127.0.0.1|/foo/bar/*", "127.0.0.1|/foo/*", "", "", "403;403"} + }; return Arrays.stream(data).map(Arguments::of); } } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/NcsaRequestLogTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/NcsaRequestLogTest.java index 573e671035c..4ee0fb69ddf 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/NcsaRequestLogTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/NcsaRequestLogTest.java @@ -45,7 +45,6 @@ import org.eclipse.jetty.server.Response; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assumptions; @@ -53,12 +52,16 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; public class NcsaRequestLogTest { + private static final Logger LOG = LoggerFactory.getLogger(NcsaRequestLogTest.class); + RequestLog _log; Server _server; LocalConnector _connector; @@ -599,7 +602,7 @@ public class NcsaRequestLogTest } catch (IOException | IllegalStateException th) { - Log.getLog().ignore(th); + LOG.trace("IGNORED", th); } finally { diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SelectChannelServerSslTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SelectChannelServerSslTest.java index a48e15c7ce0..a8cce77e1e3 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SelectChannelServerSslTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SelectChannelServerSslTest.java @@ -41,7 +41,6 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.io.LeakTrackingByteBufferPool; import org.eclipse.jetty.io.MappedByteBufferPool; -import org.eclipse.jetty.io.ssl.SslConnection; import org.eclipse.jetty.server.AbstractConnectionFactory; import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.server.HttpServerTestBase; @@ -50,13 +49,14 @@ import org.eclipse.jetty.server.SecureRequestCustomizer; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; -import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.hamcrest.Matchers; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnOs; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -71,6 +71,7 @@ import static org.junit.jupiter.api.condition.OS.WINDOWS; */ public class SelectChannelServerSslTest extends HttpServerTestBase { + private static final Logger LOG = LoggerFactory.getLogger(SelectChannelServerSslTest.class); private SSLContext _sslContext; public SelectChannelServerSslTest() @@ -139,13 +140,13 @@ public class SelectChannelServerSslTest extends HttpServerTestBase catch (SocketException e) { // TODO This needs to be investigated #2244 - Log.getLogger(SslConnection.class).warn("Close overtook 400 response"); + LOG.warn("Close overtook 400 response", e); } catch (SSLException e) { // TODO This needs to be investigated #2244 if (e.getCause() instanceof SocketException) - Log.getLogger(SslConnection.class).warn("Close overtook 400 response"); + LOG.warn("Close overtook 400 response", e); else throw e; } @@ -161,7 +162,7 @@ public class SelectChannelServerSslTest extends HttpServerTestBase } catch (SocketException e) { - Log.getLogger(SslConnection.class).warn("Close overtook 400 response"); + LOG.warn("Close overtook 400 response", e); } } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SlowClientsTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SlowClientsTest.java index 73c8f9267d2..2d020a5d290 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SlowClientsTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SlowClientsTest.java @@ -39,14 +39,14 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.time.Duration.ofSeconds; @@ -54,7 +54,7 @@ import static java.time.Duration.ofSeconds; @Disabled public class SlowClientsTest { - private Logger logger = Log.getLogger(getClass()); + private Logger logger = LoggerFactory.getLogger(getClass()); @Test public void testSlowClientsWithSmallThreadPool() throws Exception diff --git a/jetty-servlet/pom.xml b/jetty-servlet/pom.xml index c705a9f382c..ec86bc7bc96 100644 --- a/jetty-servlet/pom.xml +++ b/jetty-servlet/pom.xml @@ -46,6 +46,10 @@ jetty-security ${project.version}
+ + org.slf4j + slf4j-api + org.eclipse.jetty jetty-jmx @@ -53,6 +57,12 @@ true + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/BaseHolder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/BaseHolder.java index 85985601688..a365c7b93aa 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/BaseHolder.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/BaseHolder.java @@ -19,7 +19,6 @@ package org.eclipse.jetty.servlet; import java.io.IOException; - import javax.servlet.ServletContext; import javax.servlet.UnavailableException; @@ -29,8 +28,8 @@ import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AbstractHolder @@ -43,7 +42,7 @@ import org.eclipse.jetty.util.log.Logger; */ public abstract class BaseHolder extends AbstractLifeCycle implements Dumpable { - private static final Logger LOG = Log.getLogger(BaseHolder.class); + private static final Logger LOG = LoggerFactory.getLogger(BaseHolder.class); private final Source _source; private Class _class; @@ -93,7 +92,7 @@ public abstract class BaseHolder extends AbstractLifeCycle implements Dumpabl } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to load class {}", _className, e); throw new UnavailableException("Class loading error for holder " + toString()); } } diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java index f725b1f27a9..000f84874d6 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java @@ -42,10 +42,10 @@ import org.eclipse.jetty.server.ResourceService; import org.eclipse.jetty.server.ResourceService.WelcomeFactory; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.ResourceFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The default servlet. @@ -129,7 +129,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory, Welc { public static final String CONTEXT_INIT = "org.eclipse.jetty.servlet.Default."; - private static final Logger LOG = Log.getLogger(DefaultServlet.class); + private static final Logger LOG = LoggerFactory.getLogger(DefaultServlet.class); private static final long serialVersionUID = 4930458713846881193L; @@ -204,7 +204,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory, Welc } catch (Exception e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("Unable to create resourceBase from {}", rb, e); throw new UnavailableException(e.toString()); } } @@ -228,8 +228,9 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory, Welc } catch (Exception e) { - LOG.warn(e.toString()); - LOG.debug(e); + LOG.warn("Unable to use stylesheet: {} - {}", css, e.toString()); + if (LOG.isDebugEnabled()) + LOG.debug("Unable to use stylesheet: {}", css, e); } int encodingHeaderCacheSize = getInitInt("encodingHeaderCacheSize", -1); @@ -269,7 +270,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory, Welc } catch (Exception e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("Unable to setup CachedContentFactory", e); throw new UnavailableException(e.toString()); } @@ -438,7 +439,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory, Welc } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } if ((r == null || !r.exists()) && pathInContext.endsWith("/jetty-dir.css")) diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ErrorPageErrorHandler.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ErrorPageErrorHandler.java index 35473804b70..5ef6ea787ff 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ErrorPageErrorHandler.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ErrorPageErrorHandler.java @@ -29,8 +29,8 @@ import javax.servlet.http.HttpServletRequest; import org.eclipse.jetty.server.Dispatcher; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ErrorHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * An ErrorHandler that maps exceptions and status codes to URIs for dispatch using @@ -39,7 +39,7 @@ import org.eclipse.jetty.util.log.Logger; public class ErrorPageErrorHandler extends ErrorHandler implements ErrorHandler.ErrorPageMapper { public static final String GLOBAL_ERROR_PAGE = "org.eclipse.jetty.server.error_page.global"; - private static final Logger LOG = Log.getLogger(ErrorPageErrorHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ErrorPageErrorHandler.class); private enum PageLookupTechnique { diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterHolder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterHolder.java index 75e00416bdc..515ef89f9bf 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterHolder.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterHolder.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.EnumSet; import java.util.List; - import javax.servlet.DispatcherType; import javax.servlet.Filter; import javax.servlet.FilterConfig; @@ -35,12 +34,12 @@ import javax.servlet.ServletException; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class FilterHolder extends Holder { - private static final Logger LOG = Log.getLogger(FilterHolder.class); + private static final Logger LOG = LoggerFactory.getLogger(FilterHolder.class); private transient Filter _filter; private transient Config _config; diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java index c9d3392bc5f..dfd1a9b4420 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java @@ -29,8 +29,8 @@ import javax.servlet.ServletContext; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Holder @@ -43,7 +43,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Holder - a container for servlets and the like") public abstract class Holder extends BaseHolder { - private static final Logger LOG = Log.getLogger(Holder.class); + private static final Logger LOG = LoggerFactory.getLogger(Holder.class); private final Map _initParams = new HashMap(3); private String _displayName; diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Invoker.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Invoker.java index f94134fcef2..75a77c9ed0a 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Invoker.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Invoker.java @@ -39,8 +39,8 @@ import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.HandlerWrapper; import org.eclipse.jetty.util.ArrayUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Dynamic Servlet Invoker. @@ -67,7 +67,7 @@ import org.eclipse.jetty.util.log.Logger; @SuppressWarnings("serial") public class Invoker extends HttpServlet { - private static final Logger LOG = Log.getLogger(Invoker.class); + private static final Logger LOG = LoggerFactory.getLogger(Invoker.class); private ContextHandler _contextHandler; private ServletHandler _servletHandler; @@ -194,7 +194,7 @@ public class Invoker extends HttpServlet } catch (Exception e) { - LOG.debug(e); + LOG.debug("Unable to start {}", holder, e); throw new UnavailableException(e.toString()); } @@ -212,7 +212,7 @@ public class Invoker extends HttpServlet } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } LOG.warn("Dynamic servlet " + s + diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ListenerHolder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ListenerHolder.java index ab3ec766841..3259392743a 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ListenerHolder.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ListenerHolder.java @@ -19,7 +19,6 @@ package org.eclipse.jetty.servlet; import java.util.EventListener; - import javax.servlet.ServletContext; import javax.servlet.ServletException; @@ -118,7 +117,7 @@ public class ListenerHolder extends BaseHolder } return listener; } - + @Override public void doStop() throws Exception { diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java index 758767d3654..9d220641287 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java @@ -72,8 +72,8 @@ import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Servlet Context. @@ -91,7 +91,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Servlet Context Handler") public class ServletContextHandler extends ContextHandler { - private static final Logger LOG = Log.getLogger(ServletContextHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ServletContextHandler.class); public static final int SESSIONS = 1; public static final int SECURITY = 2; @@ -1260,7 +1260,7 @@ public class ServletContextHandler extends ContextHandler { return _objFactory.decorate(super.createInstance(clazz)); } - + public T createInstance(BaseHolder holder) throws ServletException { try diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java index 355b3a28a13..5f4b22f2553 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java @@ -70,8 +70,8 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.DumpableCollection; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Servlet HttpHandler. @@ -89,7 +89,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Servlet Handler") public class ServletHandler extends ScopedHandler { - private static final Logger LOG = Log.getLogger(ServletHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ServletHandler.class); public static final String __DEFAULT_SERVLET = "default"; @@ -232,29 +232,30 @@ public class ServletHandler extends ScopedHandler { for (int i = _filters.length; i-- > 0; ) { + FilterHolder filter = _filters[i]; try { - _filters[i].stop(); + filter.stop(); } catch (Exception e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("Unable to stop filter {}", filter, e); } - if (_filters[i].getSource() != Source.EMBEDDED) + if (filter.getSource() != Source.EMBEDDED) { //remove all of the mappings that were for non-embedded filters - _filterNameMap.remove(_filters[i].getName()); + _filterNameMap.remove(filter.getName()); //remove any mappings associated with this filter ListIterator fmitor = filterMappings.listIterator(); while (fmitor.hasNext()) { FilterMapping fm = fmitor.next(); - if (fm.getFilterName().equals(_filters[i].getName())) + if (fm.getFilterName().equals(filter.getName())) fmitor.remove(); } } else - filterHolders.add(_filters[i]); //only retain embedded + filterHolders.add(filter); //only retain embedded } } @@ -274,30 +275,31 @@ public class ServletHandler extends ScopedHandler { for (int i = _servlets.length; i-- > 0; ) { + ServletHolder servlet = _servlets[i]; try { - _servlets[i].stop(); + servlet.stop(); } catch (Exception e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("Unable to stop servlet {}", servlet, e); } - if (_servlets[i].getSource() != Source.EMBEDDED) + if (servlet.getSource() != Source.EMBEDDED) { //remove from servlet name map - _servletNameMap.remove(_servlets[i].getName()); + _servletNameMap.remove(servlet.getName()); //remove any mappings associated with this servlet ListIterator smitor = servletMappings.listIterator(); while (smitor.hasNext()) { ServletMapping sm = smitor.next(); - if (sm.getServletName().equals(_servlets[i].getName())) + if (sm.getServletName().equals(servlet.getName())) smitor.remove(); } } else - servletHolders.add(_servlets[i]); //only retain embedded + servletHolders.add(servlet); //only retain embedded } } @@ -313,16 +315,17 @@ public class ServletHandler extends ScopedHandler { for (int i = _listeners.length; i-- > 0; ) { + ListenerHolder listener = _listeners[i]; try { - _listeners[i].stop(); + listener.stop(); } catch (Exception e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("Unable to stop listener {}", listener, e); } - if (_listeners[i].getSource() == Source.EMBEDDED) - listenerHolders.add(_listeners[i]); + if (listener.getSource() == Source.EMBEDDED) + listenerHolders.add(listener); } } ListenerHolder[] listeners = (ListenerHolder[])LazyList.toArray(listenerHolders, ListenerHolder.class); @@ -741,7 +744,7 @@ public class ServletHandler extends ScopedHandler } catch (Throwable e) { - LOG.debug(Log.EXCEPTION, e); + LOG.debug("Unable to start {}", h, e); mx.add(e); } }); diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java index c0785ced4aa..aef2a26900c 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java @@ -33,7 +33,6 @@ import java.util.Map; import java.util.Set; import java.util.Stack; import java.util.concurrent.TimeUnit; - import javax.servlet.GenericServlet; import javax.servlet.MultipartConfigElement; import javax.servlet.Servlet; @@ -59,8 +58,8 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Servlet Instance and Context Holder. @@ -73,7 +72,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Servlet Holder") public class ServletHolder extends Holder implements UserIdentity.Scope, Comparable { - private static final Logger LOG = Log.getLogger(ServletHolder.class); + private static final Logger LOG = LoggerFactory.getLogger(ServletHolder.class); private int _initOrder = -1; private boolean _initOnStartup = false; private Map _roleMap; @@ -365,7 +364,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope makeUnavailable(ex); if (getServletHandler().isStartWithUnavailable()) { - LOG.ignore(ex); + LOG.trace("IGNORED", ex); return; } else @@ -382,7 +381,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope makeUnavailable(ex); if (getServletHandler().isStartWithUnavailable()) { - LOG.ignore(ex); + LOG.trace("IGNORED", ex); return; } else @@ -443,7 +442,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to destroy servlet {}", servlet, e); } } _config = null; @@ -595,7 +594,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope { makeUnavailable(e); if (getServletHandler().isStartWithUnavailable()) - LOG.warn(e); + LOG.warn("{} is marked as Unavailable", this, e); else throw e; } @@ -793,8 +792,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope String tmp = StringUtil.replace(jsp, '.', '_'); if (LOG.isDebugEnabled()) { - LOG.warn("JspUtil.makeJavaIdentifier failed for jsp " + jsp + " using " + tmp + " instead"); - LOG.warn(e); + LOG.warn("JspUtil.makeJavaIdentifier failed for jsp {} using {} instead", jsp, tmp, e); } return tmp; } @@ -830,8 +828,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope tmp = (".".equals(tmp) ? "" : tmp); if (LOG.isDebugEnabled()) { - LOG.warn("JspUtil.makeJavaPackage failed for " + jsp + " using " + tmp + " instead"); - LOG.warn(e); + LOG.warn("JspUtil.makeJavaPackage failed for {} using {} instead", jsp, tmp, e); } return tmp; } @@ -1014,13 +1011,14 @@ public class ServletHolder extends Holder implements UserIdentity.Scope { while (_stack.size() > 0) { + Servlet servlet = _stack.pop(); try { - (_stack.pop()).destroy(); + servlet.destroy(); } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to destroy servlet {}", servlet, e); } } } @@ -1209,7 +1207,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope } catch (Throwable th) { - LOG.warn(th); + LOG.warn("Unable to destroy {}", _servlet, th); } } } diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Source.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Source.java index 27970faf747..285232f57c3 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Source.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Source.java @@ -32,7 +32,7 @@ public class Source { EMBEDDED, JAVAX_API, DESCRIPTOR, ANNOTATION } - + public Origin _origin; public String _resource; diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java index 8cd560a0613..781c5de37b9 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java @@ -38,12 +38,12 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.StatisticsHandler; import org.eclipse.jetty.util.component.Container; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class StatisticsServlet extends HttpServlet { - private static final Logger LOG = Log.getLogger(StatisticsServlet.class); + private static final Logger LOG = LoggerFactory.getLogger(StatisticsServlet.class); boolean _restrictToLocalhost = true; // defaults to true private StatisticsHandler _statsHandler; diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/listener/ELContextCleaner.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/listener/ELContextCleaner.java index 1929082bdb2..61232e3d2db 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/listener/ELContextCleaner.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/listener/ELContextCleaner.java @@ -25,8 +25,8 @@ import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ELContextCleaner @@ -39,7 +39,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class ELContextCleaner implements ServletContextListener { - private static final Logger LOG = Log.getLogger(ELContextCleaner.class); + private static final Logger LOG = LoggerFactory.getLogger(ELContextCleaner.class); @Override public void contextInitialized(ServletContextEvent sce) diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletIOTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletIOTest.java index b70636f7b6d..36f3ab7bf2c 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletIOTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletIOTest.java @@ -53,13 +53,13 @@ import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.nio.charset.StandardCharsets.ISO_8859_1; import static org.hamcrest.MatcherAssert.assertThat; @@ -75,7 +75,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; // TODO need these on HTTP2 as well! public class AsyncServletIOTest { - private static final Logger LOG = Log.getLogger(AsyncServletIOTest.class); + private static final Logger LOG = LoggerFactory.getLogger(AsyncServletIOTest.class); protected AsyncIOServlet _servlet0 = new AsyncIOServlet(); protected AsyncIOServlet2 _servlet2 = new AsyncIOServlet2(); protected AsyncIOServlet3 _servlet3 = new AsyncIOServlet3(); diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DispatcherTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DispatcherTest.java index 2e4452afcc0..9cacec898b7 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DispatcherTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DispatcherTest.java @@ -59,10 +59,11 @@ import org.eclipse.jetty.server.handler.ResourceHandler; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.UrlEncoded; -import org.eclipse.jetty.util.log.Log; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -74,6 +75,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class DispatcherTest { + private static final Logger LOG = LoggerFactory.getLogger(DispatcherTest.class); + private Server _server; private LocalConnector _connector; private ContextHandlerCollection _contextCollection; @@ -170,9 +173,9 @@ public class DispatcherTest @Test public void testForwardWithBadParams() throws Exception { - try (StacklessLogging nostack = new StacklessLogging(HttpChannel.class)) + try (StacklessLogging ignored = new StacklessLogging(HttpChannel.class)) { - Log.getLogger(ServletHandler.class).info("Expect Not valid UTF8 warnings..."); + LOG.info("Expect Not valid UTF8 warnings..."); _contextHandler.addServlet(AlwaysForwardServlet.class, "/forward/*"); _contextHandler.addServlet(EchoServlet.class, "/echo/*"); @@ -732,7 +735,7 @@ public class DispatcherTest HttpServletMapping fwdMapping = (HttpServletMapping)request.getAttribute(Dispatcher.FORWARD_MAPPING); assertNotNull(fwdMapping); assertEquals("/ForwardServlet", fwdMapping.getMatchValue()); - + List expectedAttributeNames = Arrays.asList(Dispatcher.FORWARD_REQUEST_URI, Dispatcher.FORWARD_CONTEXT_PATH, Dispatcher.FORWARD_SERVLET_PATH, Dispatcher.FORWARD_QUERY_STRING, Dispatcher.FORWARD_MAPPING); List requestAttributeNames = Collections.list(request.getAttributeNames()); @@ -857,7 +860,7 @@ public class DispatcherTest assertEquals("do=end", request.getAttribute(Dispatcher.INCLUDE_QUERY_STRING)); HttpServletMapping incMapping = (HttpServletMapping)request.getAttribute(Dispatcher.INCLUDE_MAPPING); assertNotNull(incMapping); - assertEquals("/AssertForwardIncludeServlet", incMapping.getMatchValue()); + assertEquals("/AssertForwardIncludeServlet", incMapping.getMatchValue()); List expectedAttributeNames = Arrays.asList(Dispatcher.FORWARD_REQUEST_URI, Dispatcher.FORWARD_CONTEXT_PATH, Dispatcher.FORWARD_SERVLET_PATH, Dispatcher.FORWARD_PATH_INFO, Dispatcher.FORWARD_QUERY_STRING, Dispatcher.FORWARD_MAPPING, diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ErrorPageTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ErrorPageTest.java index 16136b68336..915916ff866 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ErrorPageTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ErrorPageTest.java @@ -51,11 +51,12 @@ import org.eclipse.jetty.server.LocalConnector; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.HandlerWrapper; -import org.eclipse.jetty.util.log.Log; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -65,6 +66,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class ErrorPageTest { + private static final Logger LOG = LoggerFactory.getLogger(ErrorPageTest.class); + private Server _server; private LocalConnector _connector; private StacklessLogging _stackless; @@ -556,7 +559,7 @@ public class ErrorPageTest } catch (IllegalStateException e) { - Log.getLog().ignore(e); + LOG.trace("IGNORED", e); } finally { @@ -565,7 +568,7 @@ public class ErrorPageTest } catch (IOException e) { - Log.getLog().warn(e); + LOG.warn("Unable to send error", e); } }); hold.await(); @@ -604,7 +607,7 @@ public class ErrorPageTest } catch (Throwable ignore) { - Log.getLog().ignore(ignore); + LOG.trace("IGNORED", ignore); } } } diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ListenerHolderTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ListenerHolderTest.java index b2c25bc1592..cb3122a1850 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ListenerHolderTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ListenerHolderTest.java @@ -31,7 +31,7 @@ public class ListenerHolderTest public static class DummyListener implements EventListener { } - + @Test public void testCreateInstance() throws Exception { @@ -42,7 +42,7 @@ public class ListenerHolderTest holder.setHeldClass(DummyListener.class); EventListener listener = holder.createInstance(); assertNotNull(listener); - + //test with a ServletContextHandler Server server = new Server(); ServletContextHandler context = new ServletContextHandler(); diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/MultiPartServletTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/MultiPartServletTest.java index 0189d82b908..f1aa0338931 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/MultiPartServletTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/MultiPartServletTest.java @@ -41,11 +41,11 @@ import org.eclipse.jetty.server.MultiPartFormInputStream; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -54,7 +54,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class MultiPartServletTest { - private static final Logger LOG = Log.getLogger(MultiPartServletTest.class); + private static final Logger LOG = LoggerFactory.getLogger(MultiPartServletTest.class); private Server server; private ServerConnector connector; diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/PostServletTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/PostServletTest.java index 45786127a94..4e8f63a464f 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/PostServletTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/PostServletTest.java @@ -29,11 +29,11 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.server.LocalConnector; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class PostServletTest { - private static final Logger LOG = Log.getLogger(PostServletTest.class); + private static final Logger LOG = LoggerFactory.getLogger(PostServletTest.class); private static final AtomicBoolean posted = new AtomicBoolean(false); private static final AtomicReference ex0 = new AtomicReference<>(); private static final AtomicReference ex1 = new AtomicReference<>(); diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java index d5149b00ece..fdd6fab34cd 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java @@ -725,7 +725,7 @@ public class ServletContextHandlerTest { //A servlet cannot be added by another servlet Logger logger = LoggerFactory.getLogger(ContextHandler.class.getName() + "ROOT"); - + try (StacklessLogging stackless = new StacklessLogging(logger)) { ServletContextHandler context = new ServletContextHandler(); diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletRequestLogTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletRequestLogTest.java index eab3b2ed11b..0965236b8a4 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletRequestLogTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletRequestLogTest.java @@ -50,13 +50,13 @@ import org.eclipse.jetty.server.handler.ErrorHandler; import org.eclipse.jetty.server.handler.HandlerCollection; import org.eclipse.jetty.toolchain.test.IO; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.time.Duration.ofSeconds; import static org.hamcrest.MatcherAssert.assertThat; @@ -68,7 +68,7 @@ import static org.hamcrest.Matchers.is; @Disabled public class ServletRequestLogTest { - private static final Logger LOG = Log.getLogger(ServletRequestLogTest.class); + private static final Logger LOG = LoggerFactory.getLogger(ServletRequestLogTest.class); public static class CaptureLog extends AbstractLifeCycle implements RequestLog { diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletTester.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletTester.java index 1e075da00df..8236ba0935a 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletTester.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletTester.java @@ -35,13 +35,13 @@ import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.util.Attributes; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ServletTester extends ContainerLifeCycle { - private static final Logger LOG = Log.getLogger(ServletTester.class); + private static final Logger LOG = LoggerFactory.getLogger(ServletTester.class); private final Server _server = new Server(); private final LocalConnector _connector = new LocalConnector(_server); diff --git a/jetty-servlets/pom.xml b/jetty-servlets/pom.xml index 6854e8c3eb8..037337044db 100644 --- a/jetty-servlets/pom.xml +++ b/jetty-servlets/pom.xml @@ -63,7 +63,17 @@ jetty-io ${project.version} + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty jetty-jmx diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CGI.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CGI.java index 047d2966dad..1612344f5f6 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CGI.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CGI.java @@ -41,8 +41,8 @@ import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.MultiMap; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.UrlEncoded; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * CGI Servlet. @@ -72,7 +72,7 @@ public class CGI extends HttpServlet { private static final long serialVersionUID = -6182088932884791074L; - private static final Logger LOG = Log.getLogger(CGI.class); + private static final Logger LOG = LoggerFactory.getLogger(CGI.class); private boolean _ok; private File _docRoot; @@ -378,7 +378,7 @@ public class CGI extends HttpServlet } catch (IOException e) { - LOG.warn(e); + LOG.warn("Unable to copy error stream", e); } } }); @@ -445,17 +445,7 @@ public class CGI extends HttpServlet } finally { - if (os != null) - { - try - { - os.close(); - } - catch (Exception e) - { - LOG.debug(e); - } - } + IO.close(os); p.destroy(); // LOG.debug("CGI: terminated!"); async.complete(); @@ -478,7 +468,7 @@ public class CGI extends HttpServlet } catch (IOException e) { - LOG.debug(e); + LOG.debug("Unable to write out to CGI", e); } } }).start(); @@ -496,13 +486,14 @@ public class CGI extends HttpServlet { try { - OutputStream outToCgi = p.getOutputStream(); - IO.copy(input, outToCgi, len); - outToCgi.close(); + try (OutputStream outToCgi = p.getOutputStream()) + { + IO.copy(input, outToCgi, len); + } } catch (IOException e) { - LOG.debug(e); + LOG.debug("Unable to write out to CGI", e); } } }).start(); diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java index d1ae44c9878..5e055d1a24f 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java @@ -26,7 +26,6 @@ import java.util.Enumeration; import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.servlet.Filter; import javax.servlet.FilterChain; @@ -38,8 +37,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Implementation of the @@ -125,7 +124,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class CrossOriginFilter implements Filter { - private static final Logger LOG = Log.getLogger(CrossOriginFilter.class); + private static final Logger LOG = LoggerFactory.getLogger(CrossOriginFilter.class); // Request headers private static final String ORIGIN_HEADER = "Origin"; diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java index 335723a1790..ab4b85a0869 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java @@ -57,10 +57,10 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; import org.eclipse.jetty.util.annotation.Name; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Denial of Service filter @@ -127,7 +127,7 @@ import org.eclipse.jetty.util.thread.Scheduler; @ManagedObject("limits exposure to abuse from request flooding, whether malicious, or as a result of a misconfigured client") public class DoSFilter implements Filter { - private static final Logger LOG = Log.getLogger(DoSFilter.class); + private static final Logger LOG = LoggerFactory.getLogger(DoSFilter.class); private static final String IPv4_GROUP = "(\\d{1,3})"; private static final Pattern IPv4_PATTERN = Pattern.compile(IPv4_GROUP + "\\." + IPv4_GROUP + "\\." + IPv4_GROUP + "\\." + IPv4_GROUP); @@ -426,7 +426,7 @@ public class DoSFilter implements Filter } catch (InterruptedException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); response.sendError(getTooManyCode()); } finally @@ -498,14 +498,14 @@ public class DoSFilter implements Filter } catch (IllegalStateException ise) { - LOG.ignore(ise); + LOG.trace("IGNORED", ise); // abort instead response.sendError(-1); } } catch (Throwable x) { - LOG.info(x); + LOG.info("Failed to sendError", x); } handlingThread.interrupt(); @@ -749,7 +749,7 @@ public class DoSFilter implements Filter } catch (Exception x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } } diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/HeaderFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/HeaderFilter.java index a8c77b6b92c..642978d12e1 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/HeaderFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/HeaderFilter.java @@ -30,8 +30,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Header Filter @@ -57,7 +57,7 @@ import org.eclipse.jetty.util.log.Logger; public class HeaderFilter extends IncludeExcludeBasedFilter { private List _configuredHeaders = new ArrayList<>(); - private static final Logger LOG = Log.getLogger(HeaderFilter.class); + private static final Logger LOG = LoggerFactory.getLogger(HeaderFilter.class); @Override public void init(FilterConfig filterConfig) throws ServletException diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludeExcludeBasedFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludeExcludeBasedFilter.java index a9d994a64fc..ec66c9157e7 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludeExcludeBasedFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludeExcludeBasedFilter.java @@ -31,8 +31,8 @@ import org.eclipse.jetty.util.IncludeExclude; import org.eclipse.jetty.util.IncludeExcludeSet; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Include Exclude Based Filter @@ -72,7 +72,7 @@ public abstract class IncludeExcludeBasedFilter implements Filter private final IncludeExclude _mimeTypes = new IncludeExclude<>(); private final IncludeExclude _httpMethods = new IncludeExclude<>(); private final IncludeExclude _paths = new IncludeExclude<>(PathSpecSet.class); - private static final Logger LOG = Log.getLogger(IncludeExcludeBasedFilter.class); + private static final Logger LOG = LoggerFactory.getLogger(IncludeExcludeBasedFilter.class); @Override public void init(FilterConfig filterConfig) throws ServletException diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushCacheFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushCacheFilter.java index 8a1d8ee73b5..0f4c9eb714d 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushCacheFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushCacheFilter.java @@ -50,8 +50,8 @@ import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A filter that builds a cache of secondary resources associated @@ -75,7 +75,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Push cache based on the HTTP 'Referer' header") public class PushCacheFilter implements Filter { - private static final Logger LOG = Log.getLogger(PushCacheFilter.class); + private static final Logger LOG = LoggerFactory.getLogger(PushCacheFilter.class); private final Set _ports = new HashSet<>(); private final Set _hosts = new HashSet<>(); diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushSessionCacheFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushSessionCacheFilter.java index 4ec221eaf92..ecb6ed02144 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushSessionCacheFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushSessionCacheFilter.java @@ -39,15 +39,15 @@ import javax.servlet.http.PushBuilder; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpURI; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class PushSessionCacheFilter implements Filter { private static final String RESPONSE_ATTR = "PushSessionCacheFilter.response"; private static final String TARGET_ATTR = "PushSessionCacheFilter.target"; private static final String TIMESTAMP_ATTR = "PushSessionCacheFilter.timestamp"; - private static final Logger LOG = Log.getLogger(PushSessionCacheFilter.class); + private static final Logger LOG = LoggerFactory.getLogger(PushSessionCacheFilter.class); private final ConcurrentMap _cache = new ConcurrentHashMap<>(); private long _associateDelay = 5000L; diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java index d17d2cb6bf2..ba509e8f271 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java @@ -40,8 +40,8 @@ import javax.servlet.http.HttpSession; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Quality of Service Filter. @@ -78,7 +78,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Quality of Service Filter") public class QoSFilter implements Filter { - private static final Logger LOG = Log.getLogger(QoSFilter.class); + private static final Logger LOG = LoggerFactory.getLogger(QoSFilter.class); static final int __DEFAULT_MAX_PRIORITY = 10; static final int __DEFAULT_PASSES = 10; @@ -235,7 +235,7 @@ public class QoSFilter implements Filter } catch (IllegalStateException x) { - LOG.warn(x); + LOG.warn("Unable to resume suspended dispatch", x); continue; } } diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AsyncManipFilter.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AsyncManipFilter.java index c15d03b854d..8c8c74c8206 100644 --- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AsyncManipFilter.java +++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AsyncManipFilter.java @@ -29,8 +29,8 @@ import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Filter that merely manipulates the AsyncContext. @@ -40,7 +40,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class AsyncManipFilter implements Filter, AsyncListener { - private static final Logger LOG = Log.getLogger(AsyncManipFilter.class); + private static final Logger LOG = LoggerFactory.getLogger(AsyncManipFilter.class); private static final String MANIP_KEY = AsyncManipFilter.class.getName(); @Override diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipTester.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipTester.java index 0ea1dcdf51b..28959a4dc42 100644 --- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipTester.java +++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipTester.java @@ -51,9 +51,9 @@ import org.eclipse.jetty.toolchain.test.FS; import org.eclipse.jetty.toolchain.test.IO; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.toolchain.test.Sha1Sum; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.hamcrest.Matchers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -66,7 +66,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class GzipTester { - private static final Logger LOG = Log.getLogger(GzipTester.class); + private static final Logger LOG = LoggerFactory.getLogger(GzipTester.class); public static class ContentMetadata { diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/QoSFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/QoSFilterTest.java index 2bb16b6eb1c..a8c81a609f4 100644 --- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/QoSFilterTest.java +++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/QoSFilterTest.java @@ -40,13 +40,13 @@ import org.eclipse.jetty.server.LocalConnector; import org.eclipse.jetty.servlet.FilterHolder; import org.eclipse.jetty.servlet.ServletTester; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -54,7 +54,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class QoSFilterTest { - private static final Logger LOG = Log.getLogger(QoSFilterTest.class); + private static final Logger LOG = LoggerFactory.getLogger(QoSFilterTest.class); private ServletTester _tester; private LocalConnector[] _connectors; diff --git a/jetty-servlets/src/test/resources/test.svg b/jetty-servlets/src/test/resources/test.svg index 08fbae33514..6f65269c10b 100644 --- a/jetty-servlets/src/test/resources/test.svg +++ b/jetty-servlets/src/test/resources/test.svg @@ -1,46 +1,14 @@ - - - - - + + + + + - - + + maven-bundle-plugin true - + + osgi.serviceloader; filter:="(osgi.serviceloader=org.eclipse.jetty.util.security.CredentialProvider)";resolution:=optional;cardinality:=multiple, osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)";resolution:=optional + diff --git a/jetty-spring/pom.xml b/jetty-spring/pom.xml index 459c4b98159..ac54aed8a9b 100644 --- a/jetty-spring/pom.xml +++ b/jetty-spring/pom.xml @@ -56,12 +56,23 @@ spring-beans ${spring-version} + + org.slf4j + slf4j-api + org.eclipse.jetty jetty-server ${project.version} test + + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-spring/src/main/java/org/eclipse/jetty/spring/SpringConfigurationProcessor.java b/jetty-spring/src/main/java/org/eclipse/jetty/spring/SpringConfigurationProcessor.java index ce04eb7fb40..82ecf83a5ee 100644 --- a/jetty-spring/src/main/java/org/eclipse/jetty/spring/SpringConfigurationProcessor.java +++ b/jetty-spring/src/main/java/org/eclipse/jetty/spring/SpringConfigurationProcessor.java @@ -23,12 +23,12 @@ import java.util.Arrays; import java.util.Map; import java.util.ServiceLoader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.xml.ConfigurationProcessor; import org.eclipse.jetty.xml.ConfigurationProcessorFactory; import org.eclipse.jetty.xml.XmlConfiguration; import org.eclipse.jetty.xml.XmlParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.BeanWrapper; import org.springframework.beans.PropertyValues; import org.springframework.beans.factory.config.BeanDefinition; @@ -60,7 +60,7 @@ import org.springframework.core.io.UrlResource; */ public class SpringConfigurationProcessor implements ConfigurationProcessor { - private static final Logger LOG = Log.getLogger(SpringConfigurationProcessor.class); + private static final Logger LOG = LoggerFactory.getLogger(SpringConfigurationProcessor.class); private XmlConfiguration _configuration; private DefaultListableBeanFactory _beanFactory; diff --git a/jetty-unixsocket/jetty-unixsocket-client/pom.xml b/jetty-unixsocket/jetty-unixsocket-client/pom.xml index fc66c9e5dcc..28ea94f76f8 100644 --- a/jetty-unixsocket/jetty-unixsocket-client/pom.xml +++ b/jetty-unixsocket/jetty-unixsocket-client/pom.xml @@ -25,6 +25,10 @@ jetty-client ${project.version} + + org.slf4j + slf4j-api + org.eclipse.jetty @@ -32,6 +36,12 @@ ${project.version} test + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-unixsocket/jetty-unixsocket-client/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java b/jetty-unixsocket/jetty-unixsocket-client/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java index e731efa2365..b4b20bd61cc 100644 --- a/jetty-unixsocket/jetty-unixsocket-client/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java +++ b/jetty-unixsocket/jetty-unixsocket-client/src/main/java/org/eclipse/jetty/unixsocket/client/HttpClientTransportOverUnixSockets.java @@ -47,14 +47,14 @@ import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.ManagedSelector; import org.eclipse.jetty.io.SelectorManager; import org.eclipse.jetty.unixsocket.common.UnixSocketEndPoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // TODO: this class needs a thorough review. public class HttpClientTransportOverUnixSockets extends AbstractConnectorHttpClientTransport { - private static final Logger LOG = Log.getLogger(HttpClientTransportOverUnixSockets.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpClientTransportOverUnixSockets.class); private final ClientConnectionFactory factory = new HttpClientConnectionFactory(); diff --git a/jetty-unixsocket/jetty-unixsocket-client/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketTest.java b/jetty-unixsocket/jetty-unixsocket-client/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketTest.java index 48aadba2923..8add2ca82b3 100644 --- a/jetty-unixsocket/jetty-unixsocket-client/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketTest.java +++ b/jetty-unixsocket/jetty-unixsocket-client/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketTest.java @@ -38,12 +38,12 @@ import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.unixsocket.client.HttpClientTransportOverUnixSockets; import org.eclipse.jetty.unixsocket.server.UnixSocketConnector; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledOnOs; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -58,7 +58,7 @@ import static org.junit.jupiter.api.condition.OS.MAC; @EnabledOnOs({LINUX, MAC}) public class UnixSocketTest { - private static final Logger log = Log.getLogger(UnixSocketTest.class); + private static final Logger log = LoggerFactory.getLogger(UnixSocketTest.class); private Server server; private HttpClient httpClient; diff --git a/jetty-unixsocket/jetty-unixsocket-common/pom.xml b/jetty-unixsocket/jetty-unixsocket-common/pom.xml index 1667195b810..2469773e7ed 100644 --- a/jetty-unixsocket/jetty-unixsocket-common/pom.xml +++ b/jetty-unixsocket/jetty-unixsocket-common/pom.xml @@ -25,10 +25,20 @@ jetty-util ${project.version} + + org.slf4j + slf4j-api + com.github.jnr jnr-unixsocket + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + diff --git a/jetty-unixsocket/jetty-unixsocket-common/src/main/java/org/eclipse/jetty/unixsocket/common/UnixSocketEndPoint.java b/jetty-unixsocket/jetty-unixsocket-common/src/main/java/org/eclipse/jetty/unixsocket/common/UnixSocketEndPoint.java index b8af0e3abe7..29c3c11d5e9 100644 --- a/jetty-unixsocket/jetty-unixsocket-common/src/main/java/org/eclipse/jetty/unixsocket/common/UnixSocketEndPoint.java +++ b/jetty-unixsocket/jetty-unixsocket-common/src/main/java/org/eclipse/jetty/unixsocket/common/UnixSocketEndPoint.java @@ -25,13 +25,13 @@ import java.nio.channels.SelectionKey; import jnr.unixsocket.UnixSocketChannel; import org.eclipse.jetty.io.ChannelEndPoint; import org.eclipse.jetty.io.ManagedSelector; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UnixSocketEndPoint extends ChannelEndPoint { - private static final Logger LOG = Log.getLogger(UnixSocketEndPoint.class); + private static final Logger LOG = LoggerFactory.getLogger(UnixSocketEndPoint.class); private final UnixSocketChannel _channel; @@ -65,7 +65,7 @@ public class UnixSocketEndPoint extends ChannelEndPoint } catch (IOException e) { - LOG.debug(e); + LOG.debug("Unable to shutdown output", e); } } } diff --git a/jetty-unixsocket/jetty-unixsocket-server/src/main/java/org/eclipse/jetty/unixsocket/server/UnixSocketConnector.java b/jetty-unixsocket/jetty-unixsocket-server/src/main/java/org/eclipse/jetty/unixsocket/server/UnixSocketConnector.java index 377a443f79c..a83a5e8e47d 100644 --- a/jetty-unixsocket/jetty-unixsocket-server/src/main/java/org/eclipse/jetty/unixsocket/server/UnixSocketConnector.java +++ b/jetty-unixsocket/jetty-unixsocket-server/src/main/java/org/eclipse/jetty/unixsocket/server/UnixSocketConnector.java @@ -48,10 +48,10 @@ import org.eclipse.jetty.unixsocket.common.UnixSocketEndPoint; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.Name; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A server-side connector for UNIX sockets.

@@ -61,7 +61,7 @@ public class UnixSocketConnector extends AbstractConnector { // See SockAddrUnix.ADDR_LENGTH. public static final int MAX_UNIX_SOCKET_PATH_LENGTH = 107; - private static final Logger LOG = Log.getLogger(UnixSocketConnector.class); + private static final Logger LOG = LoggerFactory.getLogger(UnixSocketConnector.class); private final SelectorManager _manager; private String _unixSocket = "/tmp/jetty.sock"; @@ -242,7 +242,7 @@ public class UnixSocketConnector extends AbstractConnector } catch (IOException e) { - LOG.warn(e); + LOG.warn("Unable to close serverChannel: {}", serverChannel, e); } } @@ -252,7 +252,7 @@ public class UnixSocketConnector extends AbstractConnector } catch (IOException e) { - LOG.warn(e); + LOG.warn("Unable to delete UnixSocket at {}", _unixSocket, e); } } } diff --git a/jetty-util-ajax/pom.xml b/jetty-util-ajax/pom.xml index 6fcf4b1e14f..3f4a7e5d7d7 100644 --- a/jetty-util-ajax/pom.xml +++ b/jetty-util-ajax/pom.xml @@ -34,6 +34,17 @@ jetty-servlet-api provided
+ + org.slf4j + slf4j-api + + + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSON.java b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSON.java index ecc1f3406b4..5a786af11bc 100644 --- a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSON.java +++ b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSON.java @@ -32,8 +32,8 @@ import java.util.concurrent.ConcurrentHashMap; import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

JSON parser and generator.

@@ -82,7 +82,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class JSON { - static final Logger LOG = Log.getLogger(JSON.class); + static final Logger LOG = LoggerFactory.getLogger(JSON.class); private final Map _convertors = new ConcurrentHashMap<>(); private int _stringBufferSize = 1024; diff --git a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONDateConvertor.java b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONDateConvertor.java index e192dc4e08c..02540fefa81 100644 --- a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONDateConvertor.java +++ b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONDateConvertor.java @@ -27,8 +27,8 @@ import java.util.TimeZone; import org.eclipse.jetty.util.DateCache; import org.eclipse.jetty.util.ajax.JSON.Output; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Convert a {@link Date} to JSON. @@ -38,7 +38,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class JSONDateConvertor implements JSON.Convertor { - private static final Logger LOG = Log.getLogger(JSONDateConvertor.class); + private static final Logger LOG = LoggerFactory.getLogger(JSONDateConvertor.class); private final boolean _fromJSON; private final DateCache _dateCache; @@ -84,7 +84,7 @@ public class JSONDateConvertor implements JSON.Convertor } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to parse JSON Object", e); } return null; } diff --git a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONEnumConvertor.java b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONEnumConvertor.java index 077e47a3c84..a8753055ba1 100644 --- a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONEnumConvertor.java +++ b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONEnumConvertor.java @@ -22,8 +22,8 @@ import java.util.Map; import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.ajax.JSON.Output; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Convert an {@link Enum} to JSON. @@ -33,7 +33,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class JSONEnumConvertor implements JSON.Convertor { - private static final Logger LOG = Log.getLogger(JSONEnumConvertor.class); + private static final Logger LOG = LoggerFactory.getLogger(JSONEnumConvertor.class); private boolean _fromJSON; public JSONEnumConvertor() @@ -51,15 +51,17 @@ public class JSONEnumConvertor implements JSON.Convertor { if (!_fromJSON) throw new UnsupportedOperationException(); + + String clazzname = (String)map.get("class"); try { @SuppressWarnings({"rawtypes", "unchecked"}) - Class type = Loader.loadClass((String)map.get("class")); + Class type = Loader.loadClass(clazzname); return Enum.valueOf(type, (String)map.get("value")); } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to load class: {}", clazzname, e); return null; } } diff --git a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertor.java b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertor.java index 9e342c5e3de..3002213a196 100644 --- a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertor.java +++ b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertor.java @@ -29,8 +29,8 @@ import java.util.Map; import java.util.Set; import org.eclipse.jetty.util.ajax.JSON.Output; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Converts POJOs to JSON and vice versa.

@@ -43,7 +43,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class JSONPojoConvertor implements JSON.Convertor { - private static final Logger LOG = Log.getLogger(JSONPojoConvertor.class); + private static final Logger LOG = LoggerFactory.getLogger(JSONPojoConvertor.class); private static final Map, NumberType> __numberTypes = new HashMap<>(); private static final NumberType SHORT = Number::shortValue; private static final NumberType INTEGER = Number::intValue; @@ -344,7 +344,7 @@ public class JSONPojoConvertor implements JSON.Convertor catch (Exception e) { // Unusual array with multiple types. - LOG.ignore(e); + LOG.trace("IGNORED", e); _setter.invoke(obj, value); } } @@ -363,7 +363,7 @@ public class JSONPojoConvertor implements JSON.Convertor catch (Exception e) { // unusual array with multiple types - LOG.ignore(e); + LOG.trace("IGNORED", e); _setter.invoke(obj, value); } } diff --git a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactory.java b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactory.java index 164658755f1..7ccf6a8a31d 100644 --- a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactory.java +++ b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactory.java @@ -23,9 +23,12 @@ import java.util.Map; import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.ajax.JSON.Convertor; import org.eclipse.jetty.util.ajax.JSON.Output; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JSONPojoConvertorFactory implements JSON.Convertor { + private static final Logger LOG = LoggerFactory.getLogger(JSONPojoConvertorFactory.class); private final JSON _json; private final boolean _fromJson; @@ -79,7 +82,7 @@ public class JSONPojoConvertorFactory implements JSON.Convertor } catch (ClassNotFoundException e) { - JSON.LOG.warn(e); + LOG.warn("Unable to find class: " + clsName, e); } } if (convertor != null) diff --git a/jetty-util/pom.xml b/jetty-util/pom.xml index 90915e321cf..741117f0edf 100644 --- a/jetty-util/pom.xml +++ b/jetty-util/pom.xml @@ -69,6 +69,10 @@
+ + org.slf4j + slf4j-api + org.eclipse.jetty.toolchain jetty-perf-helper @@ -79,10 +83,6 @@ jetty-test-helper test - - org.slf4j - slf4j-api - org.eclipse.jetty jetty-slf4j-impl diff --git a/jetty-util/src/main/java/module-info.java b/jetty-util/src/main/java/module-info.java index 1a175df1218..9fbb9f84c11 100644 --- a/jetty-util/src/main/java/module-info.java +++ b/jetty-util/src/main/java/module-info.java @@ -35,6 +35,8 @@ module org.eclipse.jetty.util // Required by SSL code (for X509). requires transitive java.naming; + + // Standard Jetty Logging now. requires org.slf4j; // Only required if using AppContextLeakPreventer/AWTLeakPreventer. diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/BufferUtil.java b/jetty-util/src/main/java/org/eclipse/jetty/util/BufferUtil.java index ba7003737d1..4e8fdc67d5e 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/BufferUtil.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/BufferUtil.java @@ -33,8 +33,9 @@ import java.nio.charset.StandardCharsets; import java.nio.file.StandardOpenOption; import java.util.Arrays; -import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Buffer utility methods. @@ -93,15 +94,17 @@ import org.eclipse.jetty.util.resource.Resource; */ public class BufferUtil { + private static final Logger LOG = LoggerFactory.getLogger(BufferUtil.class); + static final int TEMP_BUFFER_SIZE = 4096; static final byte SPACE = 0x20; static final byte MINUS = '-'; static final byte[] DIGIT = - { - (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', (byte)'7', (byte)'8', (byte)'9', - (byte)'A', (byte)'B', (byte)'C', (byte)'D', - (byte)'E', (byte)'F' - }; + { + (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', (byte)'7', (byte)'8', (byte)'9', + (byte)'A', (byte)'B', (byte)'C', (byte)'D', + (byte)'E', (byte)'F' + }; public static final ByteBuffer EMPTY_BUFFER = ByteBuffer.wrap(new byte[0]); @@ -1175,7 +1178,7 @@ public class BufferUtil } catch (Throwable x) { - Log.getRootLogger().ignore(x); + LOG.trace("IGNORED", x); buf.append("!!concurrent mod!!"); } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/DecoratedObjectFactory.java b/jetty-util/src/main/java/org/eclipse/jetty/util/DecoratedObjectFactory.java index 8ff97741a66..1cdab5b6ce7 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/DecoratedObjectFactory.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/DecoratedObjectFactory.java @@ -24,8 +24,8 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * An ObjectFactory enhanced by {@link Decorator} instances. @@ -39,14 +39,14 @@ import org.eclipse.jetty.util.log.Logger; */ public class DecoratedObjectFactory implements Iterable { - private static final Logger LOG = Log.getLogger(DecoratedObjectFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(DecoratedObjectFactory.class); /** * ServletContext attribute for the active DecoratedObjectFactory */ public static final String ATTR = DecoratedObjectFactory.class.getName(); - - private static final ThreadLocal decoratorInfo = new ThreadLocal<>(); + + private static final ThreadLocal decoratorInfo = new ThreadLocal<>(); private List decorators = new ArrayList<>(); @@ -54,17 +54,17 @@ public class DecoratedObjectFactory implements Iterable { decoratorInfo.set(info); } - + public static void disassociateInfo() { decoratorInfo.set(null); } - + public static Object getAssociatedInfo() { return decoratorInfo.get(); } - + public void addDecorator(Decorator decorator) { LOG.debug("Adding Decorator: {}", decorator); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/DeprecationWarning.java b/jetty-util/src/main/java/org/eclipse/jetty/util/DeprecationWarning.java index c5522aaac83..1212d61327d 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/DeprecationWarning.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/DeprecationWarning.java @@ -18,12 +18,12 @@ package org.eclipse.jetty.util; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class DeprecationWarning implements Decorator { - private static final Logger LOG = Log.getLogger(DeprecationWarning.class); + private static final Logger LOG = LoggerFactory.getLogger(DeprecationWarning.class); @Override public T decorate(T o) @@ -45,7 +45,7 @@ public class DeprecationWarning implements Decorator } catch (Throwable t) { - LOG.ignore(t); + LOG.trace("IGNORED", t); } verifyIndirectTypes(clazz.getSuperclass(), clazz, "Class"); @@ -75,7 +75,7 @@ public class DeprecationWarning implements Decorator } catch (Throwable t) { - LOG.ignore(t); + LOG.trace("IGNORED", t); } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/HostPort.java b/jetty-util/src/main/java/org/eclipse/jetty/util/HostPort.java index 6337fec7e01..c3af962219b 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/HostPort.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/HostPort.java @@ -165,7 +165,6 @@ public class HostPort * * @param rawPort the port string. * @return the integer value for the port. - * @throws IllegalArgumentException */ public static int parsePort(String rawPort) throws IllegalArgumentException { diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java b/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java index 5f6861295c4..223833a5c02 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java @@ -35,8 +35,8 @@ import java.nio.ByteBuffer; import java.nio.channels.GatheringByteChannel; import java.nio.charset.Charset; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * IO Utilities. @@ -45,7 +45,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class IO { - private static final Logger LOG = Log.getLogger(IO.class); + private static final Logger LOG = LoggerFactory.getLogger(IO.class); public static final String CRLF = "\r\n"; @@ -90,7 +90,7 @@ public class IO } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); try { if (out != null) @@ -100,7 +100,7 @@ public class IO } catch (IOException e2) { - LOG.ignore(e2); + LOG.trace("IGNORED", e2); } } } @@ -372,7 +372,7 @@ public class IO } catch (IOException ignore) { - LOG.ignore(ignore); + LOG.trace("IGNORED", ignore); } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Jetty.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Jetty.java index dd79eadc762..5baa6556e67 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/Jetty.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Jetty.java @@ -22,12 +22,12 @@ import java.io.InputStream; import java.time.Instant; import java.util.Properties; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Jetty { - private static final Logger LOG = Log.getLogger(Jetty.class); + private static final Logger LOG = LoggerFactory.getLogger(Jetty.class); public static final String VERSION; public static final String POWERED_BY; @@ -52,7 +52,7 @@ public class Jetty } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } String gitHash = __buildProperties.getProperty("buildNumber", "unknown"); @@ -91,7 +91,7 @@ public class Jetty } catch (NumberFormatException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return "unknown"; } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/LeakDetector.java b/jetty-util/src/main/java/org/eclipse/jetty/util/LeakDetector.java index 82b2c9313f5..715779eaa30 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/LeakDetector.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/LeakDetector.java @@ -25,8 +25,8 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A facility to detect improper usage of resource pools. @@ -59,7 +59,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class LeakDetector extends AbstractLifeCycle implements Runnable { - private static final Logger LOG = Log.getLogger(LeakDetector.class); + private static final Logger LOG = LoggerFactory.getLogger(LeakDetector.class); private final ReferenceQueue queue = new ReferenceQueue<>(); private final ConcurrentMap resources = new ConcurrentHashMap<>(); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/PathWatcher.java b/jetty-util/src/main/java/org/eclipse/jetty/util/PathWatcher.java index 66b6979b0fb..7f134eae691 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/PathWatcher.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/PathWatcher.java @@ -49,8 +49,8 @@ import java.util.function.Predicate; import java.util.stream.Stream; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE; import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE; @@ -453,7 +453,7 @@ public class PathWatcher extends AbstractLifeCycle implements Runnable } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return DirAction.IGNORE; } } @@ -475,7 +475,7 @@ public class PathWatcher extends AbstractLifeCycle implements Runnable } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return false; } } @@ -715,7 +715,7 @@ public class PathWatcher extends AbstractLifeCycle implements Runnable } } - static final Logger LOG = Log.getLogger(PathWatcher.class); + static final Logger LOG = LoggerFactory.getLogger(PathWatcher.class); @SuppressWarnings("unchecked") protected static WatchEvent cast(WatchEvent event) @@ -938,7 +938,7 @@ public class PathWatcher extends AbstractLifeCycle implements Runnable catch (Throwable t) { // Unknown JVM environment, assuming native. - LOG.ignore(t); + LOG.trace("IGNORED", t); } this.watchModifiers = modifiers; @@ -1157,11 +1157,11 @@ public class PathWatcher extends AbstractLifeCycle implements Runnable { if (isRunning()) { - LOG.warn(e); + LOG.warn("Watch failed", e); } else { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } } @@ -1220,7 +1220,7 @@ public class PathWatcher extends AbstractLifeCycle implements Runnable } catch (IOException e) { - LOG.warn(e); + LOG.warn("Unable to register", e); } } } @@ -1326,7 +1326,7 @@ public class PathWatcher extends AbstractLifeCycle implements Runnable } catch (Throwable t) { - LOG.warn(t); + LOG.warn("Unable to notify PathWatch Events", t); } } else @@ -1349,7 +1349,7 @@ public class PathWatcher extends AbstractLifeCycle implements Runnable } catch (Throwable t) { - LOG.warn(t); + LOG.warn("Unable to notify PathWatch Events", t); } } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Promise.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Promise.java index c3e4161b625..feb700400ab 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/Promise.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Promise.java @@ -21,7 +21,7 @@ package org.eclipse.jetty.util; import java.util.Objects; import java.util.concurrent.CompletableFuture; -import org.eclipse.jetty.util.log.Log; +import org.slf4j.LoggerFactory; /** *

A callback abstraction that handles completed/failed events of asynchronous operations.

@@ -59,7 +59,7 @@ public interface Promise @Override public void failed(Throwable x) { - Log.getLogger(this.getClass()).warn(x); + LoggerFactory.getLogger(this.getClass()).warn("Failed", x); } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Scanner.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Scanner.java index 92326b11da1..2ac15ca7b2c 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/Scanner.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Scanner.java @@ -43,8 +43,8 @@ import java.util.TimerTask; import java.util.function.Predicate; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Scanner @@ -63,8 +63,8 @@ public class Scanner extends AbstractLifeCycle */ public static final int DEFAULT_SCAN_DEPTH = 1; public static final int MAX_SCAN_DEPTH = Integer.MAX_VALUE; - - private static final Logger LOG = Log.getLogger(Scanner.class); + + private static final Logger LOG = LoggerFactory.getLogger(Scanner.class); private static int __scannerId = 0; private int _scanInterval; private int _scanCount = 0; @@ -235,7 +235,7 @@ public class Scanner extends AbstractLifeCycle @Override public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { - LOG.warn(exc); + LOG.warn("FileVisit failed: " + file, exc); return FileVisitResult.CONTINUE; } @@ -338,7 +338,7 @@ public class Scanner extends AbstractLifeCycle } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to add: " + dir, e); } } @@ -652,7 +652,7 @@ public class Scanner extends AbstractLifeCycle } catch (Throwable e) { - LOG.warn(e); + LOG.warn("Unable to scan", e); } } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java b/jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java index 4901699a0aa..ed189c5875d 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java @@ -26,8 +26,8 @@ import java.util.concurrent.TimeoutException; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Provides a reusable {@link Callback} that can block the thread @@ -47,7 +47,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class SharedBlockingCallback { - private static final Logger LOG = Log.getLogger(SharedBlockingCallback.class); + private static final Logger LOG = LoggerFactory.getLogger(SharedBlockingCallback.class); private static Throwable IDLE = new ConstantThrowable("IDLE"); private static Throwable SUCCEEDED = new ConstantThrowable("SUCCEEDED"); @@ -85,7 +85,7 @@ public class SharedBlockingCallback { LOG.warn("Blocker not complete {}", blocker); if (LOG.isDebugEnabled()) - LOG.debug(new Throwable()); + LOG.debug("Blocker not complete stacktrace", new Throwable()); } /** @@ -124,7 +124,7 @@ public class SharedBlockingCallback { LOG.warn("Succeeded after {}", _state.toString()); if (LOG.isDebugEnabled()) - LOG.debug(_state); + LOG.debug("State", _state); } } finally @@ -157,11 +157,12 @@ public class SharedBlockingCallback } else { - LOG.warn("Failed after {}: {}", _state, cause); + String msg = String.format("Failed after %s: %s", _state, cause); + LOG.warn(msg); if (LOG.isDebugEnabled()) { - LOG.debug(_state); - LOG.debug(cause); + LOG.debug(msg, _state); + LOG.debug(msg, cause); } } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/SocketAddressResolver.java b/jetty-util/src/main/java/org/eclipse/jetty/util/SocketAddressResolver.java index 41b00d91e94..af21b5ce70d 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/SocketAddressResolver.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/SocketAddressResolver.java @@ -31,9 +31,9 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Creates {@link SocketAddress} instances, returning them through a {@link Promise}.

@@ -107,7 +107,7 @@ public interface SocketAddressResolver @ManagedObject("The asynchronous address resolver") public static class Async implements SocketAddressResolver { - private static final Logger LOG = Log.getLogger(SocketAddressResolver.class); + private static final Logger LOG = LoggerFactory.getLogger(SocketAddressResolver.class); private final Executor executor; private final Scheduler scheduler; diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java b/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java index bb3b80ca2ce..615c4194e41 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java @@ -43,8 +43,8 @@ import java.util.Iterator; import java.util.List; import java.util.Optional; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.lang.invoke.MethodType.methodType; @@ -57,7 +57,7 @@ import static java.lang.invoke.MethodType.methodType; */ public class TypeUtil { - private static final Logger LOG = Log.getLogger(TypeUtil.class); + private static final Logger LOG = LoggerFactory.getLogger(TypeUtil.class); public static final Class[] NO_ARGS = new Class[]{}; public static final int CR = '\r'; public static final int LF = '\n'; @@ -309,13 +309,13 @@ public class TypeUtil } catch (NoSuchMethodException | IllegalAccessException | InstantiationException x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } catch (InvocationTargetException x) { if (x.getTargetException() instanceof Error) throw (Error)x.getTargetException(); - LOG.ignore(x); + LOG.trace("IGNORED", x); } return null; } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java b/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java index 05ae41d7a3a..1909e102242 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java @@ -24,8 +24,8 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import org.eclipse.jetty.util.Utf8Appendable.NotUtf8Exception; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * URI Utility methods. @@ -41,7 +41,7 @@ import org.eclipse.jetty.util.log.Logger; public class URIUtil implements Cloneable { - private static final Logger LOG = Log.getLogger(URIUtil.class); + private static final Logger LOG = LoggerFactory.getLogger(URIUtil.class); public static final String SLASH = "/"; public static final String HTTP = "http"; public static final String HTTPS = "https"; diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java b/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java index 34dfd80c925..32ff9592f67 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java @@ -27,8 +27,8 @@ import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.eclipse.jetty.util.TypeUtil.convertHexDigit; @@ -58,21 +58,30 @@ import static org.eclipse.jetty.util.TypeUtil.convertHexDigit; @SuppressWarnings("serial") public class UrlEncoded extends MultiMap implements Cloneable { - static final Logger LOG = Log.getLogger(UrlEncoded.class); + static final Logger LOG = LoggerFactory.getLogger(UrlEncoded.class); public static final Charset ENCODING; static { Charset encoding; + String charset = null; try { - String charset = System.getProperty("org.eclipse.jetty.util.UrlEncoding.charset"); - encoding = charset == null ? StandardCharsets.UTF_8 : Charset.forName(charset); + charset = System.getProperty("org.eclipse.jetty.util.UrlEncoding.charset"); + if (charset == null) + { + charset = StandardCharsets.UTF_8.toString(); + encoding = StandardCharsets.UTF_8; + } + else + { + encoding = Charset.forName(charset); + } } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to set default UrlEncoding charset: " + charset, e); encoding = StandardCharsets.UTF_8; } ENCODING = encoding; diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8Appendable.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8Appendable.java index 41468849627..9981a8be623 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8Appendable.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8Appendable.java @@ -21,8 +21,8 @@ package org.eclipse.jetty.util; import java.io.IOException; import java.nio.ByteBuffer; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Utf8 Appendable abstract base class @@ -49,7 +49,7 @@ import org.eclipse.jetty.util.log.Logger; **/ public abstract class Utf8Appendable { - protected static final Logger LOG = Log.getLogger(Utf8Appendable.class); + protected static final Logger LOG = LoggerFactory.getLogger(Utf8Appendable.class); // @checkstyle-disable-check : AvoidEscapedUnicodeCharactersCheck public static final char REPLACEMENT = '\ufffd'; // @checkstyle-enable-check : AvoidEscapedUnicodeCharactersCheck @@ -328,7 +328,7 @@ public abstract class Utf8Appendable } Throwable th = new NotUtf8Exception("incomplete UTF8 sequence"); LOG.warn(th.toString()); - LOG.debug(th); + LOG.debug("Unable to get replacement string", th); } return _appendable.toString(); } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/AbstractLifeCycle.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/AbstractLifeCycle.java index 39dca100a4a..8925683b128 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/AbstractLifeCycle.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/AbstractLifeCycle.java @@ -26,8 +26,8 @@ import java.util.concurrent.CopyOnWriteArrayList; import org.eclipse.jetty.util.Uptime; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Basic implementation of the life cycle interface for components. @@ -35,7 +35,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Abstract Implementation of LifeCycle") public abstract class AbstractLifeCycle implements LifeCycle { - private static final Logger LOG = Log.getLogger(AbstractLifeCycle.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractLifeCycle.class); enum State { @@ -99,7 +99,7 @@ public abstract class AbstractLifeCycle implements LifeCycle catch (StopException e) { if (LOG.isDebugEnabled()) - LOG.debug(e); + LOG.debug("Unable to stop", e); setStopping(); doStop(); setStopped(); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/ContainerLifeCycle.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/ContainerLifeCycle.java index 82c5691f8be..9d61932492a 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/ContainerLifeCycle.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/ContainerLifeCycle.java @@ -31,8 +31,8 @@ import java.util.concurrent.CopyOnWriteArrayList; import org.eclipse.jetty.util.MultiException; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A ContainerLifeCycle is an {@link LifeCycle} implementation for a collection of contained beans. @@ -82,7 +82,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Implementation of Container and LifeCycle") public class ContainerLifeCycle extends AbstractLifeCycle implements Container, Destroyable, Dumpable { - private static final Logger LOG = Log.getLogger(ContainerLifeCycle.class); + private static final Logger LOG = LoggerFactory.getLogger(ContainerLifeCycle.class); private final List _beans = new CopyOnWriteArrayList<>(); private final List _listeners = new CopyOnWriteArrayList<>(); private boolean _doStarted; @@ -236,7 +236,7 @@ public class ContainerLifeCycle extends AbstractLifeCycle implements Container, } catch (Throwable th) { - LOG.warn(th); + LOG.warn("Unable to destroy", th); } } } @@ -711,7 +711,7 @@ public class ContainerLifeCycle extends AbstractLifeCycle implements Container, } catch (IOException e) { - LOG.warn(e); + LOG.warn("Unable to dump", e); } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/FileDestroyable.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/FileDestroyable.java index 48f32cf61a7..2550fe99c9f 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/FileDestroyable.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/FileDestroyable.java @@ -25,13 +25,13 @@ import java.util.Collection; import java.util.List; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class FileDestroyable implements Destroyable { - private static final Logger LOG = Log.getLogger(FileDestroyable.class); + private static final Logger LOG = LoggerFactory.getLogger(FileDestroyable.class); final List _files = new ArrayList(); public FileDestroyable() diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/FileNoticeLifeCycleListener.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/FileNoticeLifeCycleListener.java index e9b3af8ca5f..c2adf9f265c 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/FileNoticeLifeCycleListener.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/FileNoticeLifeCycleListener.java @@ -21,8 +21,8 @@ package org.eclipse.jetty.util.component; import java.io.FileWriter; import java.io.Writer; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A LifeCycle Listener that writes state changes to a file. @@ -30,7 +30,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class FileNoticeLifeCycleListener implements LifeCycle.Listener { - private static final Logger LOG = Log.getLogger(FileNoticeLifeCycleListener.class); + private static final Logger LOG = LoggerFactory.getLogger(FileNoticeLifeCycleListener.class); private final String _filename; @@ -47,7 +47,7 @@ public class FileNoticeLifeCycleListener implements LifeCycle.Listener } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to write state", e); } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/Graceful.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/Graceful.java index c02a18eba6f..164a702c99d 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/Graceful.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/Graceful.java @@ -24,8 +24,8 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicReference; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Jetty components that wish to be part of a Graceful shutdown implement this interface so that @@ -124,7 +124,7 @@ public interface Graceful */ static CompletableFuture shutdown(Container component) { - Logger log = Log.getLogger(component.getClass()); + Logger log = LoggerFactory.getLogger(component.getClass()); log.info("Shutdown {}", component); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/StopLifeCycle.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/StopLifeCycle.java index eb2cc1b7bc3..95d89f33d4e 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/StopLifeCycle.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/StopLifeCycle.java @@ -18,15 +18,15 @@ package org.eclipse.jetty.util.component; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A LifeCycle that when started will stop another LifeCycle */ public class StopLifeCycle extends AbstractLifeCycle implements LifeCycle.Listener { - private static final Logger LOG = Log.getLogger(StopLifeCycle.class); + private static final Logger LOG = LoggerFactory.getLogger(StopLifeCycle.class); private final LifeCycle _lifecycle; @@ -50,7 +50,7 @@ public class StopLifeCycle extends AbstractLifeCycle implements LifeCycle.Listen } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to stop", e); } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AbstractLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AbstractLeakPreventer.java index 7c0ba362fe4..51cd4d85a4d 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AbstractLeakPreventer.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AbstractLeakPreventer.java @@ -19,8 +19,8 @@ package org.eclipse.jetty.util.preventers; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * AbstractLeakPreventer @@ -35,7 +35,7 @@ import org.eclipse.jetty.util.log.Logger; */ public abstract class AbstractLeakPreventer extends AbstractLifeCycle { - protected static final Logger LOG = Log.getLogger(AbstractLeakPreventer.class); + protected static final Logger LOG = LoggerFactory.getLogger(AbstractLeakPreventer.class); public abstract void prevent(ClassLoader loader); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/DOMLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/DOMLeakPreventer.java index f228536328c..3e63d2da750 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/DOMLeakPreventer.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/DOMLeakPreventer.java @@ -44,7 +44,7 @@ public class DOMLeakPreventer extends AbstractLeakPreventer } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to ping document builder", e); } } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/GCThreadLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/GCThreadLeakPreventer.java index 7743d0918da..a30382045d2 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/GCThreadLeakPreventer.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/GCThreadLeakPreventer.java @@ -49,11 +49,11 @@ public class GCThreadLeakPreventer extends AbstractLeakPreventer } catch (ClassNotFoundException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to set GC latency", e); } } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/Java2DLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/Java2DLeakPreventer.java index 073bddf3e59..8682f639875 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/Java2DLeakPreventer.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/Java2DLeakPreventer.java @@ -38,7 +38,7 @@ public class Java2DLeakPreventer extends AbstractLeakPreventer } catch (ClassNotFoundException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LDAPLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LDAPLeakPreventer.java index 696e603c913..88d605c6577 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LDAPLeakPreventer.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LDAPLeakPreventer.java @@ -40,7 +40,7 @@ public class LDAPLeakPreventer extends AbstractLeakPreventer } catch (ClassNotFoundException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LoginConfigurationLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LoginConfigurationLeakPreventer.java index 567a3d55d49..e622450c74d 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LoginConfigurationLeakPreventer.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LoginConfigurationLeakPreventer.java @@ -39,7 +39,7 @@ public class LoginConfigurationLeakPreventer extends AbstractLeakPreventer } catch (ClassNotFoundException e) { - LOG.warn(e); + LOG.warn("Unable to load login config", e); } } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java index c53677bc845..ef488981ff8 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java @@ -30,12 +30,12 @@ import java.util.jar.JarEntry; import java.util.jar.JarFile; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JarFileResource extends JarResource { - private static final Logger LOG = Log.getLogger(JarFileResource.class); + private static final Logger LOG = LoggerFactory.getLogger(JarFileResource.class); private JarFile _jarFile; private File _file; private String[] _list; @@ -71,7 +71,7 @@ public class JarFileResource extends JarResource } catch (IOException ioe) { - LOG.ignore(ioe); + LOG.trace("IGNORED", ioe); } } } @@ -138,7 +138,7 @@ public class JarFileResource extends JarResource } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return false; } } @@ -172,7 +172,7 @@ public class JarFileResource extends JarResource } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } @@ -217,7 +217,7 @@ public class JarFileResource extends JarResource } catch (IOException ioe) { - LOG.ignore(ioe); + LOG.trace("IGNORED", ioe); } } } @@ -271,7 +271,7 @@ public class JarFileResource extends JarResource //by other code. //So, do one retry to drop a connection and get a fresh JarFile LOG.warn("Retrying list:" + e); - LOG.debug(e); + LOG.debug("JarFile list failure", e); close(); list = listEntries(); } @@ -303,7 +303,7 @@ public class JarFileResource extends JarResource { e.printStackTrace(); - LOG.ignore(e); + LOG.trace("IGNORED", e); } if (jarFile == null) throw new IllegalStateException(); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarResource.java index 287af534bd3..ec7e925aec3 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarResource.java @@ -34,12 +34,12 @@ import java.util.jar.Manifest; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JarResource extends URLResource { - private static final Logger LOG = Log.getLogger(JarResource.class); + private static final Logger LOG = LoggerFactory.getLogger(JarResource.class); protected JarURLConnection _jarConnection; protected JarResource(URL url) @@ -70,7 +70,7 @@ public class JarResource extends URLResource } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); _jarConnection = null; } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java index 2f6a40891ac..23e4a5ad7ed 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java @@ -21,12 +21,10 @@ package org.eclipse.jetty.util.resource; import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import java.nio.ByteBuffer; import java.nio.channels.ReadableByteChannel; import java.nio.channels.SeekableByteChannel; import java.nio.file.DirectoryIteratorException; @@ -42,19 +40,18 @@ import java.nio.file.attribute.FileTime; import java.util.ArrayList; import java.util.List; -import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Java NIO Path Resource. */ public class PathResource extends Resource { - private static final Logger LOG = Log.getLogger(PathResource.class); + private static final Logger LOG = LoggerFactory.getLogger(PathResource.class); private static final LinkOption[] NO_FOLLOW_LINKS = new LinkOption[]{LinkOption.NOFOLLOW_LINKS}; private static final LinkOption[] FOLLOW_LINKS = new LinkOption[]{}; @@ -87,7 +84,7 @@ public class PathResource extends Resource // If the toRealPath() call fails, then let // the alias checking routines continue on // to other techniques. - LOG.ignore(ignored); + LOG.trace("IGNORED", ignored); } } @@ -112,7 +109,7 @@ public class PathResource extends Resource } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } catch (Exception e) { @@ -285,7 +282,7 @@ public class PathResource extends Resource } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); throw new IOException("Unable to build Path from: " + uri, e); } @@ -364,7 +361,7 @@ public class PathResource extends Resource } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return false; } } @@ -489,7 +486,7 @@ public class PathResource extends Resource } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return 0; } } @@ -556,11 +553,11 @@ public class PathResource extends Resource } catch (DirectoryIteratorException e) { - LOG.debug(e); + LOG.debug("Directory list failure", e); } catch (IOException e) { - LOG.debug(e); + LOG.debug("Directory list access failure", e); } return null; } @@ -578,7 +575,7 @@ public class PathResource extends Resource } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return false; } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java index 2a53c8ab495..e6644971d00 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java @@ -44,8 +44,8 @@ import org.eclipse.jetty.util.MultiMap; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.UrlEncoded; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.nio.charset.StandardCharsets.UTF_8; @@ -58,7 +58,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; */ public abstract class Resource implements ResourceFactory, Closeable { - private static final Logger LOG = Log.getLogger(Resource.class); + private static final Logger LOG = LoggerFactory.getLogger(Resource.class); public static boolean __defaultUseCaches = true; volatile Object _associate; @@ -124,7 +124,7 @@ public abstract class Resource implements ResourceFactory, Closeable catch (Exception e) { LOG.warn(e.toString()); - LOG.debug(Log.EXCEPTION, e); + LOG.debug("Bad PathResource: " + url, e); return new BadResource(url, e.toString()); } } @@ -239,7 +239,7 @@ public abstract class Resource implements ResourceFactory, Closeable } catch (IllegalArgumentException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); // Catches scenario where a bad Windows path like "C:\dev" is // improperly escaped, which various downstream classloaders // tend to have a problem with @@ -442,7 +442,7 @@ public abstract class Resource implements ResourceFactory, Closeable } catch (Exception e) { - LOG.debug(e); + LOG.debug("Unable to addPath", e); return null; } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResource.java index 69f274e0c34..7561dd88b05 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResource.java @@ -29,15 +29,15 @@ import java.net.URLConnection; import java.nio.channels.ReadableByteChannel; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * URL resource class. */ public class URLResource extends Resource { - private static final Logger LOG = Log.getLogger(URLResource.class); + private static final Logger LOG = LoggerFactory.getLogger(URLResource.class); protected final URL _url; protected final String _urlString; @@ -69,7 +69,7 @@ public class URLResource extends Resource } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } return _connection != null; @@ -89,7 +89,7 @@ public class URLResource extends Resource } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } _in = null; } @@ -114,7 +114,7 @@ public class URLResource extends Resource } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } return _in != null; } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/security/CertificateValidator.java b/jetty-util/src/main/java/org/eclipse/jetty/util/security/CertificateValidator.java index 66255023ab6..d22cd559649 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/security/CertificateValidator.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/security/CertificateValidator.java @@ -39,8 +39,8 @@ import java.util.Collection; import java.util.Enumeration; import java.util.concurrent.atomic.AtomicLong; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Convenience class to handle validation of certificates, aliases and keystores @@ -54,7 +54,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class CertificateValidator { - private static final Logger LOG = Log.getLogger(CertificateValidator.class); + private static final Logger LOG = LoggerFactory.getLogger(CertificateValidator.class); private static AtomicLong __aliasCount = new AtomicLong(); private KeyStore _trustStore; @@ -139,7 +139,7 @@ public class CertificateValidator } catch (KeyStoreException kse) { - LOG.debug(kse); + LOG.debug("Unable to validate alias:" + keyAlias, kse); throw new CertificateException("Unable to validate certificate" + " for alias [" + keyAlias + "]: " + kse.getMessage(), kse); } @@ -187,7 +187,7 @@ public class CertificateValidator } catch (KeyStoreException kse) { - LOG.debug(kse); + LOG.debug("Unable to validate certificate", kse); throw new CertificateException("Unable to validate certificate" + (certAlias == null ? "" : " for alias [" + certAlias + "]") + ": " + kse.getMessage(), kse); } @@ -257,7 +257,7 @@ public class CertificateValidator } catch (GeneralSecurityException gse) { - LOG.debug(gse); + LOG.debug("Unable to validate certificate chain", gse); throw new CertificateException("Unable to validate certificate: " + gse.getMessage(), gse); } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/security/Credential.java b/jetty-util/src/main/java/org/eclipse/jetty/util/security/Credential.java index 1876016dd9d..d8a832c119c 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/security/Credential.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/security/Credential.java @@ -24,8 +24,8 @@ import java.security.MessageDigest; import java.util.ServiceLoader; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Credentials. The Credential class represents an abstract mechanism for checking authentication credentials. A credential instance either represents a secret, @@ -41,7 +41,7 @@ import org.eclipse.jetty.util.log.Logger; public abstract class Credential implements Serializable { private static final long serialVersionUID = -7760551052768181572L; - private static final Logger LOG = Log.getLogger(Credential.class); + private static final Logger LOG = LoggerFactory.getLogger(Credential.class); private static final ServiceLoader CREDENTIAL_PROVIDER_LOADER = ServiceLoader.load(CredentialProvider.class); /** @@ -234,7 +234,7 @@ public abstract class Credential implements Serializable } catch (Exception e) { - LOG.warn(e); + LOG.warn("Failed message digest", e); return false; } } @@ -262,7 +262,7 @@ public abstract class Credential implements Serializable } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to access MD5 message digest", e); return null; } } @@ -276,7 +276,7 @@ public abstract class Credential implements Serializable } catch (Exception e) { - LOG.warn(e); + LOG.warn("Message Digest failure", e); return null; } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/security/Password.java b/jetty-util/src/main/java/org/eclipse/jetty/util/security/Password.java index 20dd31e83e9..9e45343566e 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/security/Password.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/security/Password.java @@ -22,8 +22,8 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Locale; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Password utility class. @@ -52,7 +52,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class Password extends Credential { - private static final Logger LOG = Log.getLogger(Password.class); + private static final Logger LOG = LoggerFactory.getLogger(Password.class); private static final long serialVersionUID = 5062906681431569445L; @@ -229,7 +229,7 @@ public class Password extends Credential } catch (IOException e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("EXCEPTION", e); } if (passwd == null || passwd.length() == 0) passwd = promptDft; diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SniX509ExtendedKeyManager.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SniX509ExtendedKeyManager.java index 03b8afe26c7..ba9e8119b5f 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SniX509ExtendedKeyManager.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SniX509ExtendedKeyManager.java @@ -34,8 +34,8 @@ import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; import javax.net.ssl.X509ExtendedKeyManager; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A {@link X509ExtendedKeyManager} that selects a key with an alias @@ -45,7 +45,7 @@ import org.eclipse.jetty.util.log.Logger; public class SniX509ExtendedKeyManager extends X509ExtendedKeyManager { public static final String SNI_X509 = "org.eclipse.jetty.util.ssl.snix509"; - private static final Logger LOG = Log.getLogger(SniX509ExtendedKeyManager.class); + private static final Logger LOG = LoggerFactory.getLogger(SniX509ExtendedKeyManager.class); private final X509ExtendedKeyManager _delegate; private final SslContextFactory.Server _sslContextFactory; diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java index 35c14f5177a..b8b8386b3a7 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java @@ -86,12 +86,12 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.security.CertificateUtils; import org.eclipse.jetty.util.security.CertificateValidator; import org.eclipse.jetty.util.security.Password; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

SslContextFactory is used to configure SSL parameters @@ -114,8 +114,8 @@ public abstract class SslContextFactory extends AbstractLifeCycle implements Dum */ public static final String PASSWORD_PROPERTY = "org.eclipse.jetty.ssl.password"; - private static final Logger LOG = Log.getLogger(SslContextFactory.class); - private static final Logger LOG_CONFIG = LOG.getLogger("config"); + private static final Logger LOG = LoggerFactory.getLogger(SslContextFactory.class); + private static final Logger LOG_CONFIG = LoggerFactory.getLogger(LOG.getName() + ".config"); /** * Default Excluded Protocols List */ @@ -402,7 +402,7 @@ public abstract class SslContextFactory extends AbstractLifeCycle implements Dum } catch (NoSuchAlgorithmException x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } } @@ -1621,9 +1621,11 @@ public abstract class SslContextFactory extends AbstractLifeCycle implements Dum } catch (Throwable cause) { - LOG.info("Unable to get CertificateFactory instance for type [{}] on provider [{}], using default", type, provider); + String msg = String.format("Unable to get CertificateFactory instance for type [%s] on provider [%s], using default", type, provider); if (LOG.isDebugEnabled()) - LOG.debug(cause); + LOG.debug(msg, cause); + else + LOG.info(msg); } return CertificateFactory.getInstance(type); @@ -1643,9 +1645,11 @@ public abstract class SslContextFactory extends AbstractLifeCycle implements Dum } catch (Throwable cause) { - LOG.info("Unable to get CertStore instance for type [{}] on provider [{}], using default", type, provider); + String msg = String.format("Unable to get CertStore instance for type [%s] on provider [%s], using default", type, provider); if (LOG.isDebugEnabled()) - LOG.debug(cause); + LOG.debug(msg, cause); + else + LOG.info(msg); } return CertStore.getInstance(type, new CollectionCertStoreParameters(crls)); @@ -1666,9 +1670,11 @@ public abstract class SslContextFactory extends AbstractLifeCycle implements Dum catch (Throwable cause) { // fall back to non-provider option - LOG.info("Unable to get KeyManagerFactory instance for algorithm [{}] on provider [{}], using default", algorithm, provider); + String msg = String.format("Unable to get KeyManagerFactory instance for algorithm [%s] on provider [%s], using default", algorithm, provider); if (LOG.isDebugEnabled()) - LOG.debug(cause); + LOG.debug(msg, cause); + else + LOG.info(msg); } return KeyManagerFactory.getInstance(algorithm); @@ -1691,9 +1697,11 @@ public abstract class SslContextFactory extends AbstractLifeCycle implements Dum } catch (Throwable cause) { - LOG.info("Unable to get SecureRandom instance for algorithm [{}] on provider [{}], using default", algorithm, provider); + String msg = String.format("Unable to get SecureRandom instance for algorithm [%s] on provider [%s], using default", algorithm, provider); if (LOG.isDebugEnabled()) - LOG.debug(cause); + LOG.debug(msg, cause); + else + LOG.info(msg); } return SecureRandom.getInstance(algorithm); @@ -1716,9 +1724,11 @@ public abstract class SslContextFactory extends AbstractLifeCycle implements Dum } catch (Throwable cause) { - LOG.info("Unable to get SSLContext instance for protocol [{}] on provider [{}], using default", protocol, provider); + String msg = String.format("Unable to get SSLContext instance for protocol [%s] on provider [%s], using default", protocol, provider); if (LOG.isDebugEnabled()) - LOG.debug(cause); + LOG.debug(msg, cause); + else + LOG.info(msg); } return SSLContext.getInstance(protocol); @@ -1737,11 +1747,11 @@ public abstract class SslContextFactory extends AbstractLifeCycle implements Dum } catch (Throwable cause) { - LOG.info("Unable to get TrustManagerFactory instance for algorithm [{}] on provider [{}], using default", algorithm, provider); + String msg = String.format("Unable to get TrustManagerFactory instance for algorithm [%s] on provider [%s], using default", algorithm, provider); if (LOG.isDebugEnabled()) - { - LOG.debug(cause); - } + LOG.debug(msg, cause); + else + LOG.info(msg); } return TrustManagerFactory.getInstance(algorithm); @@ -1918,7 +1928,7 @@ public abstract class SslContextFactory extends AbstractLifeCycle implements Dum } catch (Exception e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("Unable to get X509CertChain", e); return null; } } @@ -2114,8 +2124,9 @@ public abstract class SslContextFactory extends AbstractLifeCycle implements Dum * Does the default {@link #sniSelect(String, Principal[], SSLSession, String, Collection)} implementation * require an SNI match? Note that if a non SNI handshake is accepted, requests may still be rejected * at the HTTP level for incorrect SNI (see SecureRequestCustomizer). + * * @return true if no SNI match is handled as no certificate match, false if no SNI match is handled by - * delegation to the non SNI matching methods. + * delegation to the non SNI matching methods. */ @ManagedAttribute("Whether the TLS handshake is rejected if there is no SNI host match") public boolean isSniRequired() @@ -2129,8 +2140,9 @@ public abstract class SslContextFactory extends AbstractLifeCycle implements Dum * at the HTTP level for incorrect SNI (see SecureRequestCustomizer). * This setting may have no effect if {@link #sniSelect(String, Principal[], SSLSession, String, Collection)} is * overridden or a non null function is passed to {@link #setSNISelector(SniX509ExtendedKeyManager.SniSelector)}. + * * @param sniRequired true if no SNI match is handled as no certificate match, false if no SNI match is handled by - * delegation to the non SNI matching methods. + * delegation to the non SNI matching methods. */ public void setSniRequired(boolean sniRequired) { diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/X509.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/X509.java index 46df084105c..349ef807744 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/X509.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/X509.java @@ -31,12 +31,12 @@ import javax.naming.ldap.Rdn; import javax.security.auth.x500.X500Principal; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class X509 { - private static final Logger LOG = Log.getLogger(X509.class); + private static final Logger LOG = LoggerFactory.getLogger(X509.class); /* * @see {@link X509Certificate#getKeyUsage()} diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java index 07e2fbcafbc..c4fab5abbfa 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java @@ -40,14 +40,14 @@ import org.eclipse.jetty.util.annotation.Name; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ThreadPool.SizedThreadPool; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ManagedObject("A thread pool") public class QueuedThreadPool extends ContainerLifeCycle implements ThreadFactory, SizedThreadPool, Dumpable, TryExecutor { - private static final Logger LOG = Log.getLogger(QueuedThreadPool.class); + private static final Logger LOG = LoggerFactory.getLogger(QueuedThreadPool.class); private static Runnable NOOP = () -> { }; @@ -267,7 +267,7 @@ public class QueuedThreadPool extends ContainerLifeCycle implements ThreadFactor } catch (Throwable t) { - LOG.warn(t); + LOG.warn("Unable to close job: " + job, t); } } else if (job != NOOP) @@ -950,11 +950,11 @@ public class QueuedThreadPool extends ContainerLifeCycle implements ThreadFactor { if (LOG.isDebugEnabled()) LOG.debug("interrupted {} in {}", job, QueuedThreadPool.this); - LOG.ignore(e); + LOG.trace("IGNORED", e); } catch (Throwable e) { - LOG.warn(e); + LOG.warn("Job failed", e); } finally { diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java index 991cef30cda..60fe1944f14 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ReservedThreadExecutor.java @@ -29,8 +29,8 @@ import org.eclipse.jetty.util.ProcessorUtils; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * An Executor using preallocated/reserved Threads from a wrapped Executor. @@ -45,7 +45,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("A pool for reserved threads") public class ReservedThreadExecutor extends AbstractLifeCycle implements TryExecutor { - private static final Logger LOG = Log.getLogger(ReservedThreadExecutor.class); + private static final Logger LOG = LoggerFactory.getLogger(ReservedThreadExecutor.class); private static final Runnable STOP = new Runnable() { @Override @@ -248,7 +248,7 @@ public class ReservedThreadExecutor extends AbstractLifeCycle implements TryExec } catch (RejectedExecutionException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } @@ -280,7 +280,7 @@ public class ReservedThreadExecutor extends AbstractLifeCycle implements TryExec } catch (Throwable e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); _size.getAndIncrement(); _stack.offerFirst(this); return false; @@ -317,7 +317,7 @@ public class ReservedThreadExecutor extends AbstractLifeCycle implements TryExec } catch (InterruptedException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } } @@ -376,7 +376,7 @@ public class ReservedThreadExecutor extends AbstractLifeCycle implements TryExec } catch (Throwable e) { - LOG.warn(e); + LOG.warn("Unable to run task", e); } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/SerializedExecutor.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/SerializedExecutor.java index 539f466ed7e..045ed9f9b7c 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/SerializedExecutor.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/SerializedExecutor.java @@ -22,7 +22,7 @@ import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; -import org.eclipse.jetty.util.log.Log; +import org.slf4j.LoggerFactory; /** * An executor than ensurers serial execution of submitted tasks. @@ -55,7 +55,7 @@ public class SerializedExecutor implements Executor { if (task instanceof ErrorHandlingTask) ((ErrorHandlingTask)task).accept(t); - Log.getLogger(task.getClass()).warn(t); + LoggerFactory.getLogger(task.getClass()).error("Error", t); } private void run(Link link) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ShutdownThread.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ShutdownThread.java index 52dd69d7cf1..5bbf1e1118b 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ShutdownThread.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ShutdownThread.java @@ -24,8 +24,8 @@ import java.util.concurrent.CopyOnWriteArrayList; import org.eclipse.jetty.util.component.Destroyable; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ShutdownThread is a shutdown hook thread implemented as @@ -35,7 +35,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class ShutdownThread extends Thread { - private static final Logger LOG = Log.getLogger(ShutdownThread.class); + private static final Logger LOG = LoggerFactory.getLogger(ShutdownThread.class); private static final ShutdownThread _thread = new ShutdownThread(); private boolean _hooked; @@ -60,7 +60,7 @@ public class ShutdownThread extends Thread } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); LOG.info("shutdown already commenced"); } } @@ -74,7 +74,7 @@ public class ShutdownThread extends Thread } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); LOG.debug("shutdown already commenced"); } } @@ -136,7 +136,7 @@ public class ShutdownThread extends Thread } catch (Exception ex) { - LOG.debug(ex); + LOG.debug("Unable to stop", ex); } } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/Sweeper.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/Sweeper.java index cee148aca5c..74fb5394ea1 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/Sweeper.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/Sweeper.java @@ -24,8 +24,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A utility class to perform periodic sweeping of resources.

@@ -72,7 +72,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class Sweeper extends AbstractLifeCycle implements Runnable { - private static final Logger LOG = Log.getLogger(Sweeper.class); + private static final Logger LOG = LoggerFactory.getLogger(Sweeper.class); private final AtomicReference> items = new AtomicReference<>(); private final AtomicReference task = new AtomicReference<>(); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ThreadPoolBudget.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ThreadPoolBudget.java index 20d1d549bdd..84cac543b62 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ThreadPoolBudget.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ThreadPoolBudget.java @@ -24,8 +24,8 @@ import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicBoolean; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A budget of required thread usage, used to warn or error for insufficient configured threads.

@@ -34,7 +34,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class ThreadPoolBudget { - static final Logger LOG = Log.getLogger(ThreadPoolBudget.class); + static final Logger LOG = LoggerFactory.getLogger(ThreadPoolBudget.class); public interface Lease extends Closeable { diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/TimerScheduler.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/TimerScheduler.java index 83f0fcbba30..b68a5aa5369 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/TimerScheduler.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/TimerScheduler.java @@ -24,15 +24,15 @@ import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.TimeUnit; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A scheduler based on the the JVM Timer class */ public class TimerScheduler extends AbstractLifeCycle implements Scheduler, Runnable { - private static final Logger LOG = Log.getLogger(TimerScheduler.class); + private static final Logger LOG = LoggerFactory.getLogger(TimerScheduler.class); /* * This class uses the Timer class rather than an ScheduledExecutionService because diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/EatWhatYouKill.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/EatWhatYouKill.java index ca02ff6847c..b295092fc06 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/EatWhatYouKill.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/EatWhatYouKill.java @@ -29,11 +29,11 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ExecutionStrategy; import org.eclipse.jetty.util.thread.Invocable; import org.eclipse.jetty.util.thread.TryExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A strategy where the thread that produces will run the resulting task if it @@ -56,7 +56,7 @@ import org.eclipse.jetty.util.thread.TryExecutor; @ManagedObject("eat what you kill execution strategy") public class EatWhatYouKill extends ContainerLifeCycle implements ExecutionStrategy, Runnable { - private static final Logger LOG = Log.getLogger(EatWhatYouKill.class); + private static final Logger LOG = LoggerFactory.getLogger(EatWhatYouKill.class); private enum State { @@ -174,7 +174,7 @@ public class EatWhatYouKill extends ContainerLifeCycle implements ExecutionStrat } catch (Throwable th) { - LOG.warn(th); + LOG.warn("Unable to produce", th); } } } @@ -337,7 +337,7 @@ public class EatWhatYouKill extends ContainerLifeCycle implements ExecutionStrat } catch (Throwable x) { - LOG.warn(x); + LOG.warn("Task run failed", x); } } @@ -349,7 +349,7 @@ public class EatWhatYouKill extends ContainerLifeCycle implements ExecutionStrat } catch (Throwable x) { - LOG.warn(x); + LOG.warn("Task invoke failed", x); } } @@ -361,7 +361,7 @@ public class EatWhatYouKill extends ContainerLifeCycle implements ExecutionStrat } catch (Throwable e) { - LOG.warn(e); + LOG.warn("Task produce failed", e); return null; } } @@ -375,9 +375,9 @@ public class EatWhatYouKill extends ContainerLifeCycle implements ExecutionStrat catch (RejectedExecutionException e) { if (isRunning()) - LOG.warn(e); + LOG.warn("Execute failed", e); else - LOG.ignore(e); + LOG.trace("IGNORED", e); if (task instanceof Closeable) { @@ -387,7 +387,7 @@ public class EatWhatYouKill extends ContainerLifeCycle implements ExecutionStrat } catch (Throwable e2) { - LOG.ignore(e2); + LOG.trace("IGNORED", e2); } } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/ExecuteProduceConsume.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/ExecuteProduceConsume.java index 1c7d8856fb3..44f501f811c 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/ExecuteProduceConsume.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/ExecuteProduceConsume.java @@ -20,12 +20,12 @@ package org.eclipse.jetty.util.thread.strategy; import java.util.concurrent.Executor; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.AutoLock; import org.eclipse.jetty.util.thread.ExecutionStrategy; import org.eclipse.jetty.util.thread.Invocable; import org.eclipse.jetty.util.thread.Invocable.InvocationType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A strategy where the thread that produces will always run the resulting task.

@@ -42,7 +42,7 @@ import org.eclipse.jetty.util.thread.Invocable.InvocationType; */ public class ExecuteProduceConsume implements ExecutionStrategy, Runnable { - private static final Logger LOG = Log.getLogger(ExecuteProduceConsume.class); + private static final Logger LOG = LoggerFactory.getLogger(ExecuteProduceConsume.class); private final AutoLock _lock = new AutoLock(); private final Runnable _runProduce = new RunProduce(); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/ProduceConsume.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/ProduceConsume.java index 22a82b2b999..34fba76184c 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/ProduceConsume.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/ProduceConsume.java @@ -20,10 +20,10 @@ package org.eclipse.jetty.util.thread.strategy; import java.util.concurrent.Executor; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.AutoLock; import org.eclipse.jetty.util.thread.ExecutionStrategy; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A strategy where the caller thread iterates over task production, submitting each @@ -31,7 +31,7 @@ import org.eclipse.jetty.util.thread.ExecutionStrategy; */ public class ProduceConsume implements ExecutionStrategy, Runnable { - private static final Logger LOG = Log.getLogger(ExecuteProduceConsume.class); + private static final Logger LOG = LoggerFactory.getLogger(ExecuteProduceConsume.class); private final AutoLock _lock = new AutoLock(); private final Producer _producer; diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/ProduceExecuteConsume.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/ProduceExecuteConsume.java index 1a0f54c2e57..b215b424717 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/ProduceExecuteConsume.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/ProduceExecuteConsume.java @@ -20,12 +20,12 @@ package org.eclipse.jetty.util.thread.strategy; import java.util.concurrent.Executor; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.AutoLock; import org.eclipse.jetty.util.thread.ExecutionStrategy; import org.eclipse.jetty.util.thread.Invocable; import org.eclipse.jetty.util.thread.Invocable.InvocationType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

A strategy where the caller thread iterates over task production, submitting each @@ -33,7 +33,7 @@ import org.eclipse.jetty.util.thread.Invocable.InvocationType; */ public class ProduceExecuteConsume implements ExecutionStrategy { - private static final Logger LOG = Log.getLogger(ProduceExecuteConsume.class); + private static final Logger LOG = LoggerFactory.getLogger(ProduceExecuteConsume.class); private final AutoLock _lock = new AutoLock(); private final Producer _producer; diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/BufferUtilTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/BufferUtilTest.java index 539e06259b5..780d53a52ca 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/BufferUtilTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/BufferUtilTest.java @@ -25,10 +25,10 @@ import java.nio.ByteBuffer; import java.util.Arrays; import java.util.concurrent.ThreadLocalRandom; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -233,7 +233,7 @@ public class BufferUtilTest assertEquals(length, count, "Count of bytes"); } - private static final Logger LOG = Log.getLogger(BufferUtilTest.class); + private static final Logger LOG = LoggerFactory.getLogger(BufferUtilTest.class); @Test @Disabled("Very simple microbenchmark to compare different writeTo implementations. Only for development thus " + diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/HostPortTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/HostPortTest.java index 61c0a37d0c5..f476f805cef 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/HostPortTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/HostPortTest.java @@ -83,7 +83,7 @@ public class HostPortTest "127.0.0.1:-80", "[0::0::0::0::1]:-80", "127.0.0.1:65536" - ) + ) .map(Arguments::of); } diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/PathWatcherDemo.java b/jetty-util/src/test/java/org/eclipse/jetty/util/PathWatcherDemo.java index d90c05f51e6..153a5f825d8 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/PathWatcherDemo.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/PathWatcherDemo.java @@ -24,14 +24,16 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; import org.eclipse.jetty.util.PathWatcher.PathWatchEvent; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class PathWatcherDemo implements PathWatcher.Listener { - private static final Logger LOG = Log.getLogger(PathWatcherDemo.class); + private static final Logger LOG = LoggerFactory.getLogger(PathWatcherDemo.class); public static void main(String[] args) { @@ -54,7 +56,9 @@ public class PathWatcherDemo implements PathWatcher.Listener } catch (Throwable t) { - LOG.warn(t); + LOG.warn("Failed to run paths: {}", + paths.stream().map(Objects::toString).collect(Collectors.joining(", ", "[", "]")), + t); } } diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/PathWatcherTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/PathWatcherTest.java index d0b4a70b37f..3145088f11f 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/PathWatcherTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/PathWatcherTest.java @@ -37,11 +37,11 @@ import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension; import org.eclipse.jetty.util.PathWatcher.PathWatchEvent; import org.eclipse.jetty.util.PathWatcher.PathWatchEventType; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.eclipse.jetty.util.PathWatcher.PathWatchEventType.ADDED; import static org.eclipse.jetty.util.PathWatcher.PathWatchEventType.DELETED; @@ -75,7 +75,7 @@ public class PathWatcherTest public static class PathWatchEventCapture implements PathWatcher.Listener { public static final String FINISH_TAG = "#finished#.tag"; - private static final Logger LOG = Log.getLogger(PathWatcherTest.PathWatchEventCapture.class); + private static final Logger LOG = LoggerFactory.getLogger(PathWatcherTest.PathWatchEventCapture.class); private final Path baseDir; /** diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java index d21fd121963..48bd3adaf9c 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java @@ -28,10 +28,10 @@ import java.util.concurrent.CyclicBarrier; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assumptions.assumeTrue; @@ -41,7 +41,7 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue; @Disabled public class QueueBenchmarkTest { - private static final Logger logger = Log.getLogger(QueueBenchmarkTest.class); + private static final Logger logger = LoggerFactory.getLogger(QueueBenchmarkTest.class); private static final Runnable ELEMENT = () -> { }; diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/SharedBlockingCallbackTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/SharedBlockingCallbackTest.java index fa507c8aff8..8d891d1d750 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/SharedBlockingCallbackTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/SharedBlockingCallbackTest.java @@ -25,9 +25,9 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.eclipse.jetty.util.SharedBlockingCallback.Blocker; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThan; @@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.fail; public class SharedBlockingCallbackTest { - private static final Logger LOG = Log.getLogger(SharedBlockingCallback.class); + private static final Logger LOG = LoggerFactory.getLogger(SharedBlockingCallback.class); final AtomicInteger notComplete = new AtomicInteger(); final SharedBlockingCallback sbcb = new SharedBlockingCallback() diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/URIUtilTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/URIUtilTest.java index 70e78806714..9272b94b636 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/URIUtilTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/URIUtilTest.java @@ -38,14 +38,14 @@ import org.eclipse.jetty.toolchain.test.FS; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.OS; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -61,7 +61,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @ExtendWith(WorkDirExtension.class) public class URIUtilTest { - private static final Logger LOG = Log.getLogger(URIUtilTest.class); + private static final Logger LOG = LoggerFactory.getLogger(URIUtilTest.class); public WorkDir workDir; public static Stream encodePathSource() diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/UrlEncodedUtf8Test.java b/jetty-util/src/test/java/org/eclipse/jetty/util/UrlEncodedUtf8Test.java index 68219b515d4..f253d65af7c 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/UrlEncodedUtf8Test.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/UrlEncodedUtf8Test.java @@ -22,9 +22,9 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.nio.charset.StandardCharsets; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -32,8 +32,7 @@ import static org.junit.jupiter.api.Assertions.fail; public class UrlEncodedUtf8Test { - - static final Logger LOG = Log.getLogger(UrlEncodedUtf8Test.class); + private static final Logger LOG = LoggerFactory.getLogger(UrlEncodedUtf8Test.class); @Test public void testIncompleteSequestAtTheEnd() throws Exception @@ -96,7 +95,7 @@ public class UrlEncodedUtf8Test { if (!thrown) throw e; - LOG.ignore(e); + LOG.trace("IGNORED", e); } } @@ -116,7 +115,7 @@ public class UrlEncodedUtf8Test { if (!thrown) throw e; - LOG.ignore(e); + LOG.trace("IGNORED", e); } } } diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/PathResourceTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/PathResourceTest.java index 57c1c1e392b..458cba3a88e 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/PathResourceTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/PathResourceTest.java @@ -18,7 +18,6 @@ package org.eclipse.jetty.util.resource; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -34,7 +33,6 @@ import java.util.Map; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.junit.jupiter.api.Test; -import static java.nio.charset.StandardCharsets.UTF_8; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceAliasTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceAliasTest.java index 80f5f7259c4..ffd19fc4578 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceAliasTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceAliasTest.java @@ -27,9 +27,10 @@ import java.nio.file.Path; import org.eclipse.jetty.toolchain.test.FS; import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension; -import org.eclipse.jetty.util.log.Log; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -41,6 +42,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @ExtendWith(WorkDirExtension.class) public class ResourceAliasTest { + private static final Logger LOG = LoggerFactory.getLogger(ResourceAliasTest.class); + public WorkDir workDir; @Test @@ -143,7 +146,7 @@ public class ResourceAliasTest catch (InvalidPathException e) { // this file system does allow null char ending filenames - Log.getRootLogger().ignore(e); + LOG.trace("IGNORED", e); } } } diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/EatWhatYouKillTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/EatWhatYouKillTest.java index 3db735633ac..4a6dbf0d403 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/EatWhatYouKillTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/EatWhatYouKillTest.java @@ -61,7 +61,7 @@ public class EatWhatYouKillTest @Test public void testExceptionThrownByTask() throws Exception { - try (StacklessLogging stackLess = new StacklessLogging(EatWhatYouKill.class)) + try (StacklessLogging ignored = new StacklessLogging(EatWhatYouKill.class)) { AtomicReference detector = new AtomicReference<>(); CountDownLatch latch = new CountDownLatch(2); diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java index 521f31f05e7..770a481b675 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java @@ -24,10 +24,10 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.eclipse.jetty.logging.StacklessLogging; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ThreadPool.SizedThreadPool; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThanOrEqualTo; @@ -40,7 +40,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class QueuedThreadPoolTest extends AbstractThreadPoolTest { - private static final Logger LOG = Log.getLogger(QueuedThreadPoolTest.class); + private static final Logger LOG = LoggerFactory.getLogger(QueuedThreadPoolTest.class); private final AtomicInteger _jobs = new AtomicInteger(); private static class TestQueuedThreadPool extends QueuedThreadPool @@ -138,7 +138,7 @@ public class QueuedThreadPoolTest extends AbstractThreadPoolTest } catch (Exception e) { - LOG.debug(e); + LOG.debug("RunningJob failed", e); } finally { diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/SweeperTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/SweeperTest.java index 7dda9d36263..c24aaef5ee5 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/SweeperTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/SweeperTest.java @@ -94,7 +94,7 @@ public class SweeperTest @Test public void testSweepThrows() throws Exception { - try (StacklessLogging scope = new StacklessLogging(Sweeper.class)) + try (StacklessLogging ignored = new StacklessLogging(Sweeper.class)) { long period = 500; final CountDownLatch taskLatch = new CountDownLatch(2); diff --git a/jetty-webapp/pom.xml b/jetty-webapp/pom.xml index 350b35c7d73..d81876c4978 100644 --- a/jetty-webapp/pom.xml +++ b/jetty-webapp/pom.xml @@ -80,6 +80,10 @@ jetty-xml ${project.version} + + org.slf4j + slf4j-api + org.eclipse.jetty @@ -87,6 +91,12 @@ ${project.version} test + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/CachingWebAppClassLoader.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/CachingWebAppClassLoader.java index 1c966f55419..ac1ab598e65 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/CachingWebAppClassLoader.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/CachingWebAppClassLoader.java @@ -25,8 +25,8 @@ import java.util.concurrent.ConcurrentHashMap; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A WebAppClassLoader that caches {@link #getResource(String)} results. @@ -37,7 +37,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject public class CachingWebAppClassLoader extends WebAppClassLoader { - private static final Logger LOG = Log.getLogger(CachingWebAppClassLoader.class); + private static final Logger LOG = LoggerFactory.getLogger(CachingWebAppClassLoader.class); private final Set _notFound = ConcurrentHashMap.newKeySet(); private final ConcurrentHashMap _cache = new ConcurrentHashMap<>(); @@ -104,8 +104,7 @@ public class CachingWebAppClassLoader extends WebAppClassLoader if (_notFound.add(name)) if (LOG.isDebugEnabled()) { - LOG.debug("Caching not found {}", name); - LOG.debug(nfe); + LOG.debug("Caching not found {}", name, nfe); } throw nfe; } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ClassMatcher.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ClassMatcher.java index 6edeb9a312b..63ce3599f65 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ClassMatcher.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ClassMatcher.java @@ -43,9 +43,9 @@ import org.eclipse.jetty.util.IncludeExcludeSet; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A matcher for classes based on package and/or location and/or module/ @@ -70,7 +70,7 @@ import org.eclipse.jetty.util.resource.Resource; public class ClassMatcher extends AbstractSet { - private static final Logger LOG = Log.getLogger(ClassMatcher.class); + private static final Logger LOG = LoggerFactory.getLogger(ClassMatcher.class); public static class Entry { @@ -723,7 +723,7 @@ public class ClassMatcher extends AbstractSet } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to match against {}", clazz, e); } return false; } @@ -745,7 +745,7 @@ public class ClassMatcher extends AbstractSet } catch (URISyntaxException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return null; } }); diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Configurations.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Configurations.java index e8ef70913f4..c08673ad0f2 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Configurations.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Configurations.java @@ -40,8 +40,8 @@ import org.eclipse.jetty.util.TopologicalSort; import org.eclipse.jetty.util.annotation.Name; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * An ordered list of {@link Configuration} instances. @@ -64,7 +64,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class Configurations extends AbstractList implements Dumpable { - private static final Logger LOG = Log.getLogger(Configurations.class); + private static final Logger LOG = LoggerFactory.getLogger(Configurations.class); private static final List __known = new ArrayList<>(); private static final List __unavailable = new ArrayList<>(); @@ -77,9 +77,9 @@ public class Configurations extends AbstractList implements Dumpa ServiceLoader configs = ServiceLoader.load(Configuration.class); for (Iterator i = configs.iterator(); i.hasNext(); ) { + Configuration configuration = i.next(); try { - Configuration configuration = i.next(); if (!configuration.isAvailable()) { if (LOG.isDebugEnabled()) @@ -92,7 +92,7 @@ public class Configurations extends AbstractList implements Dumpa } catch (Throwable e) { - LOG.warn(e); + LOG.warn("Unable to get known {}", configuration, e); } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Descriptor.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Descriptor.java index 2a68f0b4319..73d8ec543e8 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Descriptor.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Descriptor.java @@ -52,7 +52,7 @@ public abstract class Descriptor } } } - + public boolean isParsed() { return _root != null; diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DiscoveredAnnotation.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DiscoveredAnnotation.java index 5e3d6c56dfe..54c8219e3a1 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DiscoveredAnnotation.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DiscoveredAnnotation.java @@ -19,9 +19,9 @@ package org.eclipse.jetty.webapp; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * DiscoveredAnnotation @@ -31,7 +31,7 @@ import org.eclipse.jetty.util.resource.Resource; */ public abstract class DiscoveredAnnotation { - private static final Logger LOG = Log.getLogger(DiscoveredAnnotation.class); + private static final Logger LOG = LoggerFactory.getLogger(DiscoveredAnnotation.class); protected WebAppContext _context; protected String _className; @@ -51,7 +51,7 @@ public abstract class DiscoveredAnnotation _className = className; _resource = resource; } - + public String getClassName() { return _className; @@ -86,10 +86,10 @@ public abstract class DiscoveredAnnotation } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to load {}", _className, e); } } - + @Override public String toString() { diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JaasConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JaasConfiguration.java index 225501c1d70..c0fe0531378 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JaasConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JaasConfiguration.java @@ -21,8 +21,8 @@ package org.eclipse.jetty.webapp; import java.util.ServiceLoader; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

JAAS Configuration

@@ -36,7 +36,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class JaasConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(JaasConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(JaasConfiguration.class); public JaasConfiguration() { @@ -54,7 +54,7 @@ public class JaasConfiguration extends AbstractConfiguration } catch (Throwable e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return false; } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.java index 3aab43006bb..d5d1c152d15 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.java @@ -21,10 +21,10 @@ package org.eclipse.jetty.webapp; import java.io.IOException; import java.util.Map; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.xml.XmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * JettyWebConfiguration. @@ -33,7 +33,7 @@ import org.eclipse.jetty.xml.XmlConfiguration; */ public class JettyWebXmlConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(JettyWebXmlConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(JettyWebXmlConfiguration.class); public static final String PROPERTY_WEB_INF_URI = "web-inf.uri"; public static final String PROPERTY_WEB_INF = "web-inf"; diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JmxConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JmxConfiguration.java index e57b2402ea2..b3cd43540b5 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JmxConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JmxConfiguration.java @@ -21,8 +21,8 @@ package org.eclipse.jetty.webapp; import java.util.ServiceLoader; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

JMX Configuration

@@ -36,7 +36,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class JmxConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(JmxConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(JmxConfiguration.class); public JmxConfiguration() { @@ -53,7 +53,7 @@ public class JmxConfiguration extends AbstractConfiguration } catch (Throwable e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return false; } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JndiConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JndiConfiguration.java index 7e1ec4d8300..a4587c26e62 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JndiConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JndiConfiguration.java @@ -21,8 +21,8 @@ package org.eclipse.jetty.webapp; import java.util.ServiceLoader; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

JNDI Configuration

@@ -36,7 +36,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class JndiConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(JndiConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(JndiConfiguration.class); public JndiConfiguration() { @@ -54,7 +54,7 @@ public class JndiConfiguration extends AbstractConfiguration } catch (Throwable e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return false; } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JspConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JspConfiguration.java index 3f3f1e02ad6..cc4cf28e518 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JspConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JspConfiguration.java @@ -21,8 +21,8 @@ package org.eclipse.jetty.webapp; import java.util.ServiceLoader; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

JSP Configuration

@@ -36,7 +36,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class JspConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(JspConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(JspConfiguration.class); public JspConfiguration() { @@ -56,7 +56,7 @@ public class JspConfiguration extends AbstractConfiguration } catch (Throwable e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return false; } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaData.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaData.java index 818cd7ffa6d..5afc94ae9b9 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaData.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaData.java @@ -19,22 +19,18 @@ package org.eclipse.jetty.webapp; import java.lang.annotation.Annotation; -import java.net.URI; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; - import javax.servlet.ServletContext; -import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.EmptyResource; import org.eclipse.jetty.util.resource.Resource; -import org.eclipse.jetty.xml.XmlParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * MetaData @@ -43,7 +39,7 @@ import org.eclipse.jetty.xml.XmlParser; */ public class MetaData { - private static final Logger LOG = Log.getLogger(MetaData.class); + private static final Logger LOG = LoggerFactory.getLogger(MetaData.class); public static final String VALIDATE_XML = "org.eclipse.jetty.webapp.validateXml"; public static final String ORDERED_LIBS = "javax.servlet.context.orderedLibs"; @@ -66,16 +62,15 @@ public class MetaData protected Ordering _ordering;//can be set to RelativeOrdering by web-default.xml, web.xml, web-override.xml protected boolean _allowDuplicateFragmentNames = false; protected boolean _validateXml = false; - + public enum Complete { NotSet, True, False } - + /** - * Metadata regarding where a deployable element was declared: + * Metadata regarding where a deployable element was declared: * by annotation or by descriptor. - * */ public static class OriginInfo { @@ -83,22 +78,22 @@ public class MetaData * Identifier for the deployable element */ private final String name; - + /** * Origin of the deployable element */ private final Origin origin; - + /** * Reference to the descriptor, if declared in one */ private final Descriptor descriptor; - + /** * Reference to the annotation, if declared by one */ private final Annotation annotation; - + /** * The class containing the annotation, if declared by one */ @@ -125,7 +120,7 @@ public class MetaData origin = Origin.of(d); descriptor = d; annotation = null; - annotated = null; + annotated = null; } public OriginInfo(String n) @@ -194,9 +189,8 @@ public class MetaData /** * Set the web-default.xml. - * + * * @param descriptor the web-default.xml - * @throws Exception */ public void setDefaultsDescriptor(DefaultsDescriptor descriptor) throws Exception @@ -225,7 +219,6 @@ public class MetaData /** * @param descriptor the web.xml descriptor - * @throws Exception */ public void setWebDescriptor(WebDescriptor descriptor) throws Exception @@ -256,9 +249,8 @@ public class MetaData /** * Add a override-web.xml descriptor. - * + * * @param descriptor the override-web.xml - * @throws Exception */ public void addOverrideDescriptor(OverrideDescriptor descriptor) throws Exception @@ -314,7 +306,7 @@ public class MetaData Objects.requireNonNull(jarResource); Objects.requireNonNull(descriptor); - + //Metadata-complete is not set, or there is no web.xml _webFragmentResourceMap.put(jarResource, descriptor); _webFragmentRoots.add(descriptor); @@ -361,7 +353,7 @@ public class MetaData /** * Add an annotation that has been discovered on a class, method or field within a resource * eg a jar or dir. The annotation may also have no associated resource, or that resource - * may be a system or container resource. + * may be a system or container resource. * * This method is synchronized as it is anticipated that it may be called by many threads * during the annotation scanning phase. @@ -404,12 +396,12 @@ public class MetaData list.add(annotation); } - + /** * Check if the resource is contained within one of the list of resources. * In other words, check if the given resource is a sub-resource of one * of the list of resources. - * + * * @param resources the list of resources to check against * @param resource the resource for which to find the parent resource * @return the resource from the list that contains the given resource. @@ -431,7 +423,7 @@ public class MetaData } catch (Exception e) { - LOG.warn(e); + LOG.warn("Not contained within?", e); return null; } } @@ -543,7 +535,7 @@ public class MetaData * A webapp is distributable if web.xml is metadata-complete and * distributable=true, or if metadata-complete is false, but all * web-fragments.xml are distributable=true. - * + * * @return true if the webapp is distributable, false otherwise */ public boolean isDistributable() @@ -609,7 +601,7 @@ public class MetaData { return _webFragmentNameMap.get(name); } - + /** * @param descriptorResource the web-fragment.xml location as a Resource * @return the FrgmentDescriptor for the web-fragment.xml, or null if none exists @@ -626,19 +618,19 @@ public class MetaData public Resource getJarForFragmentName(String name) { Resource jar = null; - + FragmentDescriptor f = getFragmentDescriptor(name); if (f == null) return null; - for (Map.Entry entry : _webFragmentResourceMap.entrySet()) + for (Map.Entry entry : _webFragmentResourceMap.entrySet()) { if (entry.getValue().equals(f)) jar = entry.getKey(); } return jar; } - + /** * Get the web-fragment.xml related to a jar * @@ -646,7 +638,7 @@ public class MetaData * @return the FragmentDescriptor or null if no web-fragment.xml is associated with the jar */ public FragmentDescriptor getFragmentDescriptorForJar(Resource jar) - { + { return _webFragmentResourceMap.get(jar); } @@ -689,7 +681,7 @@ public class MetaData { if (name == null) return; - + OriginInfo x = new OriginInfo(name, d); _origins.put(name, x); } @@ -727,7 +719,7 @@ public class MetaData if (!withOrdering) return Collections.unmodifiableList(_webInfJars); else - return Collections.unmodifiableList(_orderedWebInfResources); + return Collections.unmodifiableList(_orderedWebInfResources); } public List getContainerResources() @@ -767,7 +759,7 @@ public class MetaData { return _validateXml; } - + /** * @param validateXml if true xml syntax is validated by the parser, false otherwise */ diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java index d81e516eed3..b45e52a088b 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java @@ -42,11 +42,11 @@ import java.util.jar.JarEntry; import java.util.jar.JarFile; import org.eclipse.jetty.util.PatternMatcher; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.EmptyResource; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.ResourceCollection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * MetaInfConfiguration @@ -67,7 +67,7 @@ import org.eclipse.jetty.util.resource.ResourceCollection; */ public class MetaInfConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(MetaInfConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(MetaInfConfiguration.class); public static final String USE_CONTAINER_METAINF_CACHE = "org.eclipse.jetty.metainf.useCache"; public static final boolean DEFAULT_USE_CONTAINER_METAINF_CACHE = true; @@ -789,7 +789,7 @@ public class MetaInfConfiguration extends AbstractConfiguration } catch (Exception ex) { - LOG.warn(Log.EXCEPTION, ex); + LOG.warn("Unable to load WEB-INF file {}", files[f], ex); } } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ServletsConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ServletsConfiguration.java index fb48e361bb0..9d76ea4c7c3 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ServletsConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ServletsConfiguration.java @@ -19,8 +19,8 @@ package org.eclipse.jetty.webapp; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Jetty Servlets Configuration

@@ -30,7 +30,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class ServletsConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(ServletsConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(ServletsConfiguration.class); public ServletsConfiguration() { @@ -52,7 +52,7 @@ public class ServletsConfiguration extends AbstractConfiguration } catch (Throwable e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return false; } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/StandardDescriptorProcessor.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/StandardDescriptorProcessor.java index 1bea6939ea6..b02c2aae36b 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/StandardDescriptorProcessor.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/StandardDescriptorProcessor.java @@ -30,7 +30,6 @@ import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; - import javax.servlet.DispatcherType; import javax.servlet.MultipartConfigElement; import javax.servlet.SessionTrackingMode; @@ -51,11 +50,11 @@ import org.eclipse.jetty.servlet.ServletMapping; import org.eclipse.jetty.servlet.Source; import org.eclipse.jetty.util.ArrayUtil; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.xml.XmlParser; import org.eclipse.jetty.xml.XmlParser.Node; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * StandardDescriptorProcessor. @@ -64,7 +63,7 @@ import org.eclipse.jetty.xml.XmlParser.Node; */ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor { - private static final Logger LOG = Log.getLogger(StandardDescriptorProcessor.class); + private static final Logger LOG = LoggerFactory.getLogger(StandardDescriptorProcessor.class); public static final String STANDARD_PROCESSOR = "org.eclipse.jetty.standardDescriptorProcessor"; @@ -153,7 +152,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor { String name = node.getString("param-name", false, true); String value = node.getString("param-value", false, true); - switch (context.getMetaData().getOrigin("context-param." + name)) + Origin origin = context.getMetaData().getOrigin("context-param." + name); + switch (origin) { case NotSet: { @@ -185,7 +185,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } if (LOG.isDebugEnabled()) LOG.debug("ContextParam: " + name + "=" + value); @@ -226,7 +226,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor String originName = name + ".servlet.init-param." + pname; Descriptor originDescriptor = context.getMetaData().getOriginDescriptor(originName); - switch (context.getMetaData().getOrigin(originName)) + Origin origin = context.getMetaData().getOrigin(originName); + switch (origin) { case NotSet: { @@ -257,7 +258,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -283,7 +284,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor if (servletClass != null) { ((WebDescriptor)descriptor).addClassName(servletClass); - switch (context.getMetaData().getOrigin(name + ".servlet.servlet-class")) + Origin origin = context.getMetaData().getOrigin(name + ".servlet.servlet-class"); + switch (origin) { case NotSet: { @@ -312,7 +314,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -342,11 +344,12 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor catch (Exception e) { LOG.warn("Cannot parse load-on-startup " + s + ". Please use integer"); - LOG.ignore(e); + LOG.trace("IGNORED", e); } } - switch (context.getMetaData().getOrigin(name + ".servlet.load-on-startup")) + Origin origin = context.getMetaData().getOrigin(name + ".servlet.load-on-startup"); + switch (origin) { case NotSet: { @@ -375,7 +378,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -389,7 +392,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor { if (LOG.isDebugEnabled()) LOG.debug("link role " + roleName + " to " + roleLink + " for " + this); - switch (context.getMetaData().getOrigin(name + ".servlet.role-name." + roleName)) + Origin origin = context.getMetaData().getOrigin(name + ".servlet.role-name." + roleName); + switch (origin) { case NotSet: { @@ -417,7 +421,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } else @@ -433,7 +437,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor if (roleName != null) { - switch (context.getMetaData().getOrigin(name + ".servlet.run-as")) + Origin origin = context.getMetaData().getOrigin(name + ".servlet.run-as"); + switch (origin) { case NotSet: { @@ -462,7 +467,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } } @@ -471,7 +476,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor if (async != null) { boolean val = async.length() == 0 || Boolean.parseBoolean(async); - switch (context.getMetaData().getOrigin(name + ".servlet.async-supported")) + Origin origin = context.getMetaData().getOrigin(name + ".servlet.async-supported"); + switch (origin) { case NotSet: { @@ -500,7 +506,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -508,7 +514,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor if (enabled != null) { boolean isEnabled = enabled.length() == 0 || Boolean.parseBoolean(enabled); - switch (context.getMetaData().getOrigin(name + ".servlet.enabled")) + Origin origin = context.getMetaData().getOrigin(name + ".servlet.enabled"); + switch (origin) { case NotSet: { @@ -537,7 +544,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -558,7 +565,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor (maxRequest == null || "".equals(maxRequest) ? -1L : Long.parseLong(maxRequest)), (threshold == null || "".equals(threshold) ? 0 : Integer.parseInt(threshold))); - switch (context.getMetaData().getOrigin(name + ".servlet.multipart-config")) + Origin origin = context.getMetaData().getOrigin(name + ".servlet.multipart-config"); + switch (origin) { case NotSet: { @@ -596,7 +604,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } } @@ -610,7 +618,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor // declared in web.xml overrides the mapping for the servlet specified in the web-fragment.xml String servletName = node.getString("servlet-name", false, true); - switch (context.getMetaData().getOrigin(servletName + ".servlet.mappings")) + Origin origin = context.getMetaData().getOrigin(servletName + ".servlet.mappings"); + switch (origin) { case NotSet: { @@ -638,7 +647,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -688,7 +697,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(o); } while (iter.hasNext()) @@ -709,7 +718,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor String name = cookieConfig.getString("name", false, true); if (name != null) { - switch (context.getMetaData().getOrigin("cookie-config.name")) + Origin origin = context.getMetaData().getOrigin("cookie-config.name"); + switch (origin) { case NotSet: { @@ -738,7 +748,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -746,7 +756,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor String domain = cookieConfig.getString("domain", false, true); if (domain != null) { - switch (context.getMetaData().getOrigin("cookie-config.domain")) + Origin origin = context.getMetaData().getOrigin("cookie-config.domain"); + switch (origin) { case NotSet: { @@ -775,7 +786,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -783,7 +794,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor String path = cookieConfig.getString("path", false, true); if (path != null) { - switch (context.getMetaData().getOrigin("cookie-config.path")) + Origin origin = context.getMetaData().getOrigin("cookie-config.path"); + switch (origin) { case NotSet: { @@ -812,7 +824,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -820,7 +832,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor String comment = cookieConfig.getString("comment", false, true); if (comment != null) { - switch (context.getMetaData().getOrigin("cookie-config.comment")) + Origin origin = context.getMetaData().getOrigin("cookie-config.comment"); + switch (origin) { case NotSet: { @@ -849,7 +862,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -858,7 +871,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor if (tNode != null) { boolean httpOnly = Boolean.parseBoolean(tNode.toString(false, true)); - switch (context.getMetaData().getOrigin("cookie-config.http-only")) + Origin origin = context.getMetaData().getOrigin("cookie-config.http-only"); + switch (origin) { case NotSet: { @@ -887,7 +901,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -896,7 +910,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor if (tNode != null) { boolean secure = Boolean.parseBoolean(tNode.toString(false, true)); - switch (context.getMetaData().getOrigin("cookie-config.secure")) + Origin origin = context.getMetaData().getOrigin("cookie-config.secure"); + switch (origin) { case NotSet: { @@ -925,7 +940,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -934,7 +949,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor if (tNode != null) { int maxAge = Integer.parseInt(tNode.toString(false, true)); - switch (context.getMetaData().getOrigin("cookie-config.max-age")) + Origin origin = context.getMetaData().getOrigin("cookie-config.max-age"); + switch (origin) { case NotSet: { @@ -963,7 +979,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } } @@ -977,7 +993,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor String mimeType = node.getString("mime-type", false, true); if (extension != null) { - switch (context.getMetaData().getOrigin("extension." + extension)) + Origin origin = context.getMetaData().getOrigin("extension." + extension); + switch (origin) { case NotSet: { @@ -1006,14 +1023,15 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } } public void visitWelcomeFileList(WebAppContext context, Descriptor descriptor, XmlParser.Node node) { - switch (context.getMetaData().getOrigin("welcome-file-list")) + Origin origin = context.getMetaData().getOrigin("welcome-file-list"); + switch (origin) { case NotSet: { @@ -1051,7 +1069,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -1066,7 +1084,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor if (encoding != null) { - switch (context.getMetaData().getOrigin("locale-encoding." + locale)) + Origin origin = context.getMetaData().getOrigin("locale-encoding." + locale); + switch (origin) { case NotSet: { @@ -1095,7 +1114,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } } @@ -1119,7 +1138,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor throw new IllegalStateException("Missing leading '/' for location: " + location); ErrorPageErrorHandler handler = (ErrorPageErrorHandler)context.getErrorHandler(); String originName = "error." + error; - switch (context.getMetaData().getOrigin(originName)) + Origin origin = context.getMetaData().getOrigin(originName); + switch (origin) { case NotSet: { @@ -1159,7 +1179,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -1539,7 +1559,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor } catch (CloneNotSupportedException e) { - LOG.warn(e); + LOG.warn("Unable to clone {}", scBase, e); } } @@ -1552,7 +1572,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor if (method != null) { //handle auth-method merge - switch (context.getMetaData().getOrigin("auth-method")) + Origin origin = context.getMetaData().getOrigin("auth-method"); + switch (origin) { case NotSet: { @@ -1581,13 +1602,14 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } //handle realm-name merge XmlParser.Node name = node.get("realm-name"); String nameStr = (name == null ? "default" : name.toString(false, true)); - switch (context.getMetaData().getOrigin("realm-name")) + Origin originRealmName = context.getMetaData().getOrigin("realm-name"); + switch (originRealmName) { case NotSet: { @@ -1616,7 +1638,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(originRealmName); } if (Constraint.__FORM_AUTH.equalsIgnoreCase(context.getSecurityHandler().getAuthMethod())) @@ -1634,7 +1656,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor errorPageName = errorPage.toString(false, true); //handle form-login-page - switch (context.getMetaData().getOrigin("form-login-page")) + Origin originFormLoginPage = context.getMetaData().getOrigin("form-login-page"); + switch (originFormLoginPage) { case NotSet: { @@ -1663,11 +1686,12 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(originFormLoginPage); } //handle form-error-page - switch (context.getMetaData().getOrigin("form-error-page")) + Origin originFormErrorPage = context.getMetaData().getOrigin("form-error-page"); + switch (originFormErrorPage) { case NotSet: { @@ -1696,7 +1720,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(originFormErrorPage); } } else @@ -1737,7 +1761,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor { ((WebDescriptor)descriptor).addClassName(filterClass); - switch (context.getMetaData().getOrigin(name + ".filter.filter-class")) + Origin origin = context.getMetaData().getOrigin(name + ".filter.filter-class"); + switch (origin) { case NotSet: { @@ -1766,7 +1791,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -1777,7 +1802,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor String pname = paramNode.getString("param-name", false, true); String pvalue = paramNode.getString("param-value", false, true); - switch (context.getMetaData().getOrigin(name + ".filter.init-param." + pname)) + Origin origin = context.getMetaData().getOrigin(name + ".filter.init-param." + pname); + switch (origin) { case NotSet: { @@ -1807,7 +1833,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -1817,7 +1843,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor if (async != null) { boolean val = async.length() == 0 || Boolean.parseBoolean(async); - switch (context.getMetaData().getOrigin(name + ".filter.async-supported")) + Origin origin = context.getMetaData().getOrigin(name + ".filter.async-supported"); + switch (origin) { case NotSet: { @@ -1846,7 +1873,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } } @@ -1858,7 +1885,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor //Maintenance update 3.0a to spec: // Updated 8.2.3.g.v to say elements are additive across web-fragments. String filterName = node.getString("filter-name", false, true); - switch (context.getMetaData().getOrigin(filterName + ".filter.mappings")) + Origin origin = context.getMetaData().getOrigin(filterName + ".filter.mappings"); + switch (origin) { case NotSet: { @@ -1885,7 +1913,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor break; } default: - LOG.warn(new Throwable()); // TODO throw ISE? + unknownOrigin(origin); } } @@ -2008,4 +2036,9 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor context.getMetaData().setOrigin("response-character-encoding", descriptor); } } + + private void unknownOrigin(Origin origin) + { + LOG.warn("Unknown descriptor origin {}", origin, new Throwable()); // TODO throw ISE? + } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java index 34618269230..82806a3eb7e 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java @@ -43,10 +43,10 @@ import org.eclipse.jetty.util.ClassVisibilityChecker; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.ResourceCollection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ClassLoader for HttpContext. @@ -73,7 +73,7 @@ public class WebAppClassLoader extends URLClassLoader implements ClassVisibility registerAsParallelCapable(); } - private static final Logger LOG = Log.getLogger(WebAppClassLoader.class); + private static final Logger LOG = LoggerFactory.getLogger(WebAppClassLoader.class); private static final ThreadLocal __loadServerClasses = new ThreadLocal<>(); private final Context _context; @@ -342,7 +342,7 @@ public class WebAppClassLoader extends URLClassLoader implements ClassVisibility } catch (Exception ex) { - LOG.warn(Log.EXCEPTION, ex); + LOG.warn("Unable to load WEB-INF/lib JAR {}", files[f], ex); } } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java index 9e7f78c089f..5b55d08712f 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java @@ -67,10 +67,10 @@ import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.DumpableCollection; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.ResourceCollection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Web Application Context Handler. @@ -154,7 +154,7 @@ import org.eclipse.jetty.util.resource.ResourceCollection; @ManagedObject("Web Application ContextHandler") public class WebAppContext extends ServletContextHandler implements WebAppClassLoader.Context { - static final Logger LOG = Log.getLogger(WebAppContext.class); + static final Logger LOG = LoggerFactory.getLogger(WebAppContext.class); public static final String TEMPDIR = "javax.servlet.context.tempdir"; public static final String BASETEMPDIR = "org.eclipse.jetty.webapp.basetempdir"; @@ -420,7 +420,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); if (ioe == null) ioe = e; } @@ -1163,7 +1163,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL } catch (IOException e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("Unable to find canonical path for {}", dir, e); } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebDescriptor.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebDescriptor.java index 64bff6779fd..e0e911c48e7 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebDescriptor.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebDescriptor.java @@ -24,10 +24,10 @@ import java.util.Iterator; import java.util.List; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.xml.XmlParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.xml.sax.InputSource; /** @@ -37,7 +37,7 @@ import org.xml.sax.InputSource; */ public class WebDescriptor extends Descriptor { - private static final Logger LOG = Log.getLogger(WebDescriptor.class); + private static final Logger LOG = LoggerFactory.getLogger(WebDescriptor.class); public static XmlParser __nonValidatingStaticParser = newParser(false); protected MetaData.Complete _metaDataComplete; @@ -47,13 +47,12 @@ public class WebDescriptor extends Descriptor protected boolean _distributable; protected boolean _isOrdered = false; protected List _ordering = new ArrayList<>(); - + /** * Check if the descriptor is metadata-complete. - * - * @param d the descriptor (web.xml, web-fragment.xml, + * + * @param d the descriptor (web.xml, web-fragment.xml, * web-default.xml, web-override.xml) to check - * * @return true iff metadata-complete=true is declared in the * descriptor */ @@ -64,7 +63,7 @@ public class WebDescriptor extends Descriptor /** * Get a parser for parsing web descriptor content. - * + * * @param validating true if the parser should validate syntax, false otherwise * @return an XmlParser for web descriptors */ @@ -75,10 +74,10 @@ public class WebDescriptor extends Descriptor else return newParser(true); } - + /** * Create a new parser for parsing web descriptors. - * + * * @param validating if true, the parser will validate syntax * @return an XmlParser */ @@ -148,7 +147,7 @@ public class WebDescriptor extends Descriptor } catch (Exception e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } finally { @@ -234,7 +233,7 @@ public class WebDescriptor extends Descriptor { super(xml); } - + @Override public void parse(XmlParser parser) throws Exception @@ -327,7 +326,7 @@ public class WebDescriptor extends Descriptor _ordering.add(node.toString(false, true)); } } - + public void processDistributable() { XmlParser.Node distributable = _root.get("distributable"); diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java index ad19b2d4d11..04caf29857b 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java @@ -29,16 +29,16 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.JarFileResource; import org.eclipse.jetty.util.resource.JarResource; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.ResourceCollection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class WebInfConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(WebInfConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(WebInfConfiguration.class); public static final String TEMPDIR_CONFIGURED = "org.eclipse.jetty.tmpdirConfigured"; public static final String TEMPORARY_RESOURCE_BASE = "org.eclipse.jetty.webapp.tmpResourceBase"; diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java index 0caa47b4b9a..0d587e6305d 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java @@ -22,16 +22,16 @@ import java.io.IOException; import java.net.MalformedURLException; import org.eclipse.jetty.servlet.ErrorPageErrorHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Configure by parsing default web.xml and web.xml */ public class WebXmlConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(WebXmlConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(WebXmlConfiguration.class); public WebXmlConfiguration() { diff --git a/jetty-webapp/src/test/java/org/acme/webapp/TestAnnotation.java b/jetty-webapp/src/test/java/org/acme/webapp/TestAnnotation.java index 34563b6a78c..9b5d0c23e7d 100644 --- a/jetty-webapp/src/test/java/org/acme/webapp/TestAnnotation.java +++ b/jetty-webapp/src/test/java/org/acme/webapp/TestAnnotation.java @@ -27,7 +27,7 @@ import org.eclipse.jetty.webapp.WebAppContext; public class TestAnnotation extends DiscoveredAnnotation { private List applications; - + public TestAnnotation(WebAppContext context, String className, Resource resource, List applications) { super(context, className, resource); diff --git a/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/TestMetaData.java b/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/TestMetaData.java index f02158bfe6c..1b226cc6926 100644 --- a/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/TestMetaData.java +++ b/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/TestMetaData.java @@ -87,7 +87,7 @@ public class TestMetaData assertTrue(wac.getMetaData().getWebInfResources(false).contains(fragResource)); assertTrue(wac.getMetaData().getWebInfResources(false).contains(nonFragResource)); } - + @Test public void testGetFragmentForJar() throws Exception { @@ -103,7 +103,7 @@ public class TestMetaData assertNull(wac.getMetaData().getFragmentDescriptorForJar(nonFragResource)); assertNull(wac.getMetaData().getFragmentDescriptorForJar(null)); } - + @Test public void testGetFragmentDescriptorByName() throws Exception { @@ -113,7 +113,7 @@ public class TestMetaData wac.getMetaData().addFragmentDescriptor(fragResource, fragDescriptor); assertNotNull(wac.getMetaData().getFragmentDescriptor(fragDescriptor.getName())); } - + @Test public void testGetFragmentDescriptorByLocation() throws Exception { @@ -123,7 +123,7 @@ public class TestMetaData wac.getMetaData().addFragmentDescriptor(fragResource, fragDescriptor); assertNotNull(wac.getMetaData().getFragmentDescriptor(webfragxml)); } - + @Test public void testGetJarForFragmentName() throws Exception { @@ -132,14 +132,13 @@ public class TestMetaData wac.getMetaData().addFragmentDescriptor(fragResource, new FragmentDescriptor(webfragxml)); FragmentDescriptor descriptor = wac.getMetaData().getFragmentDescriptorForJar(fragResource); assertNotNull(descriptor); - + assertNotNull(wac.getMetaData().getJarForFragmentName(descriptor.getName())); assertNull(wac.getMetaData().getJarForFragmentName(null)); assertNull(wac.getMetaData().getJarForFragmentName("")); assertNull(wac.getMetaData().getJarForFragmentName("xxx")); - } - + @Test public void testAddDiscoveredAnnotation() throws Exception { @@ -164,23 +163,23 @@ public class TestMetaData list = wac.getMetaData()._annotations.get(nonFragResource); assertThat(list, contains(annotationB)); assertThat(list, hasSize(1)); - + //test an annotation that didn't have an associated resource list = wac.getMetaData()._annotations.get(EmptyResource.INSTANCE); assertThat(list, contains(annotationC)); assertThat(list, hasSize(1)); - + //test an annotation that came from the container path list = wac.getMetaData()._annotations.get(containerDir); assertThat(list, contains(annotationD)); assertThat(list, hasSize(1)); - + //test an annoation from web-inf classes list = wac.getMetaData()._annotations.get(webInfClassesDir); assertThat(list, contains(annotationE)); assertThat(list, hasSize(1)); } - + @Test public void testResolve() throws Exception { @@ -189,13 +188,13 @@ public class TestMetaData wac.getMetaData().addFragmentDescriptor(fragResource, new FragmentDescriptor(webfragxml)); wac.getMetaData().addContainerResource(containerDir); wac.getMetaData().setWebInfClassesResources(Collections.singletonList(webInfClassesDir)); - + wac.getMetaData().addDiscoveredAnnotation(annotationA); wac.getMetaData().addDiscoveredAnnotation(annotationB); wac.getMetaData().addDiscoveredAnnotation(annotationC); wac.getMetaData().addDiscoveredAnnotation(annotationD); wac.getMetaData().addDiscoveredAnnotation(annotationE); - + wac.getMetaData().resolve(wac); //test that annotations are applied from resources in order: //no resource associated, container resources, web-inf classes resources, web-inf lib resources diff --git a/jetty-websocket/websocket-core/pom.xml b/jetty-websocket/websocket-core/pom.xml index be8510562c7..db70afa34be 100644 --- a/jetty-websocket/websocket-core/pom.xml +++ b/jetty-websocket/websocket-core/pom.xml @@ -30,6 +30,10 @@ jetty-http ${project.version} + + org.slf4j + slf4j-api + org.eclipse.jetty jetty-xml @@ -47,6 +51,12 @@ ${project.version} + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java index bb9a9d2e849..c4806edbc30 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java @@ -24,8 +24,8 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.compression.DeflaterPool; import org.eclipse.jetty.util.compression.InflaterPool; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ManagedObject("Abstract Extension") public class AbstractExtension implements Extension @@ -41,7 +41,7 @@ public class AbstractExtension implements Extension public AbstractExtension() { - log = Log.getLogger(this.getClass()); + log = LoggerFactory.getLogger(this.getClass()); } @Override diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Frame.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Frame.java index 5cd15ad0f33..5c44d9c4e77 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Frame.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Frame.java @@ -225,6 +225,7 @@ public class Frame * Get the payload of the frame as a UTF-8 string. *

Should only be used in testing, does not validate the * UTF-8 and a non fin frame can contain partial UTF-8 characters.

+ * * @return the payload as a UTF-8 string. */ public String getPayloadAsUTF8() diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/MessageHandler.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/MessageHandler.java index ca32eac0040..4a2620ddf4d 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/MessageHandler.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/MessageHandler.java @@ -27,10 +27,10 @@ import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IteratingNestedCallback; import org.eclipse.jetty.util.Utf8Appendable; import org.eclipse.jetty.util.Utf8StringBuilder; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.exception.BadPayloadException; import org.eclipse.jetty.websocket.core.exception.MessageTooLargeException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A utility implementation of FrameHandler that defragments @@ -87,7 +87,7 @@ public class MessageHandler implements FrameHandler }; } - protected static final Logger LOG = Log.getLogger(MessageHandler.class); + protected static final Logger LOG = LoggerFactory.getLogger(MessageHandler.class); private CoreSession coreSession; private Utf8StringBuilder textMessageBuffer; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/ClientUpgradeRequest.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/ClientUpgradeRequest.java index 4678bddb420..c37918952fe 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/ClientUpgradeRequest.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/ClientUpgradeRequest.java @@ -47,8 +47,6 @@ import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.Behavior; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.CoreSession; @@ -61,6 +59,8 @@ import org.eclipse.jetty.websocket.core.internal.ExtensionStack; import org.eclipse.jetty.websocket.core.internal.Negotiated; import org.eclipse.jetty.websocket.core.internal.WebSocketConnection; import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class ClientUpgradeRequest extends HttpRequest implements Response.CompleteListener, HttpUpgrader.Factory { @@ -76,7 +76,7 @@ public abstract class ClientUpgradeRequest extends HttpRequest implements Respon }; } - private static final Logger LOG = Log.getLogger(ClientUpgradeRequest.class); + private static final Logger LOG = LoggerFactory.getLogger(ClientUpgradeRequest.class); protected final CompletableFuture futureCoreSession; private final WebSocketCoreClient wsClient; private FrameHandler frameHandler; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java index e46906a6af3..194cddab347 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java @@ -19,8 +19,8 @@ package org.eclipse.jetty.websocket.core.client; import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.thread.QueuedThreadPool; +import org.slf4j.LoggerFactory; public interface HttpClientProvider { @@ -35,7 +35,7 @@ public interface HttpClientProvider } catch (Throwable x) { - Log.getLogger(HttpClientProvider.class).ignore(x); + LoggerFactory.getLogger(HttpClientProvider.class).trace("IGNORED", x); } return HttpClientProvider.newDefaultHttpClient(); diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java index ad83ad95d53..e4aa450d181 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java @@ -26,19 +26,19 @@ import java.util.concurrent.CompletableFuture; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.util.DecoratedObjectFactory; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.ExtensionConfig; import org.eclipse.jetty.websocket.core.FrameHandler; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.core.WebSocketExtensionRegistry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class WebSocketCoreClient extends ContainerLifeCycle { public static final String WEBSOCKET_CORECLIENT_ATTRIBUTE = WebSocketCoreClient.class.getName(); - private static final Logger LOG = Log.getLogger(WebSocketCoreClient.class); + private static final Logger LOG = LoggerFactory.getLogger(WebSocketCoreClient.class); private final HttpClient httpClient; private WebSocketComponents components; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/XmlHttpClientProvider.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/XmlHttpClientProvider.java index 0058a4f376c..26661385300 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/XmlHttpClientProvider.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/XmlHttpClientProvider.java @@ -21,12 +21,15 @@ package org.eclipse.jetty.websocket.core.client; import java.net.URL; import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.xml.XmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; class XmlHttpClientProvider implements HttpClientProvider { + private static final Logger LOG = LoggerFactory.getLogger(XmlHttpClientProvider.class); + @Override public HttpClient newHttpClient() { @@ -43,7 +46,7 @@ class XmlHttpClientProvider implements HttpClientProvider } catch (Throwable t) { - Log.getLogger(XmlHttpClientProvider.class).warn("Unable to load: " + resource, t); + LOG.warn("Unable to load: {}", resource, t); } return null; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ExtensionStack.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ExtensionStack.java index c1e0cc448e9..28f3232c816 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ExtensionStack.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ExtensionStack.java @@ -30,8 +30,6 @@ import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.Behavior; import org.eclipse.jetty.websocket.core.Extension; import org.eclipse.jetty.websocket.core.ExtensionConfig; @@ -40,6 +38,8 @@ import org.eclipse.jetty.websocket.core.IncomingFrames; import org.eclipse.jetty.websocket.core.OutgoingFrames; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.core.exception.WebSocketException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Represents the stack of Extensions. @@ -47,7 +47,7 @@ import org.eclipse.jetty.websocket.core.exception.WebSocketException; @ManagedObject("Extension Stack") public class ExtensionStack implements IncomingFrames, OutgoingFrames, Dumpable { - private static final Logger LOG = Log.getLogger(ExtensionStack.class); + private static final Logger LOG = LoggerFactory.getLogger(ExtensionStack.class); private final WebSocketComponents components; private final Behavior behavior; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentExtension.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentExtension.java index 6d1cecab62a..c4dd10da864 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentExtension.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentExtension.java @@ -19,20 +19,20 @@ package org.eclipse.jetty.websocket.core.internal; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.AbstractExtension; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.ExtensionConfig; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.WebSocketComponents; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Fragment Extension */ public class FragmentExtension extends AbstractExtension { - private static final Logger LOG = Log.getLogger(FragmentExtension.class); + private static final Logger LOG = LoggerFactory.getLogger(FragmentExtension.class); private final FragmentingFlusher flusher; private final Configuration configuration = new Configuration.ConfigurationCustomizer(); diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentingFlusher.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentingFlusher.java index aa818c95073..142f4b5a871 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentingFlusher.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentingFlusher.java @@ -21,11 +21,11 @@ package org.eclipse.jetty.websocket.core.internal; import java.nio.ByteBuffer; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Used to split large data frames into multiple frames below the maxFrameSize. @@ -34,7 +34,7 @@ import org.eclipse.jetty.websocket.core.OpCode; */ public abstract class FragmentingFlusher extends TransformingFlusher { - private static final Logger LOG = Log.getLogger(FragmentingFlusher.class); + private static final Logger LOG = LoggerFactory.getLogger(FragmentingFlusher.class); private final Configuration configuration; private FrameEntry current; private ByteBuffer payload; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameCaptureExtension.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameCaptureExtension.java index fe9b4894b41..a4b7ccb73f4 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameCaptureExtension.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameCaptureExtension.java @@ -30,19 +30,19 @@ import java.util.concurrent.atomic.AtomicInteger; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.AbstractExtension; import org.eclipse.jetty.websocket.core.ExtensionConfig; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.WebSocketComponents; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.nio.file.StandardOpenOption.CREATE; import static java.nio.file.StandardOpenOption.WRITE; public class FrameCaptureExtension extends AbstractExtension { - private static final Logger LOG = Log.getLogger(FrameCaptureExtension.class); + private static final Logger LOG = LoggerFactory.getLogger(FrameCaptureExtension.class); private static final int BUFSIZE = 32768; private Generator generator; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameFlusher.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameFlusher.java index 6bd8684add0..c7633d291e5 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameFlusher.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameFlusher.java @@ -35,19 +35,19 @@ import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IteratingCallback; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; import org.eclipse.jetty.websocket.core.exception.WebSocketException; import org.eclipse.jetty.websocket.core.exception.WebSocketWriteTimeoutException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class FrameFlusher extends IteratingCallback { public static final Frame FLUSH_FRAME = new Frame(OpCode.BINARY); - private static final Logger LOG = Log.getLogger(FrameFlusher.class); + private static final Logger LOG = LoggerFactory.getLogger(FrameFlusher.class); private static final Throwable CLOSED_CHANNEL = new ClosedChannelException(); private final LongAdder messagesOut = new LongAdder(); diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/Parser.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/Parser.java index 9ba506a8218..204dbec29b8 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/Parser.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/Parser.java @@ -24,8 +24,6 @@ import java.nio.ByteBuffer; import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.Frame; @@ -33,6 +31,8 @@ import org.eclipse.jetty.websocket.core.OpCode; import org.eclipse.jetty.websocket.core.exception.MessageTooLargeException; import org.eclipse.jetty.websocket.core.exception.ProtocolException; import org.eclipse.jetty.websocket.core.exception.WebSocketException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Parsing of a frames in WebSocket land. @@ -50,7 +50,7 @@ public class Parser FRAGMENT } - private static final Logger LOG = Log.getLogger(Parser.class); + private static final Logger LOG = LoggerFactory.getLogger(Parser.class); private final ByteBufferPool bufferPool; private final Configuration configuration; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/PerMessageDeflateExtension.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/PerMessageDeflateExtension.java index 64f96125549..a5df5908c34 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/PerMessageDeflateExtension.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/PerMessageDeflateExtension.java @@ -27,8 +27,6 @@ import java.util.zip.Inflater; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.AbstractExtension; import org.eclipse.jetty.websocket.core.ExtensionConfig; import org.eclipse.jetty.websocket.core.Frame; @@ -37,6 +35,8 @@ import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.core.exception.BadPayloadException; import org.eclipse.jetty.websocket.core.exception.MessageTooLargeException; import org.eclipse.jetty.websocket.core.exception.ProtocolException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Per Message Deflate Compression extension for WebSocket. @@ -47,7 +47,7 @@ public class PerMessageDeflateExtension extends AbstractExtension { private static final byte[] TAIL_BYTES = new byte[]{0x00, 0x00, (byte)0xFF, (byte)0xFF}; private static final ByteBuffer TAIL_BYTES_BUF = ByteBuffer.wrap(TAIL_BYTES); - private static final Logger LOG = Log.getLogger(PerMessageDeflateExtension.class); + private static final Logger LOG = LoggerFactory.getLogger(PerMessageDeflateExtension.class); private static final int DEFAULT_BUF_SIZE = 8 * 1024; private final TransformingFlusher outgoingFlusher; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/TransformingFlusher.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/TransformingFlusher.java index e6111f759da..28d30165aa3 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/TransformingFlusher.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/TransformingFlusher.java @@ -23,9 +23,9 @@ import java.util.Queue; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IteratingCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.Frame; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This is used to iteratively transform or process a frame into one or more other frames. @@ -36,7 +36,7 @@ import org.eclipse.jetty.websocket.core.Frame; */ public abstract class TransformingFlusher { - private final Logger log = Log.getLogger(this.getClass()); + private final Logger log = LoggerFactory.getLogger(this.getClass()); private final Queue entries = new ArrayDeque<>(); private final IteratingCallback flusher = new Flusher(); diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ValidationExtension.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ValidationExtension.java index 3cc5f0166ee..3a35ae691b0 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ValidationExtension.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ValidationExtension.java @@ -21,14 +21,14 @@ package org.eclipse.jetty.websocket.core.internal; import java.util.Map; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.AbstractExtension; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.ExtensionConfig; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.core.exception.ProtocolException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.eclipse.jetty.websocket.core.OpCode.CONTINUATION; import static org.eclipse.jetty.websocket.core.OpCode.TEXT; @@ -36,7 +36,7 @@ import static org.eclipse.jetty.websocket.core.OpCode.UNDEFINED; public class ValidationExtension extends AbstractExtension { - private static final Logger LOG = Log.getLogger(ValidationExtension.class); + private static final Logger LOG = LoggerFactory.getLogger(ValidationExtension.class); private WebSocketCoreSession coreSession; private FrameSequence incomingSequence = null; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketConnection.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketConnection.java index 133a44f972c..e83759e7285 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketConnection.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketConnection.java @@ -34,19 +34,19 @@ import org.eclipse.jetty.io.RetainableByteBuffer; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.websocket.core.Behavior; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.exception.WebSocketTimeoutException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Provides the implementation of {@link org.eclipse.jetty.io.Connection} that is suitable for WebSocket */ public class WebSocketConnection extends AbstractConnection implements Connection.UpgradeTo, Dumpable, Runnable { - private static final Logger LOG = Log.getLogger(WebSocketConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(WebSocketConnection.class); /** * Minimum size of a buffer is the determined to be what would be the maximum framing header size (not including payload) diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCoreSession.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCoreSession.java index 18d9b079c76..984269d4a65 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCoreSession.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCoreSession.java @@ -33,8 +33,6 @@ import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.Utf8Appendable; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.Behavior; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Configuration; @@ -53,6 +51,8 @@ import org.eclipse.jetty.websocket.core.exception.ProtocolException; import org.eclipse.jetty.websocket.core.exception.WebSocketTimeoutException; import org.eclipse.jetty.websocket.core.exception.WebSocketWriteTimeoutException; import org.eclipse.jetty.websocket.core.internal.Parser.ParsedFrame; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.eclipse.jetty.util.Callback.NOOP; @@ -61,7 +61,7 @@ import static org.eclipse.jetty.util.Callback.NOOP; */ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpable { - private static final Logger LOG = Log.getLogger(WebSocketCoreSession.class); + private static final Logger LOG = LoggerFactory.getLogger(WebSocketCoreSession.class); private static final CloseStatus NO_CODE = new CloseStatus(CloseStatus.NO_CODE); private final WebSocketComponents components; @@ -354,7 +354,7 @@ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpab } catch (Throwable e) { - LOG.warn(e); + LOG.warn("Failure from onClosed on handler {}", handler, e); callback.failed(e); } }); @@ -368,7 +368,7 @@ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpab { if (e != cause) cause.addSuppressed(e); - LOG.warn(cause); + LOG.warn("Failure from onError on handler {}", handler, cause); errorCallback.failed(cause); } } @@ -380,7 +380,7 @@ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpab } catch (Throwable e) { - LOG.warn(e); + LOG.warn("Failure from onClosed on handler {}", handler, e); callback.failed(e); } } diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketUpgradeHandler.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketUpgradeHandler.java index 58b727ab030..e85fda1d2be 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketUpgradeHandler.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketUpgradeHandler.java @@ -28,13 +28,13 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.pathmap.PathSpecSet; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.handler.HandlerWrapper; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.FrameHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class WebSocketUpgradeHandler extends HandlerWrapper { - static final Logger LOG = Log.getLogger(WebSocketUpgradeHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(WebSocketUpgradeHandler.class); final Handshaker handshaker = Handshaker.newInstance(); final PathSpecSet paths = new PathSpecSet(); final WebSocketNegotiator negotiator; diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/AbstractHandshaker.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/AbstractHandshaker.java index 7946371e847..77062cfc100 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/AbstractHandshaker.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/AbstractHandshaker.java @@ -34,8 +34,6 @@ import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpTransport; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Response; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.websocket.core.Behavior; import org.eclipse.jetty.websocket.core.Configuration; @@ -51,10 +49,12 @@ import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession; import org.eclipse.jetty.websocket.core.server.Handshaker; import org.eclipse.jetty.websocket.core.server.Negotiation; import org.eclipse.jetty.websocket.core.server.WebSocketNegotiator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class AbstractHandshaker implements Handshaker { - protected static final Logger LOG = Log.getLogger(AbstractHandshaker.class); + protected static final Logger LOG = LoggerFactory.getLogger(AbstractHandshaker.class); private static final HttpField SERVER_VERSION = new PreEncodedHttpField(HttpHeader.SERVER, HttpConfiguration.SERVER_VERSION); @Override diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java index 51e0c0a1400..5456640b22e 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java @@ -28,8 +28,6 @@ import org.eclipse.jetty.toolchain.test.ByteBufferAssert; import org.eclipse.jetty.toolchain.test.Hex; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.exception.ProtocolException; import org.eclipse.jetty.websocket.core.exception.WebSocketException; import org.eclipse.jetty.websocket.core.internal.ExtensionStack; @@ -38,6 +36,8 @@ import org.eclipse.jetty.websocket.core.internal.Negotiated; import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; public class GeneratorTest { - private static final Logger LOG = Log.getLogger(Helper.class); + private static final Logger LOG = LoggerFactory.getLogger(Helper.class); private static Generator generator = new Generator(); private static WebSocketCoreSession coreSession = newWebSocketCoreSession(Behavior.SERVER); diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestAsyncFrameHandler.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestAsyncFrameHandler.java index aafff9b7539..626cb32df8a 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestAsyncFrameHandler.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestAsyncFrameHandler.java @@ -23,12 +23,12 @@ import java.util.concurrent.CountDownLatch; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestAsyncFrameHandler implements FrameHandler { - protected static final Logger LOG = Log.getLogger(TestAsyncFrameHandler.class); + protected static final Logger LOG = LoggerFactory.getLogger(TestAsyncFrameHandler.class); protected final String name; public CoreSession coreSession; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestFrameHandler.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestFrameHandler.java index f1e6e28968c..b5f0f5317cb 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestFrameHandler.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestFrameHandler.java @@ -24,12 +24,12 @@ import java.util.concurrent.CountDownLatch; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestFrameHandler implements SynchronousFrameHandler { - private static Logger LOG = Log.getLogger(TestFrameHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(TestFrameHandler.class); protected CoreSession coreSession; public BlockingQueue receivedFrames = new BlockingArrayQueue<>(); diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestMessageHandler.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestMessageHandler.java index caa0d8e5282..9cabd34c483 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestMessageHandler.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestMessageHandler.java @@ -24,12 +24,12 @@ import java.util.concurrent.CountDownLatch; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestMessageHandler extends MessageHandler { - protected static final Logger LOG = Log.getLogger(TestMessageHandler.class); + protected static final Logger LOG = LoggerFactory.getLogger(TestMessageHandler.class); public CoreSession coreSession; public BlockingQueue textMessages = new BlockingArrayQueue<>(); diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java index 4a47c433aaf..334b3984238 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java @@ -36,8 +36,6 @@ import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession; @@ -47,6 +45,8 @@ import org.eclipse.jetty.websocket.core.server.internal.RFC6455Handshaker; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.eclipse.jetty.util.Callback.NOOP; import static org.hamcrest.MatcherAssert.assertThat; @@ -66,7 +66,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; */ public class WebSocketCloseTest extends WebSocketTester { - private static Logger LOG = Log.getLogger(WebSocketCloseTest.class); + private static Logger LOG = LoggerFactory.getLogger(WebSocketCloseTest.class); private static final String WS_SCHEME = "ws"; private static final String WSS_SCHEME = "wss"; @@ -601,7 +601,7 @@ public class WebSocketCloseTest extends WebSocketTester static class WebSocketServer extends AbstractLifeCycle { - private static Logger LOG = Log.getLogger(WebSocketServer.class); + private static Logger LOG = LoggerFactory.getLogger(WebSocketServer.class); private final Server server; private final DemandingTestFrameHandler handler; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java index 4d3b32a0600..a96241d613d 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java @@ -25,12 +25,12 @@ import java.util.function.BiFunction; import org.eclipse.jetty.logging.StacklessLogging; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.internal.Parser; import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.eclipse.jetty.util.Callback.NOOP; import static org.hamcrest.MatcherAssert.assertThat; @@ -46,7 +46,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; */ public class WebSocketOpenTest extends WebSocketTester { - private static Logger LOG = Log.getLogger(WebSocketOpenTest.class); + private static Logger LOG = LoggerFactory.getLogger(WebSocketOpenTest.class); private WebSocketServer server; private DemandingAsyncFrameHandler serverHandler; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnClient.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnClient.java index b6984a5c56c..79252a0c1a3 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnClient.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnClient.java @@ -27,11 +27,11 @@ import java.util.concurrent.TimeoutException; import org.eclipse.jetty.util.Jetty; import org.eclipse.jetty.util.UrlEncoded; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.TestMessageHandler; import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -137,7 +137,7 @@ public class CoreAutobahnClient } } - private static final Logger LOG = Log.getLogger(CoreAutobahnClient.class); + private static final Logger LOG = LoggerFactory.getLogger(CoreAutobahnClient.class); private URI baseWebsocketUri; private WebSocketCoreClient client; private String userAgent; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketClient.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketClient.java index 01363db55f1..e5192c37dc3 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketClient.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketClient.java @@ -28,15 +28,15 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.MessageHandler; import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest; import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ChatWebSocketClient { - private static Logger LOG = Log.getLogger(ChatWebSocketClient.class); + private static Logger LOG = LoggerFactory.getLogger(ChatWebSocketClient.class); private URI baseWebsocketUri; private WebSocketCoreClient client; @@ -102,7 +102,7 @@ public class ChatWebSocketClient } LOG.debug("sending {}...", line); - handler.sendText(Callback.from(() -> LOG.debug("message sent"), LOG::warn), false, name, ": ", line); + handler.sendText(Callback.from(() -> LOG.debug("message sent"), (cause) -> LOG.warn("message send failure", cause)), false, name, ": ", line); } public static void main(String[] args) diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/client/WebSocketClientServerTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/client/WebSocketClientServerTest.java index 59754fbc0d9..8a4260cad67 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/client/WebSocketClientServerTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/client/WebSocketClientServerTest.java @@ -24,8 +24,6 @@ import java.util.concurrent.TimeUnit; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; @@ -35,6 +33,8 @@ import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession; import org.hamcrest.Matchers; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; */ public class WebSocketClientServerTest { - private static Logger LOG = Log.getLogger(WebSocketClientServerTest.class); + private static Logger LOG = LoggerFactory.getLogger(WebSocketClientServerTest.class); private WebSocketServer server; private TestFrameHandler serverHandler; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionStackTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionStackTest.java index 095c49df49e..2039144db03 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionStackTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionStackTest.java @@ -21,8 +21,6 @@ package org.eclipse.jetty.websocket.core.extensions; import java.util.ArrayList; import java.util.List; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.Behavior; import org.eclipse.jetty.websocket.core.Extension; import org.eclipse.jetty.websocket.core.ExtensionConfig; @@ -35,6 +33,8 @@ import org.eclipse.jetty.websocket.core.internal.ExtensionStack; import org.eclipse.jetty.websocket.core.internal.IdentityExtension; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -42,7 +42,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class ExtensionStackTest { - private static final Logger LOG = Log.getLogger(ExtensionStackTest.class); + private static final Logger LOG = LoggerFactory.getLogger(ExtensionStackTest.class); private static ExtensionStack stack; @BeforeAll diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/internal/FrameFlusherTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/internal/FrameFlusherTest.java index 2cf27eb1fd6..2e376571e18 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/internal/FrameFlusherTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/internal/FrameFlusherTest.java @@ -35,8 +35,6 @@ import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.io.MappedByteBufferPool; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FutureCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.websocket.core.CloseStatus; @@ -47,6 +45,8 @@ import org.eclipse.jetty.websocket.core.exception.WebSocketWriteTimeoutException import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.nio.charset.StandardCharsets.UTF_8; import static org.hamcrest.MatcherAssert.assertThat; @@ -276,7 +276,7 @@ public class FrameFlusherTest public static class BlockingEndpoint extends CapturingEndPoint { - private static final Logger LOG = Log.getLogger(BlockingEndpoint.class); + private static final Logger LOG = LoggerFactory.getLogger(BlockingEndpoint.class); private long blockTime = 0; public CountDownLatch closeLatch = new CountDownLatch(1); diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxy.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxy.java index b014fcd3380..5d6944e0bdc 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxy.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxy.java @@ -26,18 +26,18 @@ import java.util.concurrent.CountDownLatch; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.FrameHandler; import org.eclipse.jetty.websocket.core.OpCode; import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; class WebSocketProxy { - protected static final Logger LOG = Log.getLogger(WebSocketProxy.class); + protected static final Logger LOG = LoggerFactory.getLogger(WebSocketProxy.class); enum State { diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/server/WebSocketServerTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/server/WebSocketServerTest.java index 04d77ef5ab6..66f235de234 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/server/WebSocketServerTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/server/WebSocketServerTest.java @@ -27,8 +27,6 @@ import java.util.concurrent.atomic.AtomicReference; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; @@ -40,6 +38,8 @@ import org.eclipse.jetty.websocket.core.WebSocketTester; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -53,7 +53,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; */ public class WebSocketServerTest extends WebSocketTester { - private static Logger LOG = Log.getLogger(WebSocketServerTest.class); + private static Logger LOG = LoggerFactory.getLogger(WebSocketServerTest.class); private WebSocketServer server; diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketAsyncRemote.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketAsyncRemote.java index c38a6af7176..ab86f54b4bd 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketAsyncRemote.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketAsyncRemote.java @@ -28,18 +28,18 @@ import javax.websocket.SendResult; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.FutureCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; import org.eclipse.jetty.websocket.util.TextUtil; import org.eclipse.jetty.websocket.util.messages.MessageOutputStream; import org.eclipse.jetty.websocket.util.messages.MessageWriter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JavaxWebSocketAsyncRemote extends JavaxWebSocketRemoteEndpoint implements javax.websocket.RemoteEndpoint.Async { - static final Logger LOG = Log.getLogger(JavaxWebSocketAsyncRemote.class); + static final Logger LOG = LoggerFactory.getLogger(JavaxWebSocketAsyncRemote.class); protected JavaxWebSocketAsyncRemote(JavaxWebSocketSession session, CoreSession coreSession) { diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketBasicRemote.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketBasicRemote.java index 53c02f78083..a119ebf1f9c 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketBasicRemote.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketBasicRemote.java @@ -28,18 +28,18 @@ import javax.websocket.RemoteEndpoint; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.FutureCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; import org.eclipse.jetty.websocket.util.TextUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.nio.charset.StandardCharsets.UTF_8; public class JavaxWebSocketBasicRemote extends JavaxWebSocketRemoteEndpoint implements RemoteEndpoint.Basic { - private static final Logger LOG = Log.getLogger(JavaxWebSocketBasicRemote.class); + private static final Logger LOG = LoggerFactory.getLogger(JavaxWebSocketBasicRemote.class); protected JavaxWebSocketBasicRemote(JavaxWebSocketSession session, CoreSession coreSession) { @@ -121,7 +121,6 @@ public class JavaxWebSocketBasicRemote extends JavaxWebSocketRemoteEndpoint impl LOG.debug("sendText({})", TextUtil.hint(text)); } - FutureCallback b = new FutureCallback(); sendFrame(new Frame(OpCode.TEXT).setPayload(text), b, false); b.block(getBlockingTimeout(), TimeUnit.MILLISECONDS); diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketContainer.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketContainer.java index e9b241e0a70..44c07a2815b 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketContainer.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketContainer.java @@ -31,15 +31,15 @@ import javax.websocket.WebSocketContainer; import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.util.DecoratedObjectFactory; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.core.WebSocketExtensionRegistry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class JavaxWebSocketContainer extends ContainerLifeCycle implements javax.websocket.WebSocketContainer { - private static final Logger LOG = Log.getLogger(JavaxWebSocketContainer.class); + private static final Logger LOG = LoggerFactory.getLogger(JavaxWebSocketContainer.class); private final SessionTracker sessionTracker = new SessionTracker(); private final List sessionListeners = new ArrayList<>(); protected final Configuration.ConfigurationCustomizer defaultCustomizer = new Configuration.ConfigurationCustomizer(); diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java index 911ed9f824e..dcd6ad1189b 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java @@ -38,8 +38,6 @@ import javax.websocket.server.ServerEndpointConfig; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; @@ -57,6 +55,8 @@ import org.eclipse.jetty.websocket.util.messages.MessageSink; import org.eclipse.jetty.websocket.util.messages.PartialByteArrayMessageSink; import org.eclipse.jetty.websocket.util.messages.PartialByteBufferMessageSink; import org.eclipse.jetty.websocket.util.messages.PartialStringMessageSink; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JavaxWebSocketFrameHandler implements FrameHandler { @@ -119,13 +119,13 @@ public class JavaxWebSocketFrameHandler implements FrameHandler MethodHandle pongHandle, EndpointConfig endpointConfig) { - this.logger = Log.getLogger(endpointInstance.getClass()); + this.logger = LoggerFactory.getLogger(endpointInstance.getClass()); this.container = container; if (endpointInstance instanceof ConfiguredEndpoint) { RuntimeException oops = new RuntimeException("ConfiguredEndpoint needs to be unwrapped"); - logger.warn(oops); + logger.warn("Unexpected ConfiguredEndpoint", oops); throw oops; } this.endpointInstance = endpointInstance; diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketRemoteEndpoint.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketRemoteEndpoint.java index 9f541a0e83c..82c23d3bb3e 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketRemoteEndpoint.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketRemoteEndpoint.java @@ -29,8 +29,6 @@ import javax.websocket.SendHandler; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FutureCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; @@ -38,10 +36,12 @@ import org.eclipse.jetty.websocket.core.OutgoingFrames; import org.eclipse.jetty.websocket.core.exception.WebSocketException; import org.eclipse.jetty.websocket.util.messages.MessageOutputStream; import org.eclipse.jetty.websocket.util.messages.MessageWriter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JavaxWebSocketRemoteEndpoint implements javax.websocket.RemoteEndpoint, OutgoingFrames { - private static final Logger LOG = Log.getLogger(JavaxWebSocketRemoteEndpoint.class); + private static final Logger LOG = LoggerFactory.getLogger(JavaxWebSocketRemoteEndpoint.class); protected final JavaxWebSocketSession session; private final CoreSession coreSession; diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketSession.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketSession.java index 2c7377c37ee..9cbe7d6056d 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketSession.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketSession.java @@ -40,20 +40,20 @@ import javax.websocket.Session; import javax.websocket.WebSocketContainer; import org.eclipse.jetty.util.FutureCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.ExtensionConfig; import org.eclipse.jetty.websocket.javax.common.decoders.AvailableDecoders; import org.eclipse.jetty.websocket.javax.common.encoders.AvailableEncoders; import org.eclipse.jetty.websocket.util.ReflectUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Client Session for the JSR. */ public class JavaxWebSocketSession implements javax.websocket.Session { - private static final Logger LOG = Log.getLogger(JavaxWebSocketSession.class); + private static final Logger LOG = LoggerFactory.getLogger(JavaxWebSocketSession.class); private final JavaxWebSocketContainer container; private final CoreSession coreSession; @@ -199,7 +199,7 @@ public class JavaxWebSocketSession implements javax.websocket.Session } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/SessionTracker.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/SessionTracker.java index afb500d7fa8..6010f9bae72 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/SessionTracker.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/SessionTracker.java @@ -26,12 +26,12 @@ import javax.websocket.CloseReason; import javax.websocket.Session; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SessionTracker extends AbstractLifeCycle implements JavaxWebSocketSessionListener { - private static final Logger LOG = Log.getLogger(SessionTracker.class); + private static final Logger LOG = LoggerFactory.getLogger(SessionTracker.class); private CopyOnWriteArraySet sessions = new CopyOnWriteArraySet<>(); @@ -64,7 +64,7 @@ public class SessionTracker extends AbstractLifeCycle implements JavaxWebSocketS } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/messages/DecodedMessageSink.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/messages/DecodedMessageSink.java index f784f661f55..1c6e195fbaa 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/messages/DecodedMessageSink.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/messages/DecodedMessageSink.java @@ -22,12 +22,12 @@ import java.lang.invoke.MethodHandle; import javax.websocket.Decoder; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.util.messages.AbstractMessageSink; import org.eclipse.jetty.websocket.util.messages.MessageSink; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class DecodedMessageSink extends AbstractMessageSink { @@ -40,7 +40,7 @@ public abstract class DecodedMessageSink extends AbstractMess throws NoSuchMethodException, IllegalAccessException { super(session, methodHandle); - this.logger = Log.getLogger(this.getClass()); + this.logger = LoggerFactory.getLogger(this.getClass()); this.decoder = decoder; this.rawMethodHandle = newRawMethodHandle(); this.rawMessageSink = newRawMessageSink(session, rawMethodHandle); diff --git a/jetty-websocket/websocket-javax-common/src/test/java/org/eclipse/jetty/websocket/javax/common/endpoints/AbstractStringEndpoint.java b/jetty-websocket/websocket-javax-common/src/test/java/org/eclipse/jetty/websocket/javax/common/endpoints/AbstractStringEndpoint.java index 0e66a3d192d..5a24ae41dc6 100644 --- a/jetty-websocket/websocket-javax-common/src/test/java/org/eclipse/jetty/websocket/javax/common/endpoints/AbstractStringEndpoint.java +++ b/jetty-websocket/websocket-javax-common/src/test/java/org/eclipse/jetty/websocket/javax/common/endpoints/AbstractStringEndpoint.java @@ -27,12 +27,12 @@ import javax.websocket.EndpointConfig; import javax.websocket.MessageHandler; import javax.websocket.Session; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.javax.common.Defaults; import org.hamcrest.Matcher; import org.hamcrest.Matchers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -42,7 +42,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; */ public abstract class AbstractStringEndpoint extends Endpoint implements MessageHandler.Whole { - private static final Logger LOG = Log.getLogger(AbstractStringEndpoint.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractStringEndpoint.class); public CountDownLatch closeLatch = new CountDownLatch(1); public AtomicReference closeInfo = new AtomicReference<>(); protected Session session; diff --git a/jetty-websocket/websocket-javax-server/src/main/config/modules/websocket-javax.mod b/jetty-websocket/websocket-javax-server/src/main/config/modules/websocket-javax.mod index 62ba7f8f59b..2f0ae30c75b 100644 --- a/jetty-websocket/websocket-javax-server/src/main/config/modules/websocket-javax.mod +++ b/jetty-websocket/websocket-javax-server/src/main/config/modules/websocket-javax.mod @@ -12,10 +12,12 @@ annotations [lib] lib/websocket/websocket-core-${jetty.version}.jar -lib/websocket/websocket-util-${jetty.version}.jar lib/websocket/websocket-servlet-${jetty.version}.jar +lib/websocket/websocket-util-${jetty.version}.jar lib/websocket/jetty-javax-websocket-api-1.1.2.jar -lib/websocket/websocket-javax-*.jar +lib/websocket/websocket-javax-client-${jetty.version}.jar +lib/websocket/websocket-javax-common-${jetty.version}.jar +lib/websocket/websocket-javax-server-${jetty.version}.jar [jpms] # The implementation needs to access method handles in diff --git a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/ContainerDefaultConfigurator.java b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/ContainerDefaultConfigurator.java index c3adac06748..0c33c0ad38d 100644 --- a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/ContainerDefaultConfigurator.java +++ b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/ContainerDefaultConfigurator.java @@ -27,8 +27,8 @@ import javax.websocket.server.HandshakeRequest; import javax.websocket.server.ServerEndpointConfig; import javax.websocket.server.ServerEndpointConfig.Configurator; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The "Container Default Configurator" per the JSR-356 spec. @@ -37,7 +37,7 @@ import org.eclipse.jetty.util.log.Logger; */ public final class ContainerDefaultConfigurator extends Configurator { - private static final Logger LOG = Log.getLogger(ContainerDefaultConfigurator.class); + private static final Logger LOG = LoggerFactory.getLogger(ContainerDefaultConfigurator.class); private static final String NO_SUBPROTOCOL = ""; /** diff --git a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/JavaxWebSocketServletContainerInitializer.java b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/JavaxWebSocketServletContainerInitializer.java index 2b5bbfe79f5..797c9c1f1a8 100644 --- a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/JavaxWebSocketServletContainerInitializer.java +++ b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/JavaxWebSocketServletContainerInitializer.java @@ -35,13 +35,13 @@ import org.eclipse.jetty.servlet.FilterHolder; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.listener.ContainerInitializer; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ThreadClassLoaderScope; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.javax.server.internal.JavaxWebSocketServerContainer; import org.eclipse.jetty.websocket.servlet.WebSocketMapping; import org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @HandlesTypes({ServerApplicationConfig.class, ServerEndpoint.class, Endpoint.class}) public class JavaxWebSocketServletContainerInitializer implements ServletContainerInitializer @@ -54,7 +54,7 @@ public class JavaxWebSocketServletContainerInitializer implements ServletContain public static final String ENABLE_KEY = "org.eclipse.jetty.websocket.javax"; public static final String HTTPCLIENT_ATTRIBUTE = "org.eclipse.jetty.websocket.javax.HttpClient"; - private static final Logger LOG = Log.getLogger(JavaxWebSocketServletContainerInitializer.class); + private static final Logger LOG = LoggerFactory.getLogger(JavaxWebSocketServletContainerInitializer.class); /** * Test a ServletContext for {@code init-param} or {@code attribute} at {@code keyName} for diff --git a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketCreator.java b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketCreator.java index 2c5c56f7dbd..de98982caac 100644 --- a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketCreator.java +++ b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketCreator.java @@ -31,8 +31,6 @@ import javax.websocket.server.ServerEndpointConfig; import org.eclipse.jetty.http.pathmap.PathSpec; import org.eclipse.jetty.http.pathmap.UriTemplatePathSpec; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.ExtensionConfig; import org.eclipse.jetty.websocket.core.WebSocketExtensionRegistry; import org.eclipse.jetty.websocket.javax.common.ConfiguredEndpoint; @@ -42,13 +40,15 @@ import org.eclipse.jetty.websocket.javax.common.ServerEndpointConfigWrapper; import org.eclipse.jetty.websocket.servlet.ServletUpgradeRequest; import org.eclipse.jetty.websocket.servlet.ServletUpgradeResponse; import org.eclipse.jetty.websocket.servlet.WebSocketCreator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JavaxWebSocketCreator implements WebSocketCreator { public static final String PROP_REMOTE_ADDRESS = "javax.websocket.endpoint.remoteAddress"; public static final String PROP_LOCAL_ADDRESS = "javax.websocket.endpoint.localAddress"; public static final String PROP_LOCALES = "javax.websocket.upgrade.locales"; - private static final Logger LOG = Log.getLogger(JavaxWebSocketCreator.class); + private static final Logger LOG = LoggerFactory.getLogger(JavaxWebSocketCreator.class); private final JavaxWebSocketContainer containerScope; private final ServerEndpointConfig baseConfig; private final WebSocketExtensionRegistry extensionRegistry; diff --git a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerContainer.java b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerContainer.java index 0c84a4ab83d..2248dd02933 100644 --- a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerContainer.java +++ b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerContainer.java @@ -34,20 +34,20 @@ import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient; import org.eclipse.jetty.websocket.core.exception.WebSocketException; import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer; import org.eclipse.jetty.websocket.javax.server.config.JavaxWebSocketServletContainerInitializer; import org.eclipse.jetty.websocket.servlet.WebSocketMapping; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ManagedObject("JSR356 Server Container") public class JavaxWebSocketServerContainer extends JavaxWebSocketClientContainer implements javax.websocket.server.ServerContainer, LifeCycle.Listener { public static final String JAVAX_WEBSOCKET_CONTAINER_ATTRIBUTE = javax.websocket.server.ServerContainer.class.getName(); - private static final Logger LOG = Log.getLogger(JavaxWebSocketServerContainer.class); + private static final Logger LOG = LoggerFactory.getLogger(JavaxWebSocketServerContainer.class); public static JavaxWebSocketServerContainer getContainer(ServletContext servletContext) { diff --git a/jetty-websocket/websocket-javax-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserDebugTool.java b/jetty-websocket/websocket-javax-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserDebugTool.java index f77b365005e..23066040239 100644 --- a/jetty-websocket/websocket-javax-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserDebugTool.java +++ b/jetty-websocket/websocket-javax-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserDebugTool.java @@ -30,10 +30,10 @@ import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.websocket.javax.server.config.JavaxWebSocketServletContainerInitializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Tool to help debug JSR based websocket circumstances reported around browsers. @@ -43,7 +43,7 @@ import org.eclipse.jetty.websocket.javax.server.config.JavaxWebSocketServletCont */ public class JsrBrowserDebugTool { - private static final Logger LOG = Log.getLogger(JsrBrowserDebugTool.class); + private static final Logger LOG = LoggerFactory.getLogger(JsrBrowserDebugTool.class); public static void main(String[] args) { @@ -68,7 +68,7 @@ public class JsrBrowserDebugTool } catch (Throwable t) { - LOG.warn(t); + LOG.warn("Unable to start {}", JsrBrowserDebugTool.class.getName(), t); } } diff --git a/jetty-websocket/websocket-javax-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserSocket.java b/jetty-websocket/websocket-javax-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserSocket.java index a083a733273..4cbe0f0e343 100644 --- a/jetty-websocket/websocket-javax-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserSocket.java +++ b/jetty-websocket/websocket-javax-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserSocket.java @@ -33,8 +33,8 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint(value = "/", subprotocols = {"tool"}, configurator = JsrBrowserConfigurator.class) public class JsrBrowserSocket @@ -74,7 +74,7 @@ public class JsrBrowserSocket } } - private static final Logger LOG = Log.getLogger(JsrBrowserSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(JsrBrowserSocket.class); private Session session; private Async remote; private String userAgent; diff --git a/jetty-websocket/websocket-javax-server/src/test/java/org/eclipse/jetty/websocket/javax/server/examples/WebSocketServerExamplesTest.java b/jetty-websocket/websocket-javax-server/src/test/java/org/eclipse/jetty/websocket/javax/server/examples/WebSocketServerExamplesTest.java index 15d177e121c..22c96ca9772 100644 --- a/jetty-websocket/websocket-javax-server/src/test/java/org/eclipse/jetty/websocket/javax/server/examples/WebSocketServerExamplesTest.java +++ b/jetty-websocket/websocket-javax-server/src/test/java/org/eclipse/jetty/websocket/javax/server/examples/WebSocketServerExamplesTest.java @@ -41,21 +41,21 @@ import org.eclipse.jetty.security.authentication.BasicAuthenticator; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.util.security.Credential; import org.eclipse.jetty.websocket.javax.server.config.JavaxWebSocketServletContainerInitializer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; public class WebSocketServerExamplesTest { - private static final Logger LOG = Log.getLogger(WebSocketServerExamplesTest.class); + private static final Logger LOG = LoggerFactory.getLogger(WebSocketServerExamplesTest.class); @ClientEndpoint public static class ClientSocket @@ -86,7 +86,7 @@ public class WebSocketServerExamplesTest @OnError public void onError(Throwable cause) { - LOG.debug(cause); + LOG.debug("ClientSocket error", cause); } } diff --git a/jetty-websocket/websocket-javax-tests/pom.xml b/jetty-websocket/websocket-javax-tests/pom.xml index f7f26a83c42..9fc1fac0bdd 100644 --- a/jetty-websocket/websocket-javax-tests/pom.xml +++ b/jetty-websocket/websocket-javax-tests/pom.xml @@ -34,6 +34,11 @@ org.eclipse.jetty.toolchain jetty-javax-websocket-api
+ + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/EventSocket.java b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/EventSocket.java index f65fb4f6944..a69db90ba45 100644 --- a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/EventSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/EventSocket.java @@ -33,14 +33,14 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.util.BlockingArrayQueue; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/") @ClientEndpoint() public class EventSocket { - private static final Logger LOG = Log.getLogger(EventSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(EventSocket.class); public Session session; public EndpointConfig endpointConfig; diff --git a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/Fuzzer.java b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/Fuzzer.java index e2e7366613f..d6a2056d075 100644 --- a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/Fuzzer.java +++ b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/Fuzzer.java @@ -25,11 +25,11 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; import org.eclipse.jetty.toolchain.test.ByteBufferAssert; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -120,7 +120,7 @@ public interface Fuzzer extends AutoCloseable public Adapter() { - logger = Log.getLogger(this.getClass()); + logger = LoggerFactory.getLogger(this.getClass()); } public void expectMessage(BlockingQueue framesQueue, byte expectedDataOp, ByteBuffer expectedMessage) throws InterruptedException diff --git a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/LocalServer.java b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/LocalServer.java index 89e8ef04481..01170fd2a8b 100644 --- a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/LocalServer.java +++ b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/LocalServer.java @@ -43,8 +43,6 @@ import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.websocket.core.internal.Parser; @@ -57,6 +55,8 @@ import org.eclipse.jetty.websocket.servlet.FrameHandlerFactory; import org.eclipse.jetty.websocket.servlet.WebSocketCreator; import org.eclipse.jetty.websocket.servlet.WebSocketServlet; import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class LocalServer extends ContainerLifeCycle implements LocalFuzzer.Provider { @@ -70,7 +70,7 @@ public class LocalServer extends ContainerLifeCycle implements LocalFuzzer.Provi } } - private static final Logger LOG = Log.getLogger(LocalServer.class); + private static final Logger LOG = LoggerFactory.getLogger(LocalServer.class); private final ByteBufferPool bufferPool = new MappedByteBufferPool(); private Server server; private ServerConnector connector; diff --git a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSEndpointTracker.java b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSEndpointTracker.java index 72210ab2e3a..c0825c90383 100644 --- a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSEndpointTracker.java +++ b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSEndpointTracker.java @@ -29,9 +29,9 @@ import javax.websocket.Endpoint; import javax.websocket.EndpointConfig; import javax.websocket.Session; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.hamcrest.Matcher; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -61,7 +61,7 @@ public abstract class WSEndpointTracker extends Endpoint public WSEndpointTracker(String id) { - logger = Log.getLogger(this.getClass().getName() + "." + id); + logger = LoggerFactory.getLogger(this.getClass().getName() + "." + id); logger.debug("init"); } diff --git a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSEventTracker.java b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSEventTracker.java index 3f14ad77445..4f80e889d64 100644 --- a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSEventTracker.java +++ b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSEventTracker.java @@ -31,9 +31,9 @@ import javax.websocket.OnError; import javax.websocket.OnOpen; import javax.websocket.Session; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.hamcrest.Matcher; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -90,7 +90,7 @@ public abstract class WSEventTracker public WSEventTracker(String id) { - logger = Log.getLogger(this.getClass().getName() + "." + id); + logger = LoggerFactory.getLogger(this.getClass().getName() + "." + id); logger.debug("init"); } diff --git a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSServer.java b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSServer.java index 0ddcbca31a4..92a9fa0913b 100644 --- a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSServer.java +++ b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSServer.java @@ -32,11 +32,11 @@ import org.eclipse.jetty.toolchain.test.IO; import org.eclipse.jetty.toolchain.test.JAR; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.PathResource; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.websocket.javax.server.config.JavaxWebSocketConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -49,7 +49,7 @@ import static org.hamcrest.Matchers.notNullValue; */ public class WSServer extends LocalServer implements LocalFuzzer.Provider { - private static final Logger LOG = Log.getLogger(WSServer.class); + private static final Logger LOG = LoggerFactory.getLogger(WSServer.class); private final Path contextDir; private final String contextPath; private ContextHandlerCollection contexts; diff --git a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/framehandlers/FrameEcho.java b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/framehandlers/FrameEcho.java index 9b6b932320e..313d5e540ed 100644 --- a/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/framehandlers/FrameEcho.java +++ b/jetty-websocket/websocket-javax-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/framehandlers/FrameEcho.java @@ -19,16 +19,16 @@ package org.eclipse.jetty.websocket.javax.tests.framehandlers; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.FrameHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class FrameEcho implements FrameHandler { - private static final Logger LOG = Log.getLogger(FrameEcho.class); + private static final Logger LOG = LoggerFactory.getLogger(FrameEcho.class); private CoreSession coreSession; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/autobahn/JavaxAutobahnClient.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/autobahn/JavaxAutobahnClient.java index 278eb591863..8ce8ecc630f 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/autobahn/JavaxAutobahnClient.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/autobahn/JavaxAutobahnClient.java @@ -25,10 +25,10 @@ import javax.websocket.CloseReason; import org.eclipse.jetty.util.Jetty; import org.eclipse.jetty.util.UrlEncoded; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer; import org.eclipse.jetty.websocket.javax.tests.EventSocket; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -134,7 +134,7 @@ public class JavaxAutobahnClient } } - private static final Logger LOG = Log.getLogger(JavaxAutobahnClient.class); + private static final Logger LOG = LoggerFactory.getLogger(JavaxAutobahnClient.class); private URI baseWebsocketUri; private JavaxWebSocketClientContainer clientContainer; private String userAgent; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/autobahn/JavaxAutobahnSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/autobahn/JavaxAutobahnSocket.java index 1bce1ebd76e..5e5f239be36 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/autobahn/JavaxAutobahnSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/autobahn/JavaxAutobahnSocket.java @@ -29,14 +29,14 @@ import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ClientEndpoint @ServerEndpoint("/") public class JavaxAutobahnSocket { - private static final Logger LOG = Log.getLogger(JavaxAutobahnSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(JavaxAutobahnSocket.class); public Session session; public CountDownLatch closeLatch = new CountDownLatch(1); diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/MessageReceivingTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/MessageReceivingTest.java index 6da56e34586..5161bf2c05e 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/MessageReceivingTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/MessageReceivingTest.java @@ -39,8 +39,6 @@ import javax.websocket.WebSocketContainer; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.FrameHandler; @@ -55,6 +53,8 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.nio.charset.StandardCharsets.UTF_8; import static org.hamcrest.MatcherAssert.assertThat; @@ -66,7 +66,7 @@ import static org.hamcrest.Matchers.is; */ public class MessageReceivingTest { - private static final Logger LOG = Log.getLogger(MessageReceivingTest.class); + private static final Logger LOG = LoggerFactory.getLogger(MessageReceivingTest.class); private static CoreServer server; private WebSocketContainer container; @@ -305,7 +305,7 @@ public class MessageReceivingTest @Override public void onError(Throwable cause, Callback callback) { - LOG.warn(cause); + LOG.warn("SendPartialBinaryFrameHandler Error", cause); callback.succeeded(); } } @@ -337,7 +337,7 @@ public class MessageReceivingTest @Override public void onError(Throwable cause, Callback callback) { - LOG.warn(cause); + LOG.warn("EchoWholeMessageFrameHandler Error", cause); callback.succeeded(); } } @@ -414,7 +414,7 @@ public class MessageReceivingTest @Override public void onError(Session session, Throwable thr) { - LOG.warn(thr); + LOG.warn("TestEndpoint Error", thr); } } diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/QuotesDecoder.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/QuotesDecoder.java index 022e192e5cc..3504bf418ce 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/QuotesDecoder.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/QuotesDecoder.java @@ -25,12 +25,12 @@ import javax.websocket.DecodeException; import javax.websocket.Decoder; import javax.websocket.EndpointConfig; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class QuotesDecoder implements Decoder.TextStream { - private static final Logger LOG = Log.getLogger(QuotesDecoder.class); + private static final Logger LOG = LoggerFactory.getLogger(QuotesDecoder.class); @Override public Quotes decode(Reader reader) throws DecodeException, IOException diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/quotes/QuotesDecoder.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/quotes/QuotesDecoder.java index 36748ea0736..d500ee004fd 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/quotes/QuotesDecoder.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/quotes/QuotesDecoder.java @@ -25,12 +25,12 @@ import javax.websocket.DecodeException; import javax.websocket.Decoder; import javax.websocket.EndpointConfig; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class QuotesDecoder implements Decoder.TextStream { - private static final Logger LOG = Log.getLogger(QuotesDecoder.class); + private static final Logger LOG = LoggerFactory.getLogger(QuotesDecoder.class); @SuppressWarnings("RedundantThrows") @Override diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/quotes/QuotesDecoderTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/quotes/QuotesDecoderTest.java index 3df1a07ec6e..9b36099fddc 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/quotes/QuotesDecoderTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/quotes/QuotesDecoderTest.java @@ -31,14 +31,14 @@ import javax.websocket.Session; import javax.websocket.WebSocketContainer; import javax.websocket.server.ServerEndpoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.javax.tests.LocalServer; import org.eclipse.jetty.websocket.javax.tests.WSEventTracker; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -88,7 +88,7 @@ public class QuotesDecoderTest } } - private static final Logger LOG = Log.getLogger(QuotesDecoderTest.class); + private static final Logger LOG = LoggerFactory.getLogger(QuotesDecoderTest.class); private LocalServer server; private WebSocketContainer client; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/BinaryStreamTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/BinaryStreamTest.java index 25361f40d45..e63c75994f2 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/BinaryStreamTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/BinaryStreamTest.java @@ -31,8 +31,6 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import javax.websocket.server.ServerEndpointConfig; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; @@ -42,6 +40,8 @@ import org.eclipse.jetty.websocket.javax.tests.LocalServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class BinaryStreamTest { @@ -128,7 +128,7 @@ public class BinaryStreamTest @ServerEndpoint(PATH) public static class ServerBinaryStreamer { - private static final Logger LOG = Log.getLogger(ServerBinaryStreamer.class); + private static final Logger LOG = LoggerFactory.getLogger(ServerBinaryStreamer.class); @OnMessage public void echo(Session session, InputStream input) throws IOException diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/ConfiguratorTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/ConfiguratorTest.java index 884a4b21f96..573ccd47b3c 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/ConfiguratorTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/ConfiguratorTest.java @@ -51,8 +51,6 @@ import javax.websocket.server.ServerEndpointConfig; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; @@ -68,13 +66,15 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; public class ConfiguratorTest { - private static final Logger LOG = Log.getLogger(ConfiguratorTest.class); + private static final Logger LOG = LoggerFactory.getLogger(ConfiguratorTest.class); public static class EmptyConfigurator extends ServerEndpointConfig.Configurator { diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/EndpointViaConfigTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/EndpointViaConfigTest.java index 0d0b712eade..57d9f839f37 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/EndpointViaConfigTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/EndpointViaConfigTest.java @@ -27,8 +27,6 @@ import com.acme.websocket.BasicEchoEndpointConfigContextListener; import org.eclipse.jetty.toolchain.test.jupiter.WorkDir; import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; @@ -38,6 +36,8 @@ import org.eclipse.jetty.websocket.javax.tests.WSServer; import org.eclipse.jetty.websocket.javax.tests.framehandlers.FrameHandlerTracker; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -49,7 +49,7 @@ import static org.hamcrest.Matchers.is; @ExtendWith(WorkDirExtension.class) public class EndpointViaConfigTest { - private static final Logger LOG = Log.getLogger(EndpointViaConfigTest.class); + private static final Logger LOG = LoggerFactory.getLogger(EndpointViaConfigTest.class); public WorkDir testdir; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/InputStreamEchoTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/InputStreamEchoTest.java index 14effe53593..d7cf252ea8c 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/InputStreamEchoTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/InputStreamEchoTest.java @@ -28,8 +28,6 @@ import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; @@ -38,13 +36,15 @@ import org.eclipse.jetty.websocket.javax.tests.LocalServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Test various {@link javax.websocket.Decoder.BinaryStream Decoder.BinaryStream} echo behavior of Java InputStreams */ public class InputStreamEchoTest { - private static final Logger LOG = Log.getLogger(InputStreamEchoTest.class); + private static final Logger LOG = LoggerFactory.getLogger(InputStreamEchoTest.class); public static class BaseSocket { diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PartialEchoTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PartialEchoTest.java index 1cc20fbde05..f2da4b4a1ec 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PartialEchoTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PartialEchoTest.java @@ -27,8 +27,6 @@ import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; @@ -37,6 +35,8 @@ import org.eclipse.jetty.websocket.javax.tests.LocalServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Sends raw TEXT or BINARY messages to server. @@ -46,7 +46,7 @@ import org.junit.jupiter.api.Test; */ public class PartialEchoTest { - private static final Logger LOG = Log.getLogger(PartialEchoTest.class); + private static final Logger LOG = LoggerFactory.getLogger(PartialEchoTest.class); public static class BaseSocket { diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PongSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PongSocket.java index 63231b8492d..ce1d2d82d5b 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PongSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PongSocket.java @@ -27,13 +27,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint(value = "/pong-socket", configurator = PongContextListener.Config.class) public class PongSocket { - private static final Logger LOG = Log.getLogger(PongSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(PongSocket.class); private String path = "?"; private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PrimitivesBinaryEchoTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PrimitivesBinaryEchoTest.java index ea89adc46f4..a1bef5dec69 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PrimitivesBinaryEchoTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PrimitivesBinaryEchoTest.java @@ -28,8 +28,6 @@ import javax.websocket.OnMessage; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.Hex; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; @@ -40,13 +38,15 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Test various {@link javax.websocket.Decoder.Binary Decoder.Binary} / {@link javax.websocket.Encoder.Binary Encoder.Binary} echo behavior of Java Primitives */ public class PrimitivesBinaryEchoTest { - private static final Logger LOG = Log.getLogger(PrimitivesBinaryEchoTest.class); + private static final Logger LOG = LoggerFactory.getLogger(PrimitivesBinaryEchoTest.class); public static class BaseSocket { diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PrimitivesTextEchoTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PrimitivesTextEchoTest.java index b62f4406b26..da646af8a58 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PrimitivesTextEchoTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PrimitivesTextEchoTest.java @@ -27,8 +27,6 @@ import javax.websocket.OnMessage; import javax.websocket.server.ServerContainer; import javax.websocket.server.ServerEndpoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; @@ -39,13 +37,15 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Test various {@link javax.websocket.Decoder.Text Decoder.Text} / {@link javax.websocket.Encoder.Text Encoder.Text} echo behavior of Java Primitives */ public class PrimitivesTextEchoTest { - private static final Logger LOG = Log.getLogger(PrimitivesTextEchoTest.class); + private static final Logger LOG = LoggerFactory.getLogger(PrimitivesTextEchoTest.class); public static class BaseSocket { diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/ReaderEchoTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/ReaderEchoTest.java index 9461c0198d7..794b2470999 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/ReaderEchoTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/ReaderEchoTest.java @@ -28,8 +28,6 @@ import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; @@ -38,13 +36,15 @@ import org.eclipse.jetty.websocket.javax.tests.LocalServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Test various {@link javax.websocket.Decoder.TextStream Decoder.TextStream} and {@link javax.websocket.Encoder.TextStream Encoder.TextStream} echo behavior of Java Readers */ public class ReaderEchoTest { - private static final Logger LOG = Log.getLogger(ReaderEchoTest.class); + private static final Logger LOG = LoggerFactory.getLogger(ReaderEchoTest.class); public static class BaseSocket { diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/StreamTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/StreamTest.java index 9af2bb1e614..ce70a7f39d9 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/StreamTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/StreamTest.java @@ -51,14 +51,14 @@ import javax.websocket.server.ServerEndpointConfig; import org.eclipse.jetty.toolchain.test.FS; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainerProvider; import org.eclipse.jetty.websocket.javax.tests.LocalServer; import org.eclipse.jetty.websocket.javax.tests.Sha1Sum; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalToIgnoringCase; @@ -67,7 +67,7 @@ import static org.junit.jupiter.api.Assertions.assertTimeout; public class StreamTest { - private static final Logger LOG = Log.getLogger(StreamTest.class); + private static final Logger LOG = LoggerFactory.getLogger(StreamTest.class); private static File outputDir; private static LocalServer server; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/TextStreamTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/TextStreamTest.java index e420db47bbc..046608a90f2 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/TextStreamTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/TextStreamTest.java @@ -44,8 +44,6 @@ import javax.websocket.server.ServerEndpointConfig; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; @@ -59,6 +57,8 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -67,7 +67,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class TextStreamTest { - private static final Logger LOG = Log.getLogger(TextStreamTest.class); + private static final Logger LOG = LoggerFactory.getLogger(TextStreamTest.class); private static final BlockingArrayQueue serverEndpoints = new BlockingArrayQueue<>(); private final ClientEndpointConfig clientConfig = ClientEndpointConfig.Builder.create().build(); diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/UriTemplateParameterTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/UriTemplateParameterTest.java index 21fdae4b7de..2accaf59ce2 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/UriTemplateParameterTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/UriTemplateParameterTest.java @@ -26,8 +26,6 @@ import javax.websocket.OnMessage; import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; @@ -36,10 +34,12 @@ import org.eclipse.jetty.websocket.javax.tests.LocalServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UriTemplateParameterTest { - private static final Logger LOG = Log.getLogger(UriTemplateParameterTest.class); + private static final Logger LOG = LoggerFactory.getLogger(UriTemplateParameterTest.class); @ServerEndpoint("/echo/params/{a}/{b}") public static class IntParamTextSocket diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/ByteBufferSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/ByteBufferSocket.java index 03c129ec7db..29f0b43fe49 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/ByteBufferSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/ByteBufferSocket.java @@ -27,13 +27,13 @@ import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/binary/bytebuffer") public class ByteBufferSocket { - private static final Logger LOG = Log.getLogger(ByteBufferSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(ByteBufferSocket.class); @OnMessage public String onByteBuffer(ByteBuffer bbuf) diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/DateTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/DateTextSocket.java index adcf19f2b69..62f885d837d 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/DateTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/DateTextSocket.java @@ -27,15 +27,15 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.javax.tests.coders.DateDecoder; import org.eclipse.jetty.websocket.javax.tests.coders.DateEncoder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint(value = "/echo/beans/date", decoders = {DateDecoder.class}, encoders = {DateEncoder.class}) public class DateTextSocket { - private static final Logger LOG = Log.getLogger(DateTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(DateTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/binary/ByteBufferSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/binary/ByteBufferSocket.java index 0fd4a832891..95001d54f3c 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/binary/ByteBufferSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/binary/ByteBufferSocket.java @@ -27,13 +27,13 @@ import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/binary/bytebuffer") public class ByteBufferSocket { - private static final Logger LOG = Log.getLogger(ByteBufferSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(ByteBufferSocket.class); @OnMessage public String onByteBuffer(ByteBuffer bbuf) diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/partial/PartialTextSessionSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/partial/PartialTextSessionSocket.java index db2264a24d0..94e6748af76 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/partial/PartialTextSessionSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/partial/PartialTextSessionSocket.java @@ -25,13 +25,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/partial/textsession") public class PartialTextSessionSocket { - private static final Logger LOG = Log.getLogger(PartialTextSessionSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(PartialTextSessionSocket.class); private StringBuilder buf = new StringBuilder(); @OnMessage diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/partial/PartialTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/partial/PartialTextSocket.java index 6428e446f03..72b64f102ba 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/partial/PartialTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/partial/PartialTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/partial/text") public class PartialTextSocket { - private static final Logger LOG = Log.getLogger(PartialTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(PartialTextSocket.class); private Session session; private StringBuilder buf = new StringBuilder(); diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanObjectTextParamSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanObjectTextParamSocket.java index 86013994171..56f572f0aac 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanObjectTextParamSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanObjectTextParamSocket.java @@ -27,13 +27,13 @@ import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/booleanobject/params/{a}") public class BooleanObjectTextParamSocket { - private static final Logger LOG = Log.getLogger(BooleanObjectTextParamSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(BooleanObjectTextParamSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanObjectTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanObjectTextSocket.java index 9925aa9d601..a7f0ffd1fdf 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanObjectTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanObjectTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/booleanobject") public class BooleanObjectTextSocket { - private static final Logger LOG = Log.getLogger(BooleanObjectTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(BooleanObjectTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanTextParamSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanTextParamSocket.java index 13bde14f282..c45c25059e9 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanTextParamSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanTextParamSocket.java @@ -27,13 +27,13 @@ import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/boolean/params/{a}") public class BooleanTextParamSocket { - private static final Logger LOG = Log.getLogger(BooleanTextParamSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(BooleanTextParamSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanTextSocket.java index 2970f0b8d6e..d73bafcdd78 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/BooleanTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/boolean") public class BooleanTextSocket { - private static final Logger LOG = Log.getLogger(BooleanTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(BooleanTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ByteObjectTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ByteObjectTextSocket.java index c282107f4a0..676a29d955b 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ByteObjectTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ByteObjectTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/byteobject") public class ByteObjectTextSocket { - private static final Logger LOG = Log.getLogger(ByteObjectTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(ByteObjectTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ByteTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ByteTextSocket.java index 15a21089d80..014fc4e55eb 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ByteTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ByteTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/byte") public class ByteTextSocket { - private static final Logger LOG = Log.getLogger(ByteTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(ByteTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/CharTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/CharTextSocket.java index 59cd1c655f1..471a5c7646d 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/CharTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/CharTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/char") public class CharTextSocket { - private static final Logger LOG = Log.getLogger(CharTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(CharTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/CharacterObjectTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/CharacterObjectTextSocket.java index 5cb41fc7537..635ca8736cb 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/CharacterObjectTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/CharacterObjectTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/characterobject") public class CharacterObjectTextSocket { - private static final Logger LOG = Log.getLogger(CharacterObjectTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(CharacterObjectTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/DoubleObjectTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/DoubleObjectTextSocket.java index 143d0201839..24d3471b5e6 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/DoubleObjectTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/DoubleObjectTextSocket.java @@ -27,13 +27,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/doubleobject") public class DoubleObjectTextSocket { - private static final Logger LOG = Log.getLogger(DoubleObjectTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(DoubleObjectTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/DoubleTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/DoubleTextSocket.java index 2ab63440a9a..2bb42b77d4b 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/DoubleTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/DoubleTextSocket.java @@ -27,13 +27,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/double") public class DoubleTextSocket { - private static final Logger LOG = Log.getLogger(DoubleTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(DoubleTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/FloatObjectTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/FloatObjectTextSocket.java index bde739ad139..700cf6cb1e5 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/FloatObjectTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/FloatObjectTextSocket.java @@ -27,13 +27,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/floatobject") public class FloatObjectTextSocket { - private static final Logger LOG = Log.getLogger(FloatObjectTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(FloatObjectTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/FloatTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/FloatTextSocket.java index 3cfc53de667..a862539626e 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/FloatTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/FloatTextSocket.java @@ -27,13 +27,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/float") public class FloatTextSocket { - private static final Logger LOG = Log.getLogger(FloatTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(FloatTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntParamTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntParamTextSocket.java index cf9d2e14e47..d82a0a2837f 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntParamTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntParamTextSocket.java @@ -27,13 +27,13 @@ import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/integer/params/{a}") public class IntParamTextSocket { - private static final Logger LOG = Log.getLogger(IntParamTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(IntParamTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntTextSocket.java index deb1d1c0ca6..8a0e05e712b 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/integer") public class IntTextSocket { - private static final Logger LOG = Log.getLogger(IntTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(IntTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntegerObjectParamTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntegerObjectParamTextSocket.java index 13a56e398b5..e8aaa7f271f 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntegerObjectParamTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntegerObjectParamTextSocket.java @@ -27,13 +27,13 @@ import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/integerobject/params/{a}") public class IntegerObjectParamTextSocket { - private static final Logger LOG = Log.getLogger(IntegerObjectParamTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(IntegerObjectParamTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntegerObjectTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntegerObjectTextSocket.java index 4cd7b50a3ac..df438c93cf3 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntegerObjectTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/IntegerObjectTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/integerobject") public class IntegerObjectTextSocket { - private static final Logger LOG = Log.getLogger(IntegerObjectTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(IntegerObjectTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/LongObjectTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/LongObjectTextSocket.java index 65b41d1f9ea..24c800e2d5a 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/LongObjectTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/LongObjectTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/longobject") public class LongObjectTextSocket { - private static final Logger LOG = Log.getLogger(LongObjectTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(LongObjectTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/LongTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/LongTextSocket.java index e12aeacf6ec..e8850a95af9 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/LongTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/LongTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/long") public class LongTextSocket { - private static final Logger LOG = Log.getLogger(LongTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(LongTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ShortObjectTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ShortObjectTextSocket.java index 5b601d01617..c9cabf12fd6 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ShortObjectTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ShortObjectTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/shortobject") public class ShortObjectTextSocket { - private static final Logger LOG = Log.getLogger(ShortObjectTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(ShortObjectTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ShortTextSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ShortTextSocket.java index b437f52bd2d..8a6974b52e3 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ShortTextSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/primitives/ShortTextSocket.java @@ -26,13 +26,13 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/primitives/short") public class ShortTextSocket { - private static final Logger LOG = Log.getLogger(ShortTextSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(ShortTextSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/InputStreamSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/InputStreamSocket.java index edcd062a26a..361f44c3bc7 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/InputStreamSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/InputStreamSocket.java @@ -28,13 +28,13 @@ import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/streaming/inputstream") public class InputStreamSocket { - private static final Logger LOG = Log.getLogger(InputStreamSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(InputStreamSocket.class); @OnMessage public String onInputStream(InputStream stream) throws IOException diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/ReaderParamSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/ReaderParamSocket.java index 37f0cd2e066..113a51a1a9e 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/ReaderParamSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/ReaderParamSocket.java @@ -29,13 +29,13 @@ import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/streaming/readerparam/{param}") public class ReaderParamSocket { - private static final Logger LOG = Log.getLogger(ReaderParamSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(ReaderParamSocket.class); private Session session; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/ReaderSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/ReaderSocket.java index 82c9b16e05c..538ff988599 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/ReaderSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/ReaderSocket.java @@ -27,13 +27,13 @@ import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/streaming/reader") public class ReaderSocket { - private static final Logger LOG = Log.getLogger(ReaderSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(ReaderSocket.class); @OnMessage public String onReader(Reader reader) throws IOException diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/StringReturnReaderParamSocket.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/StringReturnReaderParamSocket.java index 1b0c0ef9e51..3e5176f92cf 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/StringReturnReaderParamSocket.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/streaming/StringReturnReaderParamSocket.java @@ -28,13 +28,13 @@ import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.toolchain.test.StackUtils; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/echo/streaming/readerparam2/{param}") public class StringReturnReaderParamSocket { - private static final Logger LOG = Log.getLogger(StringReturnReaderParamSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(StringReturnReaderParamSocket.class); @OnMessage public String onReader(Reader reader, @PathParam("param") String param) throws IOException diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java index 80cccfffb36..6183b8bf172 100644 --- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java +++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java @@ -38,8 +38,6 @@ import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.util.DecoratedObjectFactory; import org.eclipse.jetty.util.component.ContainerLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.ShutdownThread; import org.eclipse.jetty.websocket.api.Session; @@ -56,10 +54,12 @@ import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.core.client.UpgradeListener; import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class WebSocketClient extends ContainerLifeCycle implements WebSocketPolicy, WebSocketContainer { - private static final Logger LOG = Log.getLogger(WebSocketClient.class); + private static final Logger LOG = LoggerFactory.getLogger(WebSocketClient.class); private final WebSocketCoreClient coreClient; private final int id = ThreadLocalRandom.current().nextInt(); private final JettyWebSocketFrameHandlerFactory frameHandlerFactory; diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java index 9f8548f176e..c522ccbd160 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java @@ -26,8 +26,6 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.BatchMode; import org.eclipse.jetty.websocket.api.UpgradeRequest; import org.eclipse.jetty.websocket.api.UpgradeResponse; @@ -48,6 +46,8 @@ import org.eclipse.jetty.websocket.core.exception.WebSocketTimeoutException; import org.eclipse.jetty.websocket.util.InvalidSignatureException; import org.eclipse.jetty.websocket.util.InvokerUtils; import org.eclipse.jetty.websocket.util.messages.MessageSink; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JettyWebSocketFrameHandler implements FrameHandler { @@ -96,7 +96,7 @@ public class JettyWebSocketFrameHandler implements FrameHandler BatchMode batchMode, Configuration.Customizer customizer) { - this.log = Log.getLogger(endpointInstance.getClass()); + this.log = LoggerFactory.getLogger(endpointInstance.getClass()); this.container = container; this.endpointInstance = endpointInstance; diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketRemoteEndpoint.java b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketRemoteEndpoint.java index 4307c3600de..cd06286f3e3 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketRemoteEndpoint.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketRemoteEndpoint.java @@ -27,8 +27,6 @@ import java.util.concurrent.TimeUnit; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FutureCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.BatchMode; import org.eclipse.jetty.websocket.api.StatusCode; import org.eclipse.jetty.websocket.api.WriteCallback; @@ -36,12 +34,14 @@ import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; import org.eclipse.jetty.websocket.core.exception.ProtocolException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.nio.charset.StandardCharsets.UTF_8; public class JettyWebSocketRemoteEndpoint implements org.eclipse.jetty.websocket.api.RemoteEndpoint { - private static final Logger LOG = Log.getLogger(JettyWebSocketRemoteEndpoint.class); + private static final Logger LOG = LoggerFactory.getLogger(JettyWebSocketRemoteEndpoint.class); private final CoreSession coreSession; private byte messageType = -1; @@ -80,7 +80,7 @@ public class JettyWebSocketRemoteEndpoint implements org.eclipse.jetty.websocket } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java index 6cd0e5c9b8a..6f1c2a5988a 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java @@ -24,8 +24,6 @@ import java.time.Duration; import java.util.Objects; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.CloseStatus; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.SuspendToken; @@ -33,10 +31,12 @@ import org.eclipse.jetty.websocket.api.UpgradeRequest; import org.eclipse.jetty.websocket.api.UpgradeResponse; import org.eclipse.jetty.websocket.api.WebSocketBehavior; import org.eclipse.jetty.websocket.core.CoreSession; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class WebSocketSession implements Session, SuspendToken, Dumpable { - private static final Logger LOG = Log.getLogger(WebSocketSession.class); + private static final Logger LOG = LoggerFactory.getLogger(WebSocketSession.class); private final CoreSession coreSession; private final JettyWebSocketFrameHandler frameHandler; private final JettyWebSocketRemoteEndpoint remoteEndpoint; diff --git a/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/MessageOutputStreamTest.java b/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/MessageOutputStreamTest.java index 8645de9cc6b..f090d20a4de 100644 --- a/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/MessageOutputStreamTest.java +++ b/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/MessageOutputStreamTest.java @@ -23,12 +23,12 @@ import java.util.Arrays; import java.util.concurrent.TimeUnit; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.util.messages.MessageOutputStream; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.endsWith; @@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.is; public class MessageOutputStreamTest { - private static final Logger LOG = Log.getLogger(MessageOutputStreamTest.class); + private static final Logger LOG = LoggerFactory.getLogger(MessageOutputStreamTest.class); private static final int OUTPUT_BUFFER_SIZE = 4096; public TestableLeakTrackingBufferPool bufferPool = new TestableLeakTrackingBufferPool("Test"); diff --git a/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/OutgoingMessageCapture.java b/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/OutgoingMessageCapture.java index 11fb55188c7..7976f7d66eb 100644 --- a/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/OutgoingMessageCapture.java +++ b/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/OutgoingMessageCapture.java @@ -27,8 +27,6 @@ import java.util.concurrent.LinkedBlockingDeque; import org.eclipse.jetty.toolchain.test.Hex; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; @@ -36,10 +34,12 @@ import org.eclipse.jetty.websocket.core.OpCode; import org.eclipse.jetty.websocket.util.messages.ByteBufferMessageSink; import org.eclipse.jetty.websocket.util.messages.MessageSink; import org.eclipse.jetty.websocket.util.messages.StringMessageSink; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class OutgoingMessageCapture extends CoreSession.Empty implements CoreSession { - private static final Logger LOG = Log.getLogger(OutgoingMessageCapture.class); + private static final Logger LOG = LoggerFactory.getLogger(OutgoingMessageCapture.class); public BlockingQueue textMessages = new LinkedBlockingDeque<>(); public BlockingQueue binaryMessages = new LinkedBlockingDeque<>(); diff --git a/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod b/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod index 6f6469bb54c..1f3f6189a64 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod +++ b/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod @@ -12,11 +12,13 @@ annotations [lib] lib/websocket/websocket-core-${jetty.version}.jar -lib/websocket/websocket-util-${jetty.version}.jar lib/websocket/websocket-servlet-${jetty.version}.jar -lib/websocket/websocket-jetty-*.jar +lib/websocket/websocket-util-${jetty.version}.jar +lib/websocket/websocket-jetty-api-${jetty.version}.jar +lib/websocket/websocket-jetty-common-${jetty.version}.jar +lib/websocket/websocket-jetty-server-${jetty.version}.jar [jpms] # The implementation needs to access method handles in # classes that are in the web application classloader. -add-reads: org.eclipse.jetty.websocket.common=ALL-UNNAMED +add-reads: org.eclipse.jetty.websocket.jetty.common=ALL-UNNAMED diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java index c9da57fff82..df0b7582184 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java +++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java @@ -30,8 +30,6 @@ import org.eclipse.jetty.http.pathmap.PathSpec; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.WebSocketBehavior; import org.eclipse.jetty.websocket.api.WebSocketPolicy; @@ -45,6 +43,8 @@ import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerI import org.eclipse.jetty.websocket.server.internal.JettyServerFrameHandlerFactory; import org.eclipse.jetty.websocket.servlet.FrameHandlerFactory; import org.eclipse.jetty.websocket.servlet.WebSocketMapping; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JettyWebSocketServerContainer extends ContainerLifeCycle implements WebSocketContainer, WebSocketPolicy, LifeCycle.Listener { @@ -82,7 +82,7 @@ public class JettyWebSocketServerContainer extends ContainerLifeCycle implements return container; } - private static final Logger LOG = Log.getLogger(JettyWebSocketServerContainer.class); + private static final Logger LOG = LoggerFactory.getLogger(JettyWebSocketServerContainer.class); private final WebSocketMapping webSocketMapping; private final WebSocketComponents webSocketComponents; diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java index 152f0438744..c0a54dddef8 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java +++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketConfiguration.java @@ -21,8 +21,6 @@ package org.eclipse.jetty.websocket.server.config; import java.util.ServiceLoader; import org.eclipse.jetty.util.Loader; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.AbstractConfiguration; import org.eclipse.jetty.webapp.Configuration; import org.eclipse.jetty.webapp.FragmentConfiguration; @@ -30,6 +28,8 @@ import org.eclipse.jetty.webapp.MetaInfConfiguration; import org.eclipse.jetty.webapp.WebAppConfiguration; import org.eclipse.jetty.webapp.WebInfConfiguration; import org.eclipse.jetty.webapp.WebXmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** *

Websocket Configuration

@@ -43,7 +43,7 @@ import org.eclipse.jetty.webapp.WebXmlConfiguration; */ public class JettyWebSocketConfiguration extends AbstractConfiguration { - private static final Logger LOG = Log.getLogger(JettyWebSocketConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(JettyWebSocketConfiguration.class); public JettyWebSocketConfiguration() { @@ -78,7 +78,7 @@ public class JettyWebSocketConfiguration extends AbstractConfiguration } catch (Throwable e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); return false; } } diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketServletContainerInitializer.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketServletContainerInitializer.java index 3f4023d656a..82c3f79383a 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketServletContainerInitializer.java +++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketServletContainerInitializer.java @@ -25,19 +25,19 @@ import javax.servlet.ServletContext; import org.eclipse.jetty.servlet.FilterHolder; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.listener.ContainerInitializer; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer; import org.eclipse.jetty.websocket.servlet.WebSocketMapping; import org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * ServletContext configuration for Jetty Native WebSockets API. */ public class JettyWebSocketServletContainerInitializer implements ServletContainerInitializer { - private static final Logger LOG = Log.getLogger(JettyWebSocketServletContainerInitializer.class); + private static final Logger LOG = LoggerFactory.getLogger(JettyWebSocketServletContainerInitializer.class); public interface Configurator { diff --git a/jetty-websocket/websocket-jetty-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserDebugTool.java b/jetty-websocket/websocket-jetty-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserDebugTool.java index 1939fa3368f..88ea1275982 100644 --- a/jetty-websocket/websocket-jetty-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserDebugTool.java +++ b/jetty-websocket/websocket-jetty-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserDebugTool.java @@ -35,8 +35,6 @@ import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.PathResource; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.websocket.api.extensions.ExtensionConfig; @@ -46,6 +44,8 @@ import org.eclipse.jetty.websocket.server.JettyWebSocketCreator; import org.eclipse.jetty.websocket.server.JettyWebSocketServlet; import org.eclipse.jetty.websocket.server.JettyWebSocketServletFactory; import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Tool to help debug websocket circumstances reported around browsers. @@ -55,7 +55,7 @@ import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerI */ public class BrowserDebugTool { - private static final Logger LOG = Log.getLogger(BrowserDebugTool.class); + private static final Logger LOG = LoggerFactory.getLogger(BrowserDebugTool.class); public static void main(String[] args) { @@ -78,7 +78,7 @@ public class BrowserDebugTool } catch (Throwable t) { - LOG.warn(t); + LOG.warn("Unable to start {}", BrowserDebugTool.class.getName(), t); } } diff --git a/jetty-websocket/websocket-jetty-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java b/jetty-websocket/websocket-jetty-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java index 059a05dadda..14264e68a22 100644 --- a/jetty-websocket/websocket-jetty-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java +++ b/jetty-websocket/websocket-jetty-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java @@ -33,8 +33,6 @@ import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; @@ -42,6 +40,8 @@ import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage; import org.eclipse.jetty.websocket.api.annotations.WebSocket; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @WebSocket public class BrowserSocket @@ -81,7 +81,7 @@ public class BrowserSocket } } - private static final Logger LOG = Log.getLogger(BrowserSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(BrowserSocket.class); private Session session; private final String userAgent; @@ -198,7 +198,7 @@ public class BrowserSocket } catch (IOException e) { - LOG.warn(e); + LOG.warn("Unable to send ping", e); } break; } diff --git a/jetty-websocket/websocket-jetty-tests/pom.xml b/jetty-websocket/websocket-jetty-tests/pom.xml index 9976ed6809d..6c935a89e7a 100644 --- a/jetty-websocket/websocket-jetty-tests/pom.xml +++ b/jetty-websocket/websocket-jetty-tests/pom.xml @@ -63,6 +63,13 @@ ${project.version} test
+ + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/CloseTrackingEndpoint.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/CloseTrackingEndpoint.java index a3e4166cad8..1a7a2f306e6 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/CloseTrackingEndpoint.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/CloseTrackingEndpoint.java @@ -26,14 +26,14 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import org.eclipse.jetty.io.EndPoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.WebSocketAdapter; import org.eclipse.jetty.websocket.common.WebSocketSession; import org.eclipse.jetty.websocket.core.internal.WebSocketConnection; import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession; import org.hamcrest.Matcher; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.instanceOf; @@ -42,7 +42,7 @@ import static org.hamcrest.Matchers.nullValue; public class CloseTrackingEndpoint extends WebSocketAdapter { - private static final Logger LOG = Log.getLogger(CloseTrackingEndpoint.class); + private static final Logger LOG = LoggerFactory.getLogger(CloseTrackingEndpoint.class); public int closeCode = -1; public String closeReason = null; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/EventSocket.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/EventSocket.java index 441e132bf53..69d3fcb9e71 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/EventSocket.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/EventSocket.java @@ -24,8 +24,6 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.CountDownLatch; import org.eclipse.jetty.util.BlockingArrayQueue; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.StatusCode; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; @@ -33,11 +31,13 @@ import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage; import org.eclipse.jetty.websocket.api.annotations.WebSocket; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @WebSocket public class EventSocket { - private static final Logger LOG = Log.getLogger(EventSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(EventSocket.class); public Session session; private String behavior; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/autobahn/JettyAutobahnClient.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/autobahn/JettyAutobahnClient.java index f1171adc9d8..662bbaa7bf5 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/autobahn/JettyAutobahnClient.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/autobahn/JettyAutobahnClient.java @@ -28,13 +28,13 @@ import java.util.concurrent.TimeoutException; import org.eclipse.jetty.util.Jetty; import org.eclipse.jetty.util.UrlEncoded; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.StatusCode; import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.jetty.websocket.tests.EchoSocket; import org.eclipse.jetty.websocket.tests.EventSocket; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -140,7 +140,7 @@ public class JettyAutobahnClient } } - private static final Logger LOG = Log.getLogger(JettyAutobahnClient.class); + private static final Logger LOG = LoggerFactory.getLogger(JettyAutobahnClient.class); private URI baseWebsocketUri; private WebSocketClient client; private String userAgent; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/BadNetworkTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/BadNetworkTest.java index c788edb4334..4efcc4ab8ca 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/BadNetworkTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/BadNetworkTest.java @@ -30,8 +30,6 @@ import org.eclipse.jetty.server.handler.DefaultHandler; import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.StatusCode; import org.eclipse.jetty.websocket.api.WebSocketListener; @@ -44,6 +42,8 @@ import org.eclipse.jetty.websocket.tests.CloseTrackingEndpoint; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; @@ -150,7 +150,7 @@ public class BadNetworkTest public static class ServerEndpoint implements WebSocketListener { - private static final Logger LOG = Log.getLogger(ClientCloseTest.ServerEndpoint.class); + private static final Logger LOG = LoggerFactory.getLogger(ClientCloseTest.ServerEndpoint.class); private Session session; @Override @@ -175,7 +175,7 @@ public class BadNetworkTest } catch (IOException e) { - LOG.warn(e); + LOG.warn("Failed to send string", e); } } @@ -195,7 +195,7 @@ public class BadNetworkTest { if (LOG.isDebugEnabled()) { - LOG.debug(cause); + LOG.debug("ServerEndpoint error", cause); } } } diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientCloseTest.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientCloseTest.java index 1d857ee5a2a..5d3534fc585 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientCloseTest.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientCloseTest.java @@ -36,8 +36,6 @@ import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.BlockingArrayQueue; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.Frame; import org.eclipse.jetty.websocket.api.MessageTooLargeException; import org.eclipse.jetty.websocket.api.Session; @@ -56,6 +54,8 @@ import org.eclipse.jetty.websocket.tests.CloseTrackingEndpoint; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static java.nio.charset.StandardCharsets.UTF_8; import static java.time.Duration.ofSeconds; @@ -425,7 +425,7 @@ public class ClientCloseTest public static class ServerEndpoint implements WebSocketFrameListener, WebSocketListener { - private static final Logger LOG = Log.getLogger(ServerEndpoint.class); + private static final Logger LOG = LoggerFactory.getLogger(ServerEndpoint.class); private Session session; CountDownLatch block = new CountDownLatch(1); @@ -461,7 +461,7 @@ public class ClientCloseTest } catch (Throwable t) { - LOG.debug(t); + LOG.debug("send text failure", t); throw new RuntimeException(t); } } @@ -514,7 +514,7 @@ public class ClientCloseTest } catch (Throwable ignore) { - LOG.ignore(ignore); + LOG.trace("IGNORED", ignore); } } else if (reason.startsWith("sleep|")) @@ -528,7 +528,7 @@ public class ClientCloseTest } catch (InterruptedException ignore) { - LOG.ignore(ignore); + LOG.trace("IGNORED", ignore); } } } diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientWriteThread.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientWriteThread.java index c7f30583475..1f15c7ebfeb 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientWriteThread.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientWriteThread.java @@ -21,16 +21,16 @@ package org.eclipse.jetty.websocket.tests.client; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.BatchMode; import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.tests.util.FutureWriteCallback; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ClientWriteThread extends Thread { - private static final Logger LOG = Log.getLogger(ClientWriteThread.class); + private static final Logger LOG = LoggerFactory.getLogger(ClientWriteThread.class); private final Session session; private int slowness = -1; private int messageCount = 100; @@ -63,7 +63,7 @@ public class ClientWriteThread extends Thread try { - LOG.debug("Writing {} messages to connection {}", messageCount); + LOG.debug("Writing {} messages to {}", messageCount, session); LOG.debug("Artificial Slowness {} ms", slowness); FutureWriteCallback lastMessage = null; RemoteEndpoint remote = session.getRemote(); @@ -87,7 +87,7 @@ public class ClientWriteThread extends Thread } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to write messages", e); } } diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/AbstractCloseEndpoint.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/AbstractCloseEndpoint.java index 65986dc4c31..4f3ffc2f469 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/AbstractCloseEndpoint.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/AbstractCloseEndpoint.java @@ -22,11 +22,11 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.WebSocketAdapter; import org.hamcrest.Matcher; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -43,7 +43,7 @@ public abstract class AbstractCloseEndpoint extends WebSocketAdapter public AbstractCloseEndpoint() { - this.log = Log.getLogger(this.getClass().getName()); + this.log = LoggerFactory.getLogger(this.getClass().getName()); } @Override diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/SlowServerEndpoint.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/SlowServerEndpoint.java index affc8e7a7ac..37d676bb02c 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/SlowServerEndpoint.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/SlowServerEndpoint.java @@ -23,16 +23,16 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage; import org.eclipse.jetty.websocket.api.annotations.WebSocket; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @WebSocket public class SlowServerEndpoint { - private static final Logger LOG = Log.getLogger(SlowServerEndpoint.class); + private static final Logger LOG = LoggerFactory.getLogger(SlowServerEndpoint.class); @OnWebSocketMessage public void onMessage(Session session, String msg) @@ -55,7 +55,7 @@ public class SlowServerEndpoint } catch (Throwable cause) { - LOG.warn(cause); + LOG.warn("failed to send text", cause); } } }); @@ -69,7 +69,7 @@ public class SlowServerEndpoint } catch (IOException ignore) { - LOG.ignore(ignore); + LOG.trace("IGNORED", ignore); } } } diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/util/FutureWriteCallback.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/util/FutureWriteCallback.java index 24467abd5bb..204c6a1bcab 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/util/FutureWriteCallback.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/util/FutureWriteCallback.java @@ -21,16 +21,16 @@ package org.eclipse.jetty.websocket.tests.util; import java.util.concurrent.Future; import org.eclipse.jetty.util.FutureCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.WriteCallback; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Allows events to a {@link WriteCallback} to drive a {@link Future} for the user. */ public class FutureWriteCallback extends FutureCallback implements WriteCallback { - private static final Logger LOG = Log.getLogger(FutureWriteCallback.class); + private static final Logger LOG = LoggerFactory.getLogger(FutureWriteCallback.class); @Override public void writeFailed(Throwable cause) diff --git a/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketMapping.java b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketMapping.java index cfe489215cc..30bf8098e2b 100644 --- a/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketMapping.java +++ b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketMapping.java @@ -34,8 +34,6 @@ import org.eclipse.jetty.http.pathmap.UriTemplatePathSpec; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.FrameHandler; @@ -44,6 +42,8 @@ import org.eclipse.jetty.websocket.core.exception.WebSocketException; import org.eclipse.jetty.websocket.core.server.Handshaker; import org.eclipse.jetty.websocket.core.server.Negotiation; import org.eclipse.jetty.websocket.core.server.WebSocketNegotiator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static javax.servlet.http.HttpServletResponse.SC_SERVICE_UNAVAILABLE; @@ -59,7 +59,7 @@ import static javax.servlet.http.HttpServletResponse.SC_SERVICE_UNAVAILABLE; */ public class WebSocketMapping implements Dumpable, LifeCycle.Listener { - private static final Logger LOG = Log.getLogger(WebSocketMapping.class); + private static final Logger LOG = LoggerFactory.getLogger(WebSocketMapping.class); public static WebSocketMapping getMapping(ServletContext servletContext, String mappingKey) { diff --git a/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServlet.java b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServlet.java index adfae0a629f..6a3e00a84bf 100644 --- a/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServlet.java +++ b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServlet.java @@ -29,11 +29,11 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.pathmap.PathSpec; import org.eclipse.jetty.server.handler.ContextHandler; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.core.WebSocketExtensionRegistry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Abstract Servlet used to bridge the Servlet API to the WebSocket API. @@ -88,7 +88,7 @@ import org.eclipse.jetty.websocket.core.WebSocketExtensionRegistry; @SuppressWarnings("serial") public abstract class WebSocketServlet extends HttpServlet { - private static final Logger LOG = Log.getLogger(WebSocketServlet.class); + private static final Logger LOG = LoggerFactory.getLogger(WebSocketServlet.class); private final CustomizedWebSocketServletFactory customizer = new CustomizedWebSocketServletFactory(); private WebSocketMapping mapping; diff --git a/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketUpgradeFilter.java b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketUpgradeFilter.java index 148449fed04..6829d6219a9 100644 --- a/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketUpgradeFilter.java +++ b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketUpgradeFilter.java @@ -38,10 +38,10 @@ import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.WebSocketComponents; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Inline Servlet Filter to capture WebSocket upgrade requests. @@ -73,7 +73,7 @@ import org.eclipse.jetty.websocket.core.WebSocketComponents; @ManagedObject("WebSocket Upgrade Filter") public class WebSocketUpgradeFilter implements Filter, Dumpable { - private static final Logger LOG = Log.getLogger(WebSocketUpgradeFilter.class); + private static final Logger LOG = LoggerFactory.getLogger(WebSocketUpgradeFilter.class); private static FilterHolder getFilter(ServletContext servletContext) { diff --git a/jetty-websocket/websocket-util/src/main/java/org/eclipse/jetty/websocket/util/messages/MessageInputStream.java b/jetty-websocket/websocket-util/src/main/java/org/eclipse/jetty/websocket/util/messages/MessageInputStream.java index 6b6528ee19e..54ed65b55bd 100644 --- a/jetty-websocket/websocket-util/src/main/java/org/eclipse/jetty/websocket/util/messages/MessageInputStream.java +++ b/jetty-websocket/websocket-util/src/main/java/org/eclipse/jetty/websocket/util/messages/MessageInputStream.java @@ -29,9 +29,9 @@ import java.util.concurrent.TimeUnit; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.Frame; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Support class for reading a WebSocket BINARY message via a InputStream. @@ -41,7 +41,7 @@ import org.eclipse.jetty.websocket.core.Frame; */ public class MessageInputStream extends InputStream implements MessageSink { - private static final Logger LOG = Log.getLogger(MessageInputStream.class); + private static final Logger LOG = LoggerFactory.getLogger(MessageInputStream.class); private static final Entry EOF = new Entry(BufferUtil.EMPTY_BUFFER, Callback.NOOP); private static final Entry CLOSED = new Entry(BufferUtil.EMPTY_BUFFER, Callback.NOOP); private final BlockingArrayQueue buffers = new BlockingArrayQueue<>(); diff --git a/jetty-websocket/websocket-util/src/main/java/org/eclipse/jetty/websocket/util/messages/MessageOutputStream.java b/jetty-websocket/websocket-util/src/main/java/org/eclipse/jetty/websocket/util/messages/MessageOutputStream.java index 8d60377d580..389fd20eaf5 100644 --- a/jetty-websocket/websocket-util/src/main/java/org/eclipse/jetty/websocket/util/messages/MessageOutputStream.java +++ b/jetty-websocket/websocket-util/src/main/java/org/eclipse/jetty/websocket/util/messages/MessageOutputStream.java @@ -26,18 +26,18 @@ import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FutureCallback; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Support for writing a single WebSocket BINARY message via a {@link OutputStream} */ public class MessageOutputStream extends OutputStream { - private static final Logger LOG = Log.getLogger(MessageOutputStream.class); + private static final Logger LOG = LoggerFactory.getLogger(MessageOutputStream.class); private final CoreSession coreSession; private final ByteBufferPool bufferPool; diff --git a/jetty-xml/pom.xml b/jetty-xml/pom.xml index be891ef3f1b..c835bc526cc 100644 --- a/jetty-xml/pom.xml +++ b/jetty-xml/pom.xml @@ -40,6 +40,12 @@ jetty-util ${project.version} + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java index 1445a23e7ea..5ce72c1281f 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java @@ -60,9 +60,9 @@ import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.annotation.Name; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.xml.sax.SAXException; /** @@ -82,7 +82,7 @@ import org.xml.sax.SAXException; */ public class XmlConfiguration { - private static final Logger LOG = Log.getLogger(XmlConfiguration.class); + private static final Logger LOG = LoggerFactory.getLogger(XmlConfiguration.class); private static final Class[] PRIMITIVES = { Boolean.TYPE, Character.TYPE, Byte.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE, Float.TYPE, Double.TYPE, Void.TYPE @@ -219,7 +219,7 @@ public class XmlConfiguration } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to get webapp file reference", e); } } @@ -578,7 +578,7 @@ public class XmlConfiguration } catch (IllegalArgumentException | IllegalAccessException | NoSuchMethodException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); me.add(e); } @@ -593,7 +593,7 @@ public class XmlConfiguration } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException | NoSuchMethodException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); me.add(e); } @@ -630,7 +630,7 @@ public class XmlConfiguration } catch (NoSuchFieldException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); me.add(e); } @@ -654,7 +654,7 @@ public class XmlConfiguration } catch (IllegalArgumentException | IllegalAccessException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); me.add(e); } @@ -672,7 +672,7 @@ public class XmlConfiguration } catch (IllegalAccessException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); me.add(e); } } @@ -704,7 +704,7 @@ public class XmlConfiguration } catch (NoSuchMethodException | IllegalAccessException | InstantiationException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); me.add(e); } } @@ -947,7 +947,7 @@ public class XmlConfiguration } catch (IllegalAccessException | IllegalArgumentException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } @@ -1007,7 +1007,7 @@ public class XmlConfiguration } catch (InstantiationException | IllegalAccessException | IllegalArgumentException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } throw new NoSuchMethodException(""); @@ -1861,7 +1861,7 @@ public class XmlConfiguration } catch (Error | Exception e) { - LOG.warn(e); + LOG.warn("Unable to execute XmlConfiguration", e); throw e; } } diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java index c492cb48f9b..9d30e84faf7 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java @@ -34,9 +34,9 @@ import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.eclipse.jetty.util.LazyList; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; import org.xml.sax.InputSource; @@ -54,7 +54,7 @@ import org.xml.sax.helpers.DefaultHandler; */ public class XmlParser { - private static final Logger LOG = Log.getLogger(XmlParser.class); + private static final Logger LOG = LoggerFactory.getLogger(XmlParser.class); private Map _redirectMap = new HashMap(); private SAXParser _parser; @@ -99,7 +99,7 @@ public class XmlParser if (validating) LOG.warn("Schema validation may not be supported: ", e); else - LOG.ignore(e); + LOG.trace("IGNORED", e); } _parser.getXMLReader().setFeature("http://xml.org/sax/features/validation", validating); @@ -117,7 +117,7 @@ public class XmlParser } catch (Exception e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("Unable to set validating on XML Parser", e); throw new Error(e.toString()); } } @@ -286,7 +286,7 @@ public class XmlParser } catch (IOException e) { - LOG.ignore(e); + LOG.trace("IGNORED", e); } } return null; @@ -425,7 +425,7 @@ public class XmlParser @Override public void warning(SAXParseException ex) { - LOG.debug(Log.EXCEPTION, ex); + LOG.debug("SAX Parse Issue", ex); LOG.warn("WARNING@" + getLocationString(ex) + " : " + ex.toString()); } @@ -435,16 +435,16 @@ public class XmlParser // Save error and continue to report other errors if (_error == null) _error = ex; - LOG.debug(Log.EXCEPTION, ex); - LOG.warn("ERROR@" + getLocationString(ex) + " : " + ex.toString()); + LOG.debug("SAX Parse Issue", ex); + LOG.error("ERROR@" + getLocationString(ex) + " : " + ex.toString()); } @Override public void fatalError(SAXParseException ex) throws SAXException { _error = ex; - LOG.debug(Log.EXCEPTION, ex); - LOG.warn("FATAL@" + getLocationString(ex) + " : " + ex.toString()); + LOG.debug("SAX Parse Issue", ex); + LOG.error("FATAL@" + getLocationString(ex) + " : " + ex.toString()); throw ex; } diff --git a/logos/jetty-avatar.svg b/logos/jetty-avatar.svg index f667369af46..3e7e3fd206d 100644 --- a/logos/jetty-avatar.svg +++ b/logos/jetty-avatar.svg @@ -1,44 +1,11 @@ - - - - - + + + + - - - - - + + + + - - - - + + + + - true - oss.snapshots OSS Snapshots @@ -1589,29 +1579,4 @@ scp://build.eclipse.org:/home/data/httpd/download.eclipse.org/jetty/${project.version}/ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/jetty-jmh/src/main/java/org/eclipse/jetty/util/thread/strategy/jmh/TestConnection.java b/tests/jetty-jmh/src/main/java/org/eclipse/jetty/util/thread/strategy/jmh/TestConnection.java index 047b4fe2e78..ed168ffb98f 100644 --- a/tests/jetty-jmh/src/main/java/org/eclipse/jetty/util/thread/strategy/jmh/TestConnection.java +++ b/tests/jetty-jmh/src/main/java/org/eclipse/jetty/util/thread/strategy/jmh/TestConnection.java @@ -25,13 +25,16 @@ import java.util.Queue; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentLinkedQueue; -import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.thread.ExecutionStrategy.Producer; import org.eclipse.jetty.util.thread.Invocable; import org.openjdk.jmh.infra.Blackhole; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestConnection implements Producer { + private static final Logger LOG = LoggerFactory.getLogger(TestConnection.class); + private final TestServer _server; private final String _sessionid; private final boolean _sleeping; @@ -125,7 +128,7 @@ public class TestConnection implements Producer } catch (InterruptedException e) { - Log.getLogger(TestConnection.class).ignore(e); + LOG.trace("IGNORED", e); } } else diff --git a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java index 6a20341f837..b1225195332 100644 --- a/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java +++ b/tests/test-distribution/src/test/java/org/eclipse/jetty/tests/distribution/DistributionTests.java @@ -385,8 +385,6 @@ public class DistributionTests extends AbstractDistributionTest Path logFile = distribution.getJettyBase().resolve("resources").resolve("jetty-logging.properties"); try (BufferedWriter writer = Files.newBufferedWriter(logFile, StandardCharsets.UTF_8, StandardOpenOption.CREATE)) { - writer.write("org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog"); - writer.newLine(); writer.write("org.eclipse.jetty.LEVEL=INFO"); } diff --git a/tests/test-http-client-transport/pom.xml b/tests/test-http-client-transport/pom.xml index 84d9d7de5b9..0df91f68a13 100644 --- a/tests/test-http-client-transport/pom.xml +++ b/tests/test-http-client-transport/pom.xml @@ -101,6 +101,12 @@ ${project.version} test + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java index 9d01af09eee..8524afc7ffc 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java @@ -58,20 +58,20 @@ import org.eclipse.jetty.unixsocket.server.UnixSocketConnector; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.LeakDetector; import org.eclipse.jetty.util.ProcessorUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.Scheduler; import org.hamcrest.Matchers; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ArgumentsSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; public class HttpClientLoadTest extends AbstractTest { - private final Logger logger = Log.getLogger(HttpClientLoadTest.class); + private final Logger logger = LoggerFactory.getLogger(HttpClientLoadTest.class); private final AtomicLong requestCount = new AtomicLong(); private final AtomicLong connectionLeaks = new AtomicLong(); diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientTest.java index a9d7279c1c9..35872c0da3c 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientTest.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientTest.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.InterruptedIOException; import java.util.List; -import java.util.Optional; import java.util.Random; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ProxyWithDynamicTransportTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ProxyWithDynamicTransportTest.java index de0a19f82b9..7dbd499b063 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ProxyWithDynamicTransportTest.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ProxyWithDynamicTransportTest.java @@ -78,8 +78,6 @@ import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.FuturePromise; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.hamcrest.Matchers; @@ -88,6 +86,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -95,7 +95,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class ProxyWithDynamicTransportTest { - private static final Logger LOG = Log.getLogger(ProxyWithDynamicTransportTest.class); + private static final Logger LOG = LoggerFactory.getLogger(ProxyWithDynamicTransportTest.class); private Server server; private ServerConnector serverConnector; diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/TransportScenario.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/TransportScenario.java index 14b06650825..da381546d1c 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/TransportScenario.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/TransportScenario.java @@ -62,18 +62,18 @@ import org.eclipse.jetty.unixsocket.server.UnixSocketConnector; import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.SocketAddressResolver; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.jupiter.api.Assumptions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.eclipse.jetty.http.client.Transport.UNIX_SOCKET; import static org.junit.jupiter.api.Assumptions.assumeTrue; public class TransportScenario { - private static final Logger LOG = Log.getLogger(TransportScenario.class); + private static final Logger LOG = LoggerFactory.getLogger(TransportScenario.class); protected final HttpConfiguration httpConfig = new HttpConfiguration(); protected final Transport transport; @@ -391,7 +391,7 @@ public class TransportScenario } catch (Exception x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } try @@ -400,7 +400,7 @@ public class TransportScenario } catch (Exception x) { - LOG.ignore(x); + LOG.trace("IGNORED", x); } if (sockFile != null) @@ -411,7 +411,7 @@ public class TransportScenario } catch (IOException e) { - LOG.warn(e); + LOG.warn("Unable to delete sockFile: {}", sockFile, e); } } } diff --git a/tests/test-integration/pom.xml b/tests/test-integration/pom.xml index e716552fb15..9537a2bb6ae 100644 --- a/tests/test-integration/pom.xml +++ b/tests/test-integration/pom.xml @@ -105,6 +105,12 @@ ${project.version} test + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/FailedSelectorTest.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/FailedSelectorTest.java index 685b940ec00..f31db9e212f 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/FailedSelectorTest.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/FailedSelectorTest.java @@ -55,13 +55,13 @@ import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.Scheduler; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; @@ -70,7 +70,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class FailedSelectorTest { - private static final Logger LOG = Log.getLogger(FailedSelectorTest.class); + private static final Logger LOG = LoggerFactory.getLogger(FailedSelectorTest.class); private HttpClient client; private Server server; private StacklessLogging stacklessManagedSelector; @@ -306,7 +306,7 @@ public class FailedSelectorTest private static class RestartSelectorTask implements Consumer { - private static final Logger LOG = Log.getLogger(RestartSelectorTask.class); + private static final Logger LOG = LoggerFactory.getLogger(RestartSelectorTask.class); private final CountDownLatch latch; public RestartSelectorTask(CountDownLatch latch) @@ -324,7 +324,7 @@ public class FailedSelectorTest } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to restart selector: {}", customManagedSelector, e); } finally { @@ -335,7 +335,7 @@ public class FailedSelectorTest private static class RestartServerTask implements Consumer { - private static final Logger LOG = Log.getLogger(RestartServerTask.class); + private static final Logger LOG = LoggerFactory.getLogger(RestartServerTask.class); private final Server server; private final CountDownLatch latch; @@ -355,7 +355,7 @@ public class FailedSelectorTest } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to restart server {}", server, e); } finally { @@ -366,7 +366,7 @@ public class FailedSelectorTest private static class ForceCloseSelectorTask implements Runnable { - private static final Logger LOG = Log.getLogger(ForceCloseSelectorTask.class); + private static final Logger LOG = LoggerFactory.getLogger(ForceCloseSelectorTask.class); private final ServerConnector connector; public ForceCloseSelectorTask(ServerConnector connector) diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/jsp/JspAndDefaultWithAliasesTest.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/jsp/JspAndDefaultWithAliasesTest.java index f345ad2b742..1c3422f3b7c 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/jsp/JspAndDefaultWithAliasesTest.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/jsp/JspAndDefaultWithAliasesTest.java @@ -35,13 +35,13 @@ import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -54,7 +54,7 @@ import static org.hamcrest.Matchers.not; */ public class JspAndDefaultWithAliasesTest { - private static final Logger LOG = Log.getLogger(JspAndDefaultWithAliasesTest.class); + private static final Logger LOG = LoggerFactory.getLogger(JspAndDefaultWithAliasesTest.class); private static Server server; private static URI serverURI; diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/XmlBasedJettyServer.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/XmlBasedJettyServer.java index 93486567cdf..6bef5cd697c 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/XmlBasedJettyServer.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/XmlBasedJettyServer.java @@ -35,11 +35,11 @@ import org.eclipse.jetty.http.HttpScheme; import org.eclipse.jetty.server.NetworkConnector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.PathResource; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.xml.XmlConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -50,7 +50,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; */ public class XmlBasedJettyServer { - private static final Logger LOG = Log.getLogger(XmlBasedJettyServer.class); + private static final Logger LOG = LoggerFactory.getLogger(XmlBasedJettyServer.class); private List _xmlConfigurations; private final Map _properties = new HashMap<>(); private Server _server; diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpsSocketImpl.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpsSocketImpl.java index 85422c7a334..806f986d432 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpsSocketImpl.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpsSocketImpl.java @@ -29,16 +29,16 @@ import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * An HTTPS Socket Impl */ public class HttpsSocketImpl implements HttpSocket { - private static final Logger LOG = Log.getLogger(HttpsSocketImpl.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpsSocketImpl.class); private SSLContext sslContext; private SSLSocketFactory sslfactory; diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/websocket/JavaxSimpleEchoSocket.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/websocket/JavaxSimpleEchoSocket.java index f9457fb7bac..a0b66e578ef 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/websocket/JavaxSimpleEchoSocket.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/websocket/JavaxSimpleEchoSocket.java @@ -27,8 +27,8 @@ import javax.websocket.OnMessage; import javax.websocket.OnOpen; import javax.websocket.Session; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.fail; @@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.fail; subprotocols = {"chat"}) public class JavaxSimpleEchoSocket { - private static final Logger LOG = Log.getLogger(JavaxSimpleEchoSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(JavaxSimpleEchoSocket.class); private Session session; public CountDownLatch messageLatch = new CountDownLatch(1); public CountDownLatch closeLatch = new CountDownLatch(1); @@ -44,7 +44,7 @@ public class JavaxSimpleEchoSocket @OnError public void onError(Throwable t) { - LOG.warn(t); + LOG.warn("Error", t); fail(t.getMessage()); } diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/websocket/JettySimpleEchoSocket.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/websocket/JettySimpleEchoSocket.java index 427d7694a68..6daebda51f0 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/websocket/JettySimpleEchoSocket.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/websocket/JettySimpleEchoSocket.java @@ -21,14 +21,14 @@ package org.eclipse.jetty.test.websocket; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.StatusCode; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage; import org.eclipse.jetty.websocket.api.annotations.WebSocket; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Basic Echo Client Socket @@ -36,7 +36,7 @@ import org.eclipse.jetty.websocket.api.annotations.WebSocket; @WebSocket(maxTextMessageSize = 64 * 1024) public class JettySimpleEchoSocket { - private static final Logger LOG = Log.getLogger(JettySimpleEchoSocket.class); + private static final Logger LOG = LoggerFactory.getLogger(JettySimpleEchoSocket.class); private final CountDownLatch closeLatch; @SuppressWarnings("unused") private Session session; @@ -71,7 +71,7 @@ public class JettySimpleEchoSocket } catch (Throwable t) { - LOG.warn(t); + LOG.warn("Unable to send string+close", t); } } diff --git a/tests/test-jmx/jmx-webapp/src/main/java/org/eclipse/jetty/test/jmx/CommonComponent.java b/tests/test-jmx/jmx-webapp/src/main/java/org/eclipse/jetty/test/jmx/CommonComponent.java index 8dd329ed2fb..089fb638821 100644 --- a/tests/test-jmx/jmx-webapp/src/main/java/org/eclipse/jetty/test/jmx/CommonComponent.java +++ b/tests/test-jmx/jmx-webapp/src/main/java/org/eclipse/jetty/test/jmx/CommonComponent.java @@ -21,13 +21,13 @@ package org.eclipse.jetty.test.jmx; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ManagedObject("A common component available in the webapp") public class CommonComponent extends AbstractLifeCycle { - private static final Logger LOG = Log.getLogger(CommonComponent.class); + private static final Logger LOG = LoggerFactory.getLogger(CommonComponent.class); public CommonComponent() { diff --git a/tests/test-jmx/jmx-webapp/src/main/java/org/eclipse/jetty/test/jmx/MyContainerInitializer.java b/tests/test-jmx/jmx-webapp/src/main/java/org/eclipse/jetty/test/jmx/MyContainerInitializer.java index 4a84b02c924..3cc7a92409f 100644 --- a/tests/test-jmx/jmx-webapp/src/main/java/org/eclipse/jetty/test/jmx/MyContainerInitializer.java +++ b/tests/test-jmx/jmx-webapp/src/main/java/org/eclipse/jetty/test/jmx/MyContainerInitializer.java @@ -23,12 +23,12 @@ import javax.servlet.ServletContainerInitializer; import javax.servlet.ServletContext; import javax.servlet.ServletException; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class MyContainerInitializer implements ServletContainerInitializer { - private static final Logger LOG = Log.getLogger(MyContainerInitializer.class); + private static final Logger LOG = LoggerFactory.getLogger(MyContainerInitializer.class); @Override public void onStartup(Set> c, ServletContext ctx) throws ServletException diff --git a/tests/test-jmx/jmx-webapp/src/main/java/org/eclipse/jetty/test/jmx/PingServlet.java b/tests/test-jmx/jmx-webapp/src/main/java/org/eclipse/jetty/test/jmx/PingServlet.java index f845866ea5c..db36fe43784 100644 --- a/tests/test-jmx/jmx-webapp/src/main/java/org/eclipse/jetty/test/jmx/PingServlet.java +++ b/tests/test-jmx/jmx-webapp/src/main/java/org/eclipse/jetty/test/jmx/PingServlet.java @@ -28,8 +28,8 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedOperation; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Simple ping into this webapp to see if it is here. @@ -38,7 +38,7 @@ import org.eclipse.jetty.util.log.Logger; @ManagedObject("Ping Servlet") public class PingServlet extends HttpServlet { - private static final Logger LOG = Log.getLogger(PingServlet.class); + private static final Logger LOG = LoggerFactory.getLogger(PingServlet.class); @Override public void init(ServletConfig config) throws ServletException diff --git a/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/PreconfigureJNDIWar.java b/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/PreconfigureJNDIWar.java index 6089cc387d0..ec7001ba6d7 100644 --- a/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/PreconfigureJNDIWar.java +++ b/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/PreconfigureJNDIWar.java @@ -23,13 +23,13 @@ import java.util.concurrent.TimeUnit; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class PreconfigureJNDIWar { private static final long __start = System.nanoTime(); - private static final Logger LOG = Log.getLogger(Server.class); + private static final Logger LOG = LoggerFactory.getLogger(Server.class); public static void main(String[] args) throws Exception { diff --git a/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/PreconfigureSpecWar.java b/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/PreconfigureSpecWar.java index e2aec048514..654e81a0497 100644 --- a/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/PreconfigureSpecWar.java +++ b/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/PreconfigureSpecWar.java @@ -26,13 +26,13 @@ import java.util.concurrent.TimeUnit; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class PreconfigureSpecWar { private static final long __start = System.nanoTime(); - private static final Logger LOG = Log.getLogger(Server.class); + private static final Logger LOG = LoggerFactory.getLogger(Server.class); public static void main(String[] args) throws Exception { diff --git a/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/PreconfigureStandardTestWar.java b/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/PreconfigureStandardTestWar.java index a54658626f1..9d0bfce50af 100644 --- a/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/PreconfigureStandardTestWar.java +++ b/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/PreconfigureStandardTestWar.java @@ -23,9 +23,9 @@ import java.util.concurrent.TimeUnit; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * PreconfigureStandardTestWar @@ -33,7 +33,7 @@ import org.eclipse.jetty.util.resource.Resource; public class PreconfigureStandardTestWar { private static final long __start = System.nanoTime(); - private static final Logger LOG = Log.getLogger(Server.class); + private static final Logger LOG = LoggerFactory.getLogger(Server.class); public static void main(String[] args) throws Exception { diff --git a/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/QuickStartTest.java b/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/QuickStartTest.java index 93ce194b9da..6c09ede8afb 100644 --- a/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/QuickStartTest.java +++ b/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/QuickStartTest.java @@ -31,7 +31,6 @@ import org.eclipse.jetty.server.NetworkConnector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.resource.PathResource; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.WebAppContext; @@ -55,7 +54,7 @@ public class QuickStartTest PreconfigureStandardTestWar.main(new String[]{}); WebDescriptor descriptor = new WebDescriptor(Resource.newResource("./target/test-standard-preconfigured/WEB-INF/quickstart-web.xml")); - descriptor.parse(WebDescriptor.getParser(!Log.getLogger(QuickStartGeneratorConfiguration.class).isDebugEnabled())); + descriptor.parse(WebDescriptor.getParser(!QuickStartGeneratorConfiguration.LOG.isDebugEnabled())); Node node = descriptor.getRoot(); assertThat(node, Matchers.notNullValue()); @@ -71,9 +70,9 @@ public class QuickStartTest WebAppContext webapp = new WebAppContext(); webapp.addConfiguration(new QuickStartConfiguration(), - new EnvConfiguration(), - new PlusConfiguration(), - new AnnotationConfiguration()); + new EnvConfiguration(), + new PlusConfiguration(), + new AnnotationConfiguration()); webapp.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART); webapp.setWar(war); webapp.setContextPath("/"); @@ -108,7 +107,7 @@ public class QuickStartTest assertTrue(Files.exists(webXmlPath), "Path should exist:" + webXmlPath); WebDescriptor descriptor = new WebDescriptor(new PathResource(webXmlPath)); - descriptor.parse(WebDescriptor.getParser(!Log.getLogger(QuickStartGeneratorConfiguration.class).isDebugEnabled())); + descriptor.parse(WebDescriptor.getParser(!QuickStartGeneratorConfiguration.LOG.isDebugEnabled())); Node node = descriptor.getRoot(); assertThat(node, Matchers.notNullValue()); @@ -124,9 +123,9 @@ public class QuickStartTest WebAppContext webapp = new WebAppContext(); webapp.addConfiguration(new QuickStartConfiguration(), - new EnvConfiguration(), - new PlusConfiguration(), - new AnnotationConfiguration()); + new EnvConfiguration(), + new PlusConfiguration(), + new AnnotationConfiguration()); webapp.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART); webapp.setWar(war); webapp.setContextPath("/"); @@ -158,7 +157,7 @@ public class QuickStartTest PreconfigureJNDIWar.main(new String[]{}); WebDescriptor descriptor = new WebDescriptor(Resource.newResource("./target/test-jndi-preconfigured/WEB-INF/quickstart-web.xml")); - descriptor.parse(WebDescriptor.getParser(!Log.getLogger(QuickStartGeneratorConfiguration.class).isDebugEnabled())); + descriptor.parse(WebDescriptor.getParser(!QuickStartGeneratorConfiguration.LOG.isDebugEnabled())); Node node = descriptor.getRoot(); assertThat(node, Matchers.notNullValue()); @@ -174,9 +173,9 @@ public class QuickStartTest WebAppContext webapp = new WebAppContext(); webapp.addConfiguration(new QuickStartConfiguration(), - new EnvConfiguration(), - new PlusConfiguration(), - new AnnotationConfiguration()); + new EnvConfiguration(), + new PlusConfiguration(), + new AnnotationConfiguration()); webapp.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART); webapp.setWar(war); webapp.setContextPath("/"); diff --git a/tests/test-sessions/test-hazelcast-sessions/src/test/resources/jetty-logging.properties b/tests/test-sessions/test-hazelcast-sessions/src/test/resources/jetty-logging.properties index 07faa86dbce..c2be11c689a 100644 --- a/tests/test-sessions/test-hazelcast-sessions/src/test/resources/jetty-logging.properties +++ b/tests/test-sessions/test-hazelcast-sessions/src/test/resources/jetty-logging.properties @@ -1 +1 @@ -org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog \ No newline at end of file +org.eclipse.jetty.LEVEL=INFO \ No newline at end of file diff --git a/tests/test-sessions/test-jdbc-sessions/pom.xml b/tests/test-sessions/test-jdbc-sessions/pom.xml index a07a9b80ba4..c2c2e8007f3 100644 --- a/tests/test-sessions/test-jdbc-sessions/pom.xml +++ b/tests/test-sessions/test-jdbc-sessions/pom.xml @@ -45,6 +45,10 @@ test-sessions-common ${project.version} + + org.slf4j + slf4j-api + org.apache.derby derby @@ -55,6 +59,12 @@ derbytools test + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + test + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/MongoTestHelper.java b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/MongoTestHelper.java index 8f58af33d80..28c0ebe0ca5 100644 --- a/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/MongoTestHelper.java +++ b/tests/test-sessions/test-mongodb-sessions/src/test/java/org/eclipse/jetty/nosql/mongodb/MongoTestHelper.java @@ -32,8 +32,8 @@ import com.mongodb.MongoException; import com.mongodb.WriteConcern; import org.eclipse.jetty.server.session.SessionData; import org.eclipse.jetty.util.ClassLoadingObjectInputStream; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -44,7 +44,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; */ public class MongoTestHelper { - private static final Logger LOG = Log.getLogger(MongoTestHelper.class); + private static final Logger LOG = LoggerFactory.getLogger(MongoTestHelper.class); public static final String DB_NAME = "HttpSessions"; public static final String COLLECTION_NAME = "testsessions"; diff --git a/tests/test-sessions/test-sessions-common/pom.xml b/tests/test-sessions/test-sessions-common/pom.xml index a423ae8630a..906c26ddeb8 100644 --- a/tests/test-sessions/test-sessions-common/pom.xml +++ b/tests/test-sessions/test-sessions-common/pom.xml @@ -29,6 +29,11 @@ jetty-client ${project.version} + + org.eclipse.jetty + jetty-slf4j-impl + ${project.version} + org.eclipse.jetty.toolchain jetty-test-helper diff --git a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/AbstractSessionCacheTest.java b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/AbstractSessionCacheTest.java index 31704601f43..d67ca6785ff 100644 --- a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/AbstractSessionCacheTest.java +++ b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/AbstractSessionCacheTest.java @@ -41,8 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; /** - * Base class for all tests on all flavours of SessionCache - * + * Base class for all tests on all flavours of SessionCache */ public abstract class AbstractSessionCacheTest { diff --git a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/DuplicateCookieTest.java b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/DuplicateCookieTest.java index ff4d3f1b5f8..a254d2fe3cd 100644 --- a/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/DuplicateCookieTest.java +++ b/tests/test-sessions/test-sessions-common/src/test/java/org/eclipse/jetty/server/session/DuplicateCookieTest.java @@ -49,7 +49,7 @@ public class DuplicateCookieTest String contextPath = ""; String servletMapping = "/server"; HttpClient client = null; - + DefaultSessionCacheFactory cacheFactory = new DefaultSessionCacheFactory(); SessionDataStoreFactory storeFactory = new TestSessionDataStoreFactory(); diff --git a/tests/test-webapps/test-jetty-webapp/pom.xml b/tests/test-webapps/test-jetty-webapp/pom.xml index f26a2c4c306..dbe6348563a 100644 --- a/tests/test-webapps/test-jetty-webapp/pom.xml +++ b/tests/test-webapps/test-jetty-webapp/pom.xml @@ -134,6 +134,14 @@ + + org.slf4j + slf4j-api + + + org.eclipse.jetty + jetty-slf4j-impl + org.eclipse.jetty jetty-servlets diff --git a/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/ChatServlet.java b/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/ChatServlet.java index f00f4164ece..3ab0374ddcf 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/ChatServlet.java +++ b/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/ChatServlet.java @@ -32,8 +32,8 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // Simple asynchronous Chat room. // This does not handle duplicate usernames or multiple frames/tabs from the same browser @@ -41,7 +41,7 @@ import org.eclipse.jetty.util.log.Logger; @SuppressWarnings("serial") public class ChatServlet extends HttpServlet { - private static final Logger LOG = Log.getLogger(ChatServlet.class); + private static final Logger LOG = LoggerFactory.getLogger(ChatServlet.class); private long asyncTimeout = 10000; diff --git a/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/Dump.java b/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/Dump.java index 29fa75c43b3..cda240ce815 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/Dump.java +++ b/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/Dump.java @@ -56,7 +56,7 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; import javax.servlet.http.Part; -import org.eclipse.jetty.util.log.Log; +import org.slf4j.LoggerFactory; /** * Dump Servlet Request. @@ -346,12 +346,12 @@ public class Dump extends HttpServlet } catch (IOException e2) { - Log.getLogger(Dump.class).ignore(e2); + LoggerFactory.getLogger(Dump.class).trace("IGNORED", e2); } } catch (IOException e) { - Log.getLogger(Dump.class).ignore(e); + LoggerFactory.getLogger(Dump.class).trace("IGNORED", e); } return; } diff --git a/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/SecureModeServlet.java b/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/SecureModeServlet.java index d822b22a7a7..326568a7473 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/SecureModeServlet.java +++ b/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/SecureModeServlet.java @@ -32,8 +32,8 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Dump Servlet Request. @@ -41,7 +41,7 @@ import org.eclipse.jetty.util.log.Logger; @SuppressWarnings("serial") public class SecureModeServlet extends HttpServlet { - private static final Logger LOG = Log.getLogger(SecureModeServlet.class); + private static final Logger LOG = LoggerFactory.getLogger(SecureModeServlet.class); @Override public void init(ServletConfig config) throws ServletException diff --git a/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/TestFilter.java b/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/TestFilter.java index cb215dbad7d..4aa03d55235 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/TestFilter.java +++ b/tests/test-webapps/test-jetty-webapp/src/main/java/com/acme/TestFilter.java @@ -32,8 +32,8 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * TestFilter. @@ -44,7 +44,7 @@ import org.eclipse.jetty.util.log.Logger; */ public class TestFilter implements Filter { - private static final Logger LOG = Log.getLogger(TestFilter.class); + private static final Logger LOG = LoggerFactory.getLogger(TestFilter.class); private boolean _remote; private ServletContext _context; diff --git a/tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java b/tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java index 30b8d52bde0..31b249b6340 100644 --- a/tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java +++ b/tests/test-webapps/test-jetty-webapp/src/test/java/org/eclipse/jetty/TestServer.java @@ -47,18 +47,18 @@ import org.eclipse.jetty.server.handler.HandlerWrapper; import org.eclipse.jetty.server.handler.ResourceHandler; import org.eclipse.jetty.server.session.DefaultSessionCache; import org.eclipse.jetty.server.session.FileSessionDataStore; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.webapp.Configurations; import org.eclipse.jetty.webapp.MetaInfConfiguration; import org.eclipse.jetty.webapp.WebAppContext; import org.junit.jupiter.api.Disabled; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @Disabled("Not a test case") public class TestServer { - private static final Logger LOG = Log.getLogger(TestServer.class); + private static final Logger LOG = LoggerFactory.getLogger(TestServer.class); public static void main(String[] args) throws Exception { @@ -81,7 +81,6 @@ public class TestServer // Setup JMX MBeanContainer mbContainer = new MBeanContainer(ManagementFactory.getPlatformMBeanServer()); server.addBean(mbContainer); - server.addBean(Log.getLog()); // Common HTTP configuration HttpConfiguration config = new HttpConfiguration(); @@ -181,7 +180,7 @@ public class TestServer } catch (Exception e) { - LOG.warn(e); + LOG.warn("Unable to restart server", e); } } }.start(); diff --git a/tests/test-webapps/test-proxy-webapp/src/test/java/org/eclipse/jetty/TestTransparentProxyServer.java b/tests/test-webapps/test-proxy-webapp/src/test/java/org/eclipse/jetty/TestTransparentProxyServer.java index 697941589c9..1bd261c1111 100644 --- a/tests/test-webapps/test-proxy-webapp/src/test/java/org/eclipse/jetty/TestTransparentProxyServer.java +++ b/tests/test-webapps/test-proxy-webapp/src/test/java/org/eclipse/jetty/TestTransparentProxyServer.java @@ -35,7 +35,6 @@ import org.eclipse.jetty.server.SslConnectionFactory; import org.eclipse.jetty.server.handler.ContextHandlerCollection; import org.eclipse.jetty.server.handler.DefaultHandler; import org.eclipse.jetty.server.handler.HandlerCollection; -import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.webapp.WebAppContext; @@ -59,7 +58,6 @@ public class TestTransparentProxyServer // Setup JMX MBeanContainer mbContainer = new MBeanContainer(ManagementFactory.getPlatformMBeanServer()); server.addBean(mbContainer); - server.addBean(Log.getLog()); // Common HTTP configuration HttpConfiguration httpConfig = new HttpConfiguration(); diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml index 4a0126dbd58..d75a82a5097 100644 --- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml +++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml @@ -3,11 +3,15 @@ - The test-spec webapp is deployed. DO NOT USE IN PRODUCTION! + + The test-spec webapp is deployed. DO NOT USE IN PRODUCTION! + + - + + org.eclipse.jetty + + WEB-INF/lib/jetty-util.jar logging used! + + diff --git a/tests/test-webapps/test-webapp-rfc2616/src/main/webapp/WEB-INF/web.xml b/tests/test-webapps/test-webapp-rfc2616/src/main/webapp/WEB-INF/web.xml index 06859776381..92ead9c5ce0 100644 --- a/tests/test-webapps/test-webapp-rfc2616/src/main/webapp/WEB-INF/web.xml +++ b/tests/test-webapps/test-webapp-rfc2616/src/main/webapp/WEB-INF/web.xml @@ -1,5 +1,5 @@ - + rfc2616-webapp diff --git a/tests/test-webapps/test-websocket-webapp/src/main/java/org/eclipse/jetty/tests/webapp/websocket/OnCloseServerEndpoint.java b/tests/test-webapps/test-websocket-webapp/src/main/java/org/eclipse/jetty/tests/webapp/websocket/OnCloseServerEndpoint.java index d0353e8a9de..11467a865f4 100644 --- a/tests/test-webapps/test-websocket-webapp/src/main/java/org/eclipse/jetty/tests/webapp/websocket/OnCloseServerEndpoint.java +++ b/tests/test-webapps/test-websocket-webapp/src/main/java/org/eclipse/jetty/tests/webapp/websocket/OnCloseServerEndpoint.java @@ -19,20 +19,19 @@ package org.eclipse.jetty.tests.webapp.websocket; import java.io.IOException; - import javax.websocket.OnClose; import javax.websocket.OnError; import javax.websocket.OnMessage; import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/onclose/{arg}") public class OnCloseServerEndpoint { - private static final Logger LOGGER = Log.getLogger(OnCloseServerEndpoint.class); + private static final Logger LOGGER = LoggerFactory.getLogger(OnCloseServerEndpoint.class); private static String close = ""; @OnMessage diff --git a/tests/test-webapps/test-websocket-webapp/src/main/java/org/eclipse/jetty/tests/webapp/websocket/OnOpenServerEndpoint.java b/tests/test-webapps/test-websocket-webapp/src/main/java/org/eclipse/jetty/tests/webapp/websocket/OnOpenServerEndpoint.java index b69f62a0abd..32b79f14a67 100644 --- a/tests/test-webapps/test-websocket-webapp/src/main/java/org/eclipse/jetty/tests/webapp/websocket/OnOpenServerEndpoint.java +++ b/tests/test-webapps/test-websocket-webapp/src/main/java/org/eclipse/jetty/tests/webapp/websocket/OnOpenServerEndpoint.java @@ -19,20 +19,19 @@ package org.eclipse.jetty.tests.webapp.websocket; import java.io.IOException; - import javax.websocket.OnError; import javax.websocket.OnMessage; import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ServerEndpoint("/onopen/{arg}") public class OnOpenServerEndpoint { - private static final Logger LOGGER = Log.getLogger(OnOpenServerEndpoint.class); + private static final Logger LOGGER = LoggerFactory.getLogger(OnOpenServerEndpoint.class); private static String open = ""; @OnMessage