ref #9204 change logger in AbstractPersistentCollection
authorAndreas Müller <a.mueller@bgbm.org>
Tue, 25 Aug 2020 10:54:13 +0000 (12:54 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Tue, 25 Aug 2020 10:56:17 +0000 (12:56 +0200)
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java

index be20e8d87c2b6dafdea9f71dacaa8bb01bdd4d05..54d957fc761c320bc300b442a7f87a6547757913 100644 (file)
@@ -54,6 +54,8 @@ import org.hibernate.engine.spi.SessionFactoryImplementor;
 import org.hibernate.engine.spi.SessionImplementor;
 import org.hibernate.engine.spi.Status;
 import org.hibernate.engine.spi.TypedValue;
+import org.hibernate.internal.CoreLogging;
+import org.hibernate.internal.CoreMessageLogger;
 import org.hibernate.internal.SessionFactoryRegistry;
 import org.hibernate.internal.util.MarkerObject;
 import org.hibernate.internal.util.collections.EmptyIterator;
@@ -87,7 +89,7 @@ import eu.etaxonomy.taxeditor.service.ICachedCommonService;
  * @author Cherian Mathew
  */
 public abstract class AbstractPersistentCollection implements Serializable, PersistentCollection {
-       private static final Logger log = Logger.getLogger( AbstractPersistentCollection.class );
+       private static final CoreMessageLogger LOG = CoreLogging.messageLogger( AbstractPersistentCollection.class );
 
        /**
         * <b>IMPORTANT:</b><br>
@@ -198,7 +200,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
                                // In remoting we are sure that session is null
                                // both when using property paths and switching off conversations
                                if(session == null && remoting) {
-                                       log.info("--> readSize, of " + getRole() + " with key " + getKey());
+                                       LOG.info("--> readSize, of " + getRole() + " with key " + getKey());
                                        read();
                                } else {
                                        boolean isExtraLazy = withTemporarySessionIfNeeded(
@@ -321,7 +323,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
                                        ( (Session) session ).close();
                                }
                                catch (Exception e) {
-                                       log.warn( "Unable to close temporary session used to load lazy collection associated to no session" );
+                                       LOG.warn( "Unable to close temporary session used to load lazy collection associated to no session" );
                                }
                                session = originalSession;
                        }
@@ -343,7 +345,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
                        // In remoting we are sure that session is null
                        // both when using property paths and switching off conversations
                        if(session == null && remoting) {
-                               log.info("--> readIndexExistence, of " + getRole() + " with key " + getKey());
+                               LOG.info("--> readIndexExistence, of " + getRole() + " with key " + getKey());
                                read();
                        } else {
                                Boolean extraLazyExistenceCheck = withTemporarySessionIfNeeded(
@@ -378,7 +380,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
                        // In remoting we are sure that session is null
                        // both when using property paths and switching off conversations
                        if(session == null && remoting) {
-                               log.info("--> readElementExistence, of " + getRole() + " with key " + getKey());
+                               LOG.info("--> readElementExistence, of " + getRole() + " with key " + getKey());
                                read();
 
                        } else {
@@ -416,7 +418,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
                        // In remoting we are sure that session is null
                        // both when using property paths and switching off conversations
                        if(session == null && remoting) {
-                               log.info("--> readElementByIndex, of " + getRole() + " with key " + getKey());
+                               LOG.info("--> readElementByIndex, of " + getRole() + " with key " + getKey());
                                read();
 
                        } else {
@@ -1366,7 +1368,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
                        try {
                                String role = getRole();
                                String fieldName = role.substring(role.lastIndexOf(".") + 1);
-                               log.info("--> Remote Lazy Initializing Collection " + getRole() + " , owner : " + getOwner().getClass() + "/" + getKey() + " , field : " + fieldName);
+                               LOG.info("--> Remote Lazy Initializing Collection " + getRole() + " , owner : " + getOwner().getClass() + "/" + getKey() + " , field : " + fieldName);
                                Object owner = getOwner();
                                CdmBase cdmBase;
                                if(owner instanceof CdmBase) {