diff --git a/hibernate-core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java b/hibernate-core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java index 822fd9289d..d8a94bb956 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java @@ -27,7 +27,6 @@ import java.lang.reflect.Constructor; import org.hibernate.internal.CoreMessageLogger; import org.hibernate.internal.util.ReflectHelper; - import org.jboss.logging.Logger; /** diff --git a/hibernate-core/src/main/java/org/hibernate/id/enhanced/PooledLoOptimizer.java b/hibernate-core/src/main/java/org/hibernate/id/enhanced/PooledLoOptimizer.java index 6cb9bbd761..299313be3f 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/enhanced/PooledLoOptimizer.java +++ b/hibernate-core/src/main/java/org/hibernate/id/enhanced/PooledLoOptimizer.java @@ -29,7 +29,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.hibernate.HibernateException; import org.hibernate.id.IntegralDataTypeHolder; - +import org.hibernate.internal.CoreMessageLogger; import org.jboss.logging.Logger; /** @@ -41,7 +41,10 @@ import org.jboss.logging.Logger; * @see PooledOptimizer */ public class PooledLoOptimizer extends AbstractOptimizer { - private static final Logger log = Logger.getLogger( PooledLoOptimizer.class ); + private static final CoreMessageLogger LOG = Logger.getMessageLogger( + CoreMessageLogger.class, + PooledLoOptimizer.class.getName() + ); private static class GenerationState { // last value read from db source @@ -61,9 +64,7 @@ public class PooledLoOptimizer extends AbstractOptimizer { if ( incrementSize < 1 ) { throw new HibernateException( "increment size cannot be less than 1" ); } - if ( log.isTraceEnabled() ) { - log.tracev( "Creating pooled optimizer (lo) with [incrementSize={0}; returnClass=]", incrementSize, returnClass.getName() ); - } + LOG.creatingPooledLoOptimizer( incrementSize, returnClass.getName() ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java index 16c0f54b2f..5a3f806bcc 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java @@ -1674,4 +1674,8 @@ public interface CoreMessageLogger extends BasicLogger { "(%2$s=true)" ) void applyingExplicitDiscriminatorColumnForJoined(String className, String overrideSetting); + + @LogMessage(level = DEBUG) + @Message(value = "Creating pooled optimizer (lo) with [incrementSize=%s; returnClass=%s]", id = 458) + void creatingPooledLoOptimizer(int incrementSize, String name); }