Skip to content

Commit

Permalink
Suppress warnings regarding Slf4jRequestLog for now, will file JIRA.
Browse files Browse the repository at this point in the history
  • Loading branch information
ijuma committed May 2, 2019
1 parent c6754db commit e66bc62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Expand Up @@ -34,7 +34,6 @@
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.Slf4jRequestLog;
import org.eclipse.jetty.server.handler.DefaultHandler;
import org.eclipse.jetty.server.handler.HandlerCollection;
import org.eclipse.jetty.server.handler.RequestLogHandler;
Expand Down Expand Up @@ -160,6 +159,7 @@ public Connector createConnector(String listener) {
return connector;
}

@SuppressWarnings("deprecation")
public void start(HerderProvider herderProvider, Plugins plugins) {
log.info("Starting REST server");

Expand Down Expand Up @@ -195,7 +195,8 @@ public void start(HerderProvider herderProvider, Plugins plugins) {
}

RequestLogHandler requestLogHandler = new RequestLogHandler();
Slf4jRequestLog requestLog = new Slf4jRequestLog();
// Use fully qualified name to avoid deprecation warning
org.eclipse.jetty.server.Slf4jRequestLog requestLog = new org.eclipse.jetty.server.Slf4jRequestLog();
requestLog.setLoggerName(RestServer.class.getCanonicalName());
requestLog.setLogLatency(true);
requestLogHandler.setRequestLog(requestLog);
Expand Down
Expand Up @@ -44,6 +44,7 @@ public static SslContextFactory createSslContextFactory(WorkerConfig config) {
/**
* Configures SSL/TLS for HTTPS Jetty Server / Client
*/
@SuppressWarnings("deprecation")
public static SslContextFactory createSslContextFactory(WorkerConfig config, boolean client) {
Map<String, Object> sslConfigValues = config.valuesWithPrefixAllOrNothing("listeners.https.");

Expand Down Expand Up @@ -140,6 +141,7 @@ protected static void configureSslContextFactoryEndpointIdentification(SslContex
/**
* Configures Authentication related settings in SslContextFactory
*/
@SuppressWarnings("deprecation")
protected static void configureSslContextFactoryAuthentication(SslContextFactory ssl, Map<String, Object> sslConfigValues) {
String sslClientAuth = (String) getOrDefault(sslConfigValues, BrokerSecurityConfigs.SSL_CLIENT_AUTH_CONFIG, "none");
switch (sslClientAuth) {
Expand Down
Expand Up @@ -26,7 +26,6 @@
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.Slf4jRequestLog;
import org.eclipse.jetty.server.handler.DefaultHandler;
import org.eclipse.jetty.server.handler.HandlerCollection;
import org.eclipse.jetty.server.handler.RequestLogHandler;
Expand Down Expand Up @@ -85,6 +84,7 @@ public JsonRestServer(int port) {
*
* @param resources The path handling resources to register.
*/
@SuppressWarnings("deprecation")
public void start(Object... resources) {
log.info("Starting REST server");
ResourceConfig resourceConfig = new ResourceConfig();
Expand All @@ -101,7 +101,8 @@ public void start(Object... resources) {
context.addServlet(servletHolder, "/*");

RequestLogHandler requestLogHandler = new RequestLogHandler();
Slf4jRequestLog requestLog = new Slf4jRequestLog();
// Use fully qualified name to avoid deprecation warning in import statement
org.eclipse.jetty.server.Slf4jRequestLog requestLog = new org.eclipse.jetty.server.Slf4jRequestLog();
requestLog.setLoggerName(JsonRestServer.class.getCanonicalName());
requestLog.setLogLatency(true);
requestLogHandler.setRequestLog(requestLog);
Expand Down

0 comments on commit e66bc62

Please sign in to comment.