Skip to content

Commit

Permalink
Issue #4572 - Mechanical Change to use org.slf4j
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Mar 16, 2020
1 parent 8b7e649 commit 57604d0
Show file tree
Hide file tree
Showing 680 changed files with 3,215 additions and 3,071 deletions.
10 changes: 10 additions & 0 deletions apache-jsp/pom.xml
Expand Up @@ -85,6 +85,10 @@
<artifactId>jetty-annotations</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
Expand All @@ -105,6 +109,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-slf4j-impl</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-helper</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion apache-jsp/src/main/java/module-info.java
Expand Up @@ -29,9 +29,9 @@

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;
Expand Down
Expand Up @@ -23,8 +23,8 @@
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:
Expand All @@ -36,7 +36,7 @@
*/
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
Expand Down Expand Up @@ -64,7 +64,7 @@ public class JettyDistribution
}
catch (Throwable th)
{
LOG.warn(th);
LOG.warn("Unable to resolve Jetty Distribution location", th);
}
}

Expand Down Expand Up @@ -119,7 +119,7 @@ private static Path asJettyDistribution(String jettyHome)
}
catch (Exception e)
{
LOG.ignore(e);
LOG.trace("IGNORED", e);
}
return null;
}
Expand Down
Expand Up @@ -25,8 +25,6 @@

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;
Expand All @@ -37,6 +35,8 @@
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;
Expand Down Expand Up @@ -87,7 +87,7 @@ public void testGetEcho() throws Exception
@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<String> messages = new LinkedBlockingQueue<>();

@OnWebSocketMessage
Expand All @@ -99,7 +99,7 @@ public void onMessage(String message)
@OnWebSocketError
public void onError(Throwable cause)
{
LOG.warn(cause);
LOG.warn("TrackingClientEndpoint Error", cause);
}

@OnWebSocketClose
Expand Down
10 changes: 10 additions & 0 deletions jetty-alpn/jetty-alpn-client/pom.xml
Expand Up @@ -51,6 +51,16 @@
<artifactId>jetty-io</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-slf4j-impl</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-helper</artifactId>
Expand Down
Expand Up @@ -32,12 +32,12 @@
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<Client> processors = new ArrayList<>();
private final Executor executor;
Expand All @@ -64,7 +64,7 @@ public ALPNClientConnectionFactory(Executor executor, ClientConnectionFactory co
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug(x);
LOG.debug("Unable to load client processor", x);
failure.addSuppressed(x);
continue;
}
Expand Down
11 changes: 11 additions & 0 deletions jetty-alpn/jetty-alpn-conscrypt-client/pom.xml
Expand Up @@ -26,12 +26,23 @@
<artifactId>jetty-alpn-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>org.eclipse.jetty.http2</groupId>
<artifactId>http2-client</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-slf4j-impl</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Expand Up @@ -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.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()
Expand Down Expand Up @@ -95,8 +95,8 @@ public void handshakeSucceeded(Event event)
}
catch (Throwable e)
{
LOG.warn("Unable to process Conscrypt ApplicationProtocol for {}", alpnConnection, e);
alpnConnection.selected(null);
LOG.warn(e);
}
}
}
Expand Down
Expand Up @@ -31,12 +31,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.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()
Expand Down
10 changes: 10 additions & 0 deletions jetty-alpn/jetty-alpn-java-client/pom.xml
Expand Up @@ -40,13 +40,23 @@
<artifactId>jetty-alpn-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>org.eclipse.jetty.http2</groupId>
<artifactId>http2-client</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-slf4j-impl</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Expand Up @@ -28,12 +28,12 @@
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()
Expand Down
Expand Up @@ -28,12 +28,12 @@
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()
Expand Down
Expand Up @@ -27,12 +27,12 @@
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<String> protocols, String defaultProtocol)
{
Expand Down
Expand Up @@ -31,12 +31,12 @@
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<Server> processors = new ArrayList<>();

Expand All @@ -61,7 +61,7 @@ public ALPNServerConnectionFactory(@Name("protocols") String... protocols)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug(x);
LOG.debug(x.getMessage(), x);
if (x != failure)
failure.addSuppressed(x);
continue;
Expand All @@ -75,7 +75,7 @@ public ALPNServerConnectionFactory(@Name("protocols") String... protocols)
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);
}
Expand Down
Expand Up @@ -39,7 +39,6 @@
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;

import javax.servlet.ServletContainerInitializer;
import javax.servlet.annotation.HandlesTypes;

Expand All @@ -51,8 +50,6 @@
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;
Expand All @@ -63,13 +60,15 @@
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";
Expand Down Expand Up @@ -337,7 +336,7 @@ public void configure(WebAppContext context) throws Exception
{
//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
Expand Down Expand Up @@ -411,7 +410,7 @@ public void postConfigure(WebAppContext context) throws Exception

/**
* 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
Expand Down Expand Up @@ -836,8 +835,10 @@ public List<ServletContainerInitializer> getNonExcludedInitializers(WebAppContex
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;
}

Expand Down Expand Up @@ -1026,7 +1027,7 @@ public void parseContainerPath(final WebAppContext context, final AnnotationPars

/**
* Scan jars in WEB-INF/lib.
*
*
* Only jars selected by MetaInfConfiguration, and that are not excluded
* by an ordering will be considered.
*
Expand Down

0 comments on commit 57604d0

Please sign in to comment.