Issue #4685 - jetty-http-spi logging for both jetty and jul
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
parent
2c600f2b68
commit
44d2171986
|
@ -40,9 +40,16 @@
|
|||
<artifactId>slf4j-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jul-to-slf4j</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-slf4j-impl</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml</groupId>
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// 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.http.spi;
|
||||
|
||||
public final class LoggingUtil
|
||||
{
|
||||
/**
|
||||
* It's easier to setup logging in code for this test project,
|
||||
* then it is to setup the various system properties and files for every test
|
||||
* execution (maven, CI, and IDE).
|
||||
*/
|
||||
public static void init()
|
||||
{
|
||||
// Wire up java.util.logging (used by javax.xml.soap others) to slf4j.
|
||||
org.slf4j.bridge.SLF4JBridgeHandler.removeHandlersForRootLogger();
|
||||
org.slf4j.bridge.SLF4JBridgeHandler.install();
|
||||
}
|
||||
}
|
|
@ -44,6 +44,11 @@ import static org.hamcrest.Matchers.is;
|
|||
|
||||
public class SPIServerTest
|
||||
{
|
||||
static
|
||||
{
|
||||
LoggingUtil.init();
|
||||
}
|
||||
|
||||
String host = "localhost";
|
||||
HttpServer server;
|
||||
int port;
|
||||
|
|
|
@ -41,6 +41,10 @@ import org.junit.jupiter.api.Test;
|
|||
|
||||
public class TestEndpointMultiplePublishProblem
|
||||
{
|
||||
static
|
||||
{
|
||||
LoggingUtil.init();
|
||||
}
|
||||
|
||||
private static String default_impl = System.getProperty("com.sun.net.httpserver.HttpServerProvider");
|
||||
|
||||
|
|
|
@ -42,6 +42,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||
|
||||
public class TestSPIServer
|
||||
{
|
||||
static
|
||||
{
|
||||
LoggingUtil.init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a server that has a null InetSocketAddress, then
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
# Jetty Logging using jetty-slf4j-impl
|
||||
org.eclipse.jetty.logging.appender.NAME_CONDENSE=false
|
||||
org.eclipse.jetty.logging.appender.MESSAGE_ESCAPE=false
|
||||
# org.eclipse.jetty.LEVEL=WARN
|
||||
log.LEVEL=INFO
|
|
@ -0,0 +1,3 @@
|
|||
# Jetty Logging using jetty-slf4j-impl
|
||||
# org.eclipse.jetty.LEVEL=WARN
|
||||
log.LEVEL=WARN
|
Loading…
Reference in New Issue