RM-3386 Replace apache logger with slf4j.

Use slf4j to remove the need for a log level check. Note that the constant
strings will be concatenated at compile time so we don't have to worry
about the performance issue here.
This commit is contained in:
Tom Page
2016-10-03 14:36:31 +01:00
parent ef1c5a2cfd
commit 726c2284b8

View File

@@ -53,8 +53,8 @@ import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern; import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.util.ParameterCheck; import org.alfresco.util.ParameterCheck;
import org.apache.commons.logging.Log; import org.slf4j.Logger;
import org.apache.commons.logging.LogFactory; import org.slf4j.LoggerFactory;
/** /**
* Disposition service implementation. * Disposition service implementation.
@@ -68,7 +68,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
RecordsManagementPolicies.OnFileRecord RecordsManagementPolicies.OnFileRecord
{ {
/** Logger */ /** Logger */
private static Log logger = LogFactory.getLog(DispositionServiceImpl.class); Logger LOGGER = LoggerFactory.getLogger(DispositionServiceImpl.class);
/** Behaviour filter */ /** Behaviour filter */
private BehaviourFilter behaviourFilter; private BehaviourFilter behaviourFilter;
@@ -387,12 +387,10 @@ public class DispositionServiceImpl extends ServiceBaseImpl
{ {
// TODO in the future we should be able to support disposition schedule reuse, but for now just warn that // TODO in the future we should be able to support disposition schedule reuse, but for now just warn that
// only the first disposition schedule will be considered // only the first disposition schedule will be considered
if (logger.isWarnEnabled()) LOGGER.warn("Disposition schedule has more than one associated records management container. "
{ + "This is not currently supported so only the first container will be considered. "
logger.warn("Disposition schedule has more than one associated records management container. " + + "(dispositionScheduleNodeRef={})",
"This is not currently supported so only the first container will be considered. " + dispositionSchedule.getNodeRef().toString());
"(dispositionScheduleNodeRef=" + dispositionSchedule.getNodeRef().toString() + ")");
}
} }
// Get the container reference // Get the container reference