diff --git a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/CoreLogger.java b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/CoreLogger.java index 35dc3721..6622b68d 100644 --- a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/CoreLogger.java +++ b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/CoreLogger.java @@ -1,10 +1,12 @@ package io.smallrye.faulttolerance.core; +import java.lang.invoke.MethodHandles; + import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.MessageLogger; @MessageLogger(projectCode = "SRFTL", length = 5) interface CoreLogger extends BasicLogger { - CoreLogger LOG = Logger.getMessageLogger(CoreLogger.class, CoreLogger.class.getPackage().getName()); + CoreLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), CoreLogger.class, CoreLogger.class.getPackage().getName()); } diff --git a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/async/AsyncLogger.java b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/async/AsyncLogger.java index 2b8cf3ae..d9a4d9d5 100644 --- a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/async/AsyncLogger.java +++ b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/async/AsyncLogger.java @@ -1,10 +1,13 @@ package io.smallrye.faulttolerance.core.async; +import java.lang.invoke.MethodHandles; + import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.MessageLogger; @MessageLogger(projectCode = "SRFTL", length = 5) interface AsyncLogger extends BasicLogger { - AsyncLogger LOG = Logger.getMessageLogger(AsyncLogger.class, AsyncLogger.class.getPackage().getName()); + AsyncLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), AsyncLogger.class, + AsyncLogger.class.getPackage().getName()); } diff --git a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/bulkhead/BulkheadLogger.java b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/bulkhead/BulkheadLogger.java index 93864003..bf3ef946 100644 --- a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/bulkhead/BulkheadLogger.java +++ b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/bulkhead/BulkheadLogger.java @@ -1,12 +1,15 @@ package io.smallrye.faulttolerance.core.bulkhead; +import java.lang.invoke.MethodHandles; + import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.MessageLogger; @MessageLogger(projectCode = "SRFTL", length = 5) interface BulkheadLogger extends BasicLogger { - BulkheadLogger LOG = Logger.getMessageLogger(BulkheadLogger.class, BulkheadLogger.class.getPackage().getName()); + BulkheadLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), BulkheadLogger.class, + BulkheadLogger.class.getPackage().getName()); default void debugOrTrace(String debugMessage, String traceAmendment) { if (isTraceEnabled()) { diff --git a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/circuit/breaker/CircuitBreakerLogger.java b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/circuit/breaker/CircuitBreakerLogger.java index 745b7352..a13bc227 100644 --- a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/circuit/breaker/CircuitBreakerLogger.java +++ b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/circuit/breaker/CircuitBreakerLogger.java @@ -1,12 +1,14 @@ package io.smallrye.faulttolerance.core.circuit.breaker; +import java.lang.invoke.MethodHandles; + import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.MessageLogger; @MessageLogger(projectCode = "SRFTL", length = 5) interface CircuitBreakerLogger extends BasicLogger { - CircuitBreakerLogger LOG = Logger.getMessageLogger(CircuitBreakerLogger.class, + CircuitBreakerLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), CircuitBreakerLogger.class, CircuitBreakerLogger.class.getPackage().getName()); default void debugOrTrace(String debugMessage, String traceAmendment) { diff --git a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/event/loop/EventLoopLogger.java b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/event/loop/EventLoopLogger.java index ed60cc5f..f6bd01f5 100644 --- a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/event/loop/EventLoopLogger.java +++ b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/event/loop/EventLoopLogger.java @@ -2,6 +2,8 @@ import static org.jboss.logging.annotations.Message.NONE; +import java.lang.invoke.MethodHandles; + import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.LogMessage; @@ -11,7 +13,8 @@ @MessageLogger(projectCode = "SRFTL", length = 5) interface EventLoopLogger extends BasicLogger { - EventLoopLogger LOG = Logger.getMessageLogger(EventLoopLogger.class, EventLoopLogger.class.getPackage().getName()); + EventLoopLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), EventLoopLogger.class, + EventLoopLogger.class.getPackage().getName()); @Message(id = NONE, value = "Found event loop integration %s") @LogMessage(level = Logger.Level.DEBUG) diff --git a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/fallback/FallbackLogger.java b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/fallback/FallbackLogger.java index 0b9c5efc..6727de87 100644 --- a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/fallback/FallbackLogger.java +++ b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/fallback/FallbackLogger.java @@ -1,10 +1,13 @@ package io.smallrye.faulttolerance.core.fallback; +import java.lang.invoke.MethodHandles; + import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.MessageLogger; @MessageLogger(projectCode = "SRFTL", length = 5) interface FallbackLogger extends BasicLogger { - FallbackLogger LOG = Logger.getMessageLogger(FallbackLogger.class, FallbackLogger.class.getPackage().getName()); + FallbackLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), FallbackLogger.class, + FallbackLogger.class.getPackage().getName()); } diff --git a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/metrics/MetricsLogger.java b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/metrics/MetricsLogger.java index dfc1b66d..fd59e48f 100644 --- a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/metrics/MetricsLogger.java +++ b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/metrics/MetricsLogger.java @@ -1,10 +1,13 @@ package io.smallrye.faulttolerance.core.metrics; +import java.lang.invoke.MethodHandles; + import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.MessageLogger; @MessageLogger(projectCode = "SRFTL", length = 5) interface MetricsLogger extends BasicLogger { - MetricsLogger LOG = Logger.getMessageLogger(MetricsLogger.class, MetricsLogger.class.getPackage().getName()); + MetricsLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), MetricsLogger.class, + MetricsLogger.class.getPackage().getName()); } diff --git a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/rate/limit/RateLimitLogger.java b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/rate/limit/RateLimitLogger.java index 7e3386ab..dab79f88 100644 --- a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/rate/limit/RateLimitLogger.java +++ b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/rate/limit/RateLimitLogger.java @@ -1,11 +1,13 @@ package io.smallrye.faulttolerance.core.rate.limit; +import java.lang.invoke.MethodHandles; + import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.MessageLogger; @MessageLogger(projectCode = "SRFTL", length = 5) interface RateLimitLogger extends BasicLogger { - RateLimitLogger LOG = Logger.getMessageLogger(RateLimitLogger.class, + RateLimitLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), RateLimitLogger.class, RateLimitLogger.class.getPackage().getName()); } diff --git a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/retry/RetryLogger.java b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/retry/RetryLogger.java index 56606c53..f3d93f39 100644 --- a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/retry/RetryLogger.java +++ b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/retry/RetryLogger.java @@ -1,10 +1,13 @@ package io.smallrye.faulttolerance.core.retry; +import java.lang.invoke.MethodHandles; + import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.MessageLogger; @MessageLogger(projectCode = "SRFTL", length = 5) interface RetryLogger extends BasicLogger { - RetryLogger LOG = Logger.getMessageLogger(RetryLogger.class, RetryLogger.class.getPackage().getName()); + RetryLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), RetryLogger.class, + RetryLogger.class.getPackage().getName()); } diff --git a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/timeout/TimeoutLogger.java b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/timeout/TimeoutLogger.java index ab9718ef..0735e887 100644 --- a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/timeout/TimeoutLogger.java +++ b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/timeout/TimeoutLogger.java @@ -2,6 +2,8 @@ import static org.jboss.logging.annotations.Message.NONE; +import java.lang.invoke.MethodHandles; + import org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException; import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; @@ -12,7 +14,8 @@ @MessageLogger(projectCode = "SRFTL", length = 5) interface TimeoutLogger extends BasicLogger { - TimeoutLogger LOG = Logger.getMessageLogger(TimeoutLogger.class, TimeoutLogger.class.getPackage().getName()); + TimeoutLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), TimeoutLogger.class, + TimeoutLogger.class.getPackage().getName()); @Message(id = NONE, value = "AsyncTimeoutTask %s created") @LogMessage(level = Logger.Level.TRACE) diff --git a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/timer/TimerLogger.java b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/timer/TimerLogger.java index 3cd4b62d..b956d2ad 100644 --- a/implementation/core/src/main/java/io/smallrye/faulttolerance/core/timer/TimerLogger.java +++ b/implementation/core/src/main/java/io/smallrye/faulttolerance/core/timer/TimerLogger.java @@ -2,6 +2,8 @@ import static org.jboss.logging.annotations.Message.NONE; +import java.lang.invoke.MethodHandles; + import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.Cause; @@ -12,7 +14,8 @@ @MessageLogger(projectCode = "SRFTL", length = 5) interface TimerLogger extends BasicLogger { - TimerLogger LOG = Logger.getMessageLogger(TimerLogger.class, TimerLogger.class.getPackage().getName()); + TimerLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), TimerLogger.class, + TimerLogger.class.getPackage().getName()); @Message(id = NONE, value = "Timer %s created") @LogMessage(level = Logger.Level.TRACE) diff --git a/implementation/fault-tolerance/src/main/java/io/smallrye/faulttolerance/CdiLogger.java b/implementation/fault-tolerance/src/main/java/io/smallrye/faulttolerance/CdiLogger.java index 88dca106..8e746743 100644 --- a/implementation/fault-tolerance/src/main/java/io/smallrye/faulttolerance/CdiLogger.java +++ b/implementation/fault-tolerance/src/main/java/io/smallrye/faulttolerance/CdiLogger.java @@ -1,5 +1,6 @@ package io.smallrye.faulttolerance; +import java.lang.invoke.MethodHandles; import java.util.Set; import jakarta.enterprise.inject.spi.DefinitionException; @@ -14,7 +15,7 @@ @MessageLogger(projectCode = "SRFTL", length = 5) interface CdiLogger extends BasicLogger { - CdiLogger LOG = Logger.getMessageLogger(CdiLogger.class, CdiLogger.class.getPackage().getName()); + CdiLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), CdiLogger.class, CdiLogger.class.getPackage().getName()); @Message(id = 1, value = "MicroProfile: Fault Tolerance activated (SmallRye Fault Tolerance version: %s)") @LogMessage diff --git a/implementation/fault-tolerance/src/main/java/io/smallrye/faulttolerance/internal/InternalLogger.java b/implementation/fault-tolerance/src/main/java/io/smallrye/faulttolerance/internal/InternalLogger.java index 15b1db4b..840cd8cf 100644 --- a/implementation/fault-tolerance/src/main/java/io/smallrye/faulttolerance/internal/InternalLogger.java +++ b/implementation/fault-tolerance/src/main/java/io/smallrye/faulttolerance/internal/InternalLogger.java @@ -1,10 +1,13 @@ package io.smallrye.faulttolerance.internal; +import java.lang.invoke.MethodHandles; + import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.MessageLogger; @MessageLogger(projectCode = "SRFTL", length = 5) interface InternalLogger extends BasicLogger { - InternalLogger LOG = Logger.getMessageLogger(InternalLogger.class, InternalLogger.class.getPackage().getName()); + InternalLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), InternalLogger.class, + InternalLogger.class.getPackage().getName()); } diff --git a/implementation/vertx/src/main/java/io/smallrye/faulttolerance/vertx/VertxLogger.java b/implementation/vertx/src/main/java/io/smallrye/faulttolerance/vertx/VertxLogger.java index 999c55e5..4de8dc84 100644 --- a/implementation/vertx/src/main/java/io/smallrye/faulttolerance/vertx/VertxLogger.java +++ b/implementation/vertx/src/main/java/io/smallrye/faulttolerance/vertx/VertxLogger.java @@ -1,10 +1,13 @@ package io.smallrye.faulttolerance.vertx; +import java.lang.invoke.MethodHandles; + import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.MessageLogger; @MessageLogger(projectCode = "SRFTL", length = 5) interface VertxLogger extends BasicLogger { - VertxLogger LOG = Logger.getMessageLogger(VertxLogger.class, VertxLogger.class.getPackage().getName()); + VertxLogger LOG = Logger.getMessageLogger(MethodHandles.lookup(), VertxLogger.class, + VertxLogger.class.getPackage().getName()); }