Add filters/tasks to enable/disable request logging.

This commit is contained in:
Jon Chambers
2020-10-20 15:27:36 -04:00
committed by Jon Chambers
parent ab62c19de9
commit 1732cf9243
9 changed files with 110 additions and 12 deletions

View File

@@ -4,18 +4,19 @@
*/
package org.whispersystems.websocket.logging;
import org.glassfish.jersey.server.ContainerRequest;
import org.glassfish.jersey.server.ContainerResponse;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.filter.Filter;
import ch.qos.logback.core.spi.AppenderAttachableImpl;
import ch.qos.logback.core.spi.FilterAttachableImpl;
import ch.qos.logback.core.spi.FilterReply;
import org.glassfish.jersey.server.ContainerRequest;
import org.glassfish.jersey.server.ContainerResponse;
public class WebsocketRequestLog {
private AppenderAttachableImpl<WebsocketEvent> aai = new AppenderAttachableImpl<>();
private FilterAttachableImpl<WebsocketEvent> fai = new FilterAttachableImpl<>();
private final AppenderAttachableImpl<WebsocketEvent> aai = new AppenderAttachableImpl<>();
private final FilterAttachableImpl<WebsocketEvent> fai = new FilterAttachableImpl<>();
public WebsocketRequestLog() {
}

View File

@@ -4,15 +4,7 @@
*/
package org.whispersystems.websocket.logging;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import com.google.common.annotations.VisibleForTesting;
import io.dropwizard.logging.AppenderFactory;
import io.dropwizard.logging.ConsoleAppenderFactory;
import io.dropwizard.logging.async.AsyncAppenderFactory;
import io.dropwizard.logging.filter.LevelFilterFactory;
import io.dropwizard.logging.filter.NullLevelFilterFactory;
import io.dropwizard.logging.layout.LayoutFactory;
import org.slf4j.LoggerFactory;
import org.whispersystems.websocket.logging.layout.WebsocketEventLayoutFactory;
@@ -21,6 +13,15 @@ import javax.validation.constraints.NotNull;
import java.util.Collections;
import java.util.List;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import io.dropwizard.logging.AppenderFactory;
import io.dropwizard.logging.ConsoleAppenderFactory;
import io.dropwizard.logging.async.AsyncAppenderFactory;
import io.dropwizard.logging.filter.LevelFilterFactory;
import io.dropwizard.logging.filter.NullLevelFilterFactory;
import io.dropwizard.logging.layout.LayoutFactory;
public class WebsocketRequestLoggerFactory {
@VisibleForTesting