org.zalando.logbook.LogbookFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of logbook-api Show documentation
Show all versions of logbook-api Show documentation
HTTP request and response logging
package org.zalando.logbook;
import org.apiguardian.api.API;
import org.zalando.logbook.attributes.AttributeExtractor;
import javax.annotation.Nullable;
import java.util.Comparator;
import java.util.ServiceLoader;
import java.util.function.Predicate;
import java.util.stream.StreamSupport;
import static org.apiguardian.api.API.Status.STABLE;
@API(status = STABLE)
public interface LogbookFactory {
default int getPriority() {
return 0;
}
LogbookFactory INSTANCE = StreamSupport.stream(ServiceLoader.load(LogbookFactory.class).spliterator(), false)
.max(Comparator.comparingInt(LogbookFactory::getPriority))
.orElse(null);
Logbook create(
@Nullable final Predicate condition,
@Nullable final CorrelationId correlationId,
@Nullable final QueryFilter queryFilter,
@Nullable final PathFilter pathFilter,
@Nullable final HeaderFilter headerFilter,
@Nullable final BodyFilter bodyFilter,
@Nullable final RequestFilter requestFilter,
@Nullable final ResponseFilter responseFilter,
@Nullable final Strategy strategy,
@Nullable final AttributeExtractor attributeExtractor,
@Nullable final Sink sink);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy