Remove lombok.
This commit is contained in:
parent
4f7077f6b7
commit
6efc2bcb49
8 changed files with 48 additions and 42 deletions
|
@ -3,6 +3,8 @@ package io.kokuwa.micronaut.logging.http;
|
|||
import java.util.Map;
|
||||
|
||||
import org.reactivestreams.Publisher;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
import io.micronaut.core.async.publisher.Publishers;
|
||||
|
@ -18,6 +20,7 @@ import io.micronaut.http.filter.ServerFilterChain;
|
|||
*/
|
||||
public abstract class AbstractMdcFilter implements HttpServerFilter {
|
||||
|
||||
protected final Logger log = LoggerFactory.getLogger(getClass());
|
||||
protected final int order;
|
||||
protected final String prefix;
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ import io.micronaut.http.filter.ServerFilterChain;
|
|||
import io.micronaut.http.filter.ServerFilterPhase;
|
||||
import io.micronaut.runtime.context.scope.Refreshable;
|
||||
import io.micronaut.security.authentication.Authentication;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Filter to add claims from authentication to MDC.
|
||||
|
@ -28,7 +27,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
@Requires(classes = Authentication.class)
|
||||
@Requires(property = AuthenticationMdcFilter.PREFIX + ".enabled", notEquals = StringUtils.FALSE)
|
||||
@Filter("${" + AuthenticationMdcFilter.PREFIX + ".path:/**}")
|
||||
@Slf4j
|
||||
public class AuthenticationMdcFilter extends AbstractMdcFilter {
|
||||
|
||||
public static final String PREFIX = "logger.http.authentication";
|
||||
|
|
|
@ -18,7 +18,6 @@ import io.micronaut.http.annotation.Filter;
|
|||
import io.micronaut.http.filter.ServerFilterChain;
|
||||
import io.micronaut.http.filter.ServerFilterPhase;
|
||||
import io.micronaut.runtime.context.scope.Refreshable;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Filter to add http headers to MDC.
|
||||
|
@ -29,7 +28,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
@Requires(property = HeaderMdcFilter.PREFIX + ".enabled", notEquals = StringUtils.FALSE)
|
||||
@Requires(property = HeaderMdcFilter.PREFIX + ".names")
|
||||
@Filter("${" + HeaderMdcFilter.PREFIX + ".path:/**}")
|
||||
@Slf4j
|
||||
public class HeaderMdcFilter extends AbstractMdcFilter {
|
||||
|
||||
public static final String PREFIX = "logger.http.header";
|
||||
|
|
|
@ -21,7 +21,6 @@ import io.micronaut.http.annotation.Filter;
|
|||
import io.micronaut.http.filter.ServerFilterChain;
|
||||
import io.micronaut.http.filter.ServerFilterPhase;
|
||||
import io.micronaut.runtime.context.scope.Refreshable;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Filter to add request path parts to MDC.
|
||||
|
@ -32,7 +31,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
@Requires(property = PathMdcFilter.PREFIX + ".enabled", notEquals = StringUtils.FALSE)
|
||||
@Requires(property = PathMdcFilter.PREFIX + ".patterns")
|
||||
@Filter("${" + PathMdcFilter.PREFIX + ".path:/**}")
|
||||
@Slf4j
|
||||
public class PathMdcFilter extends AbstractMdcFilter {
|
||||
|
||||
public static final String PREFIX = "logger.http.path";
|
||||
|
|
|
@ -8,8 +8,6 @@ import java.util.Map;
|
|||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.contrib.json.classic.JsonLayout;
|
||||
import io.micronaut.core.util.StringUtils;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* GCP logging layout.
|
||||
|
@ -18,7 +16,6 @@ import lombok.experimental.Accessors;
|
|||
* @see "https://cloud.google.com/logging/docs/agent/configuration#process-payload"
|
||||
* @see "https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext"
|
||||
*/
|
||||
@Accessors(chain = false)
|
||||
public class GcpJsonLayout extends JsonLayout {
|
||||
|
||||
private static final String UNDEFINED = "_IS_UNDEFINED";
|
||||
|
@ -26,9 +23,7 @@ public class GcpJsonLayout extends JsonLayout {
|
|||
private static final String SEVERITY_ATTR_NAME = "severity";
|
||||
|
||||
private Map<String, String> serviceContext;
|
||||
@Setter
|
||||
private String serviceName;
|
||||
@Setter
|
||||
private String serviceVersion;
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,6 +2,9 @@ package io.kokuwa.micronaut.logging.mdc;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
import io.kokuwa.micronaut.logging.LogbackUtil;
|
||||
import io.micronaut.context.annotation.BootstrapContextCompatible;
|
||||
|
@ -11,7 +14,6 @@ import io.micronaut.context.env.Environment;
|
|||
import io.micronaut.core.annotation.Internal;
|
||||
import io.micronaut.core.type.Argument;
|
||||
import io.micronaut.core.util.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Configure MDC filter.
|
||||
|
@ -24,11 +26,11 @@ import lombok.extern.slf4j.Slf4j;
|
|||
@BootstrapContextCompatible
|
||||
@Context
|
||||
@Internal
|
||||
@Slf4j
|
||||
public class MDCTurboFilterConfigurer {
|
||||
|
||||
public static final String PREFIX = "logger.mdc";
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MDCTurboFilterConfigurer.class);
|
||||
private final LogbackUtil logback;
|
||||
private final Environment environment;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue