Refactor additional loggers for log4jv2

This commit is contained in:
Patrick Trottier
2018-03-22 19:52:52 -04:00
committed by Mark H. Wood
parent 35b5c6c321
commit bda4fa0ba7
19 changed files with 38 additions and 29 deletions

View File

@@ -28,7 +28,8 @@ import org.springframework.beans.factory.annotation.Autowired;
* @author kevinvandevelde at atmire.com
*/
public class MostRecentChecksumServiceImpl implements MostRecentChecksumService {
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(MostRecentChecksumServiceImpl.class);
private static final Logger log =
org.apache.logging.log4j.LogManager.getLogger(MostRecentChecksumServiceImpl.class);
@Autowired(required = true)
protected MostRecentChecksumDAO mostRecentChecksumDAO;

View File

@@ -32,7 +32,8 @@ import org.dspace.content.Collection;
*/
public class InputFormSelfRegisterWrapperAuthority implements ChoiceAuthority {
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(InputFormSelfRegisterWrapperAuthority.class);
private static Logger log =
org.apache.logging.log4j.LogManager.getLogger(InputFormSelfRegisterWrapperAuthority.class);
private Map<String, ChoiceAuthority> delegates = new HashMap<String, ChoiceAuthority>();

View File

@@ -35,7 +35,8 @@ public class CreativeCommonsRDFStreamDisseminationCrosswalk
/**
* log4j logger
*/
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(CreativeCommonsRDFStreamDisseminationCrosswalk.class);
private static Logger log =
org.apache.logging.log4j.LogManager.getLogger(CreativeCommonsRDFStreamDisseminationCrosswalk.class);
protected BitstreamService bitstreamService = ContentServiceFactory.getInstance().getBitstreamService();
protected CreativeCommonsService creativeCommonsService = LicenseServiceFactory.getInstance()
.getCreativeCommonsService();

View File

@@ -38,7 +38,8 @@ public class CreativeCommonsRDFStreamIngestionCrosswalk
/**
* log4j logger
*/
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(CreativeCommonsRDFStreamIngestionCrosswalk.class);
private static Logger log =
org.apache.logging.log4j.LogManager.getLogger(CreativeCommonsRDFStreamIngestionCrosswalk.class);
protected CreativeCommonsService creativeCommonsService = LicenseServiceFactory.getInstance()
.getCreativeCommonsService();

View File

@@ -42,7 +42,8 @@ public class CreativeCommonsTextStreamDisseminationCrosswalk
/**
* log4j logger
*/
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(CreativeCommonsTextStreamDisseminationCrosswalk.class);
private static Logger log =
org.apache.logging.log4j.LogManager.getLogger(CreativeCommonsTextStreamDisseminationCrosswalk.class);
@Override
public boolean canDisseminate(Context context, DSpaceObject dso) {

View File

@@ -34,7 +34,8 @@ public class LicenseStreamDisseminationCrosswalk
/**
* log4j logger
*/
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(LicenseStreamDisseminationCrosswalk.class);
private static Logger log =
org.apache.logging.log4j.LogManager.getLogger(LicenseStreamDisseminationCrosswalk.class);
protected BitstreamService bitstreamService = ContentServiceFactory.getInstance().getBitstreamService();
@Override

View File

@@ -19,6 +19,7 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dspace.authorize.AuthorizeException;
import org.dspace.content.DSpaceObject;
@@ -65,8 +66,7 @@ public class XHTMLHeadDisseminationCrosswalk extends SelfNamedPlugin implements
/**
* log4j logger
*/
private static Logger log = Logger
.getLogger(XHTMLHeadDisseminationCrosswalk.class);
private static Logger log = LogManager.getLogger(XHTMLHeadDisseminationCrosswalk.class);
/**
* Location of config file

View File

@@ -39,7 +39,8 @@ import org.springframework.beans.factory.annotation.Autowired;
*/
public class SolrServiceResourceRestrictionPlugin implements SolrServiceIndexPlugin, SolrServiceSearchPlugin {
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(SolrServiceResourceRestrictionPlugin.class);
private static final Logger log =
org.apache.logging.log4j.LogManager.getLogger(SolrServiceResourceRestrictionPlugin.class);
@Autowired(required = true)
protected AuthorizeService authorizeService;

View File

@@ -26,8 +26,8 @@ import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.PosixParser;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Logger;
// Replace with new log4j 2: import org.apache.logging.log4j.Level;
import org.dspace.content.Collection;
import org.dspace.content.DCDate;
import org.dspace.content.Item;
@@ -316,7 +316,7 @@ public class SubscribeCLITool {
boolean test = line.hasOption("t");
if (test) {
log.setLevel(Level.DEBUG);
//TODO Replace with log4j2: org.apache.logging.log4j.core.config.Configurator.setLevel();
}
Context context = null;

View File

@@ -43,7 +43,8 @@ public class VersionedHandleIdentifierProviderWithCanonicalHandles extends Ident
/**
* log4j category
*/
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(VersionedHandleIdentifierProviderWithCanonicalHandles.class);
private static Logger log =
org.apache.logging.log4j.LogManager.getLogger(VersionedHandleIdentifierProviderWithCanonicalHandles.class);
/**
* Prefix registered to no one

View File

@@ -57,7 +57,8 @@ public class SimpleDSORelationsConverterPlugin
public static final String SIMPLE_RELATIONS_ITEM2BITSTREAM_KEY = "rdf.simplerelations.item2bitstream";
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(SimpleDSORelationsConverterPlugin.class);
private static final Logger log =
org.apache.logging.log4j.LogManager.getLogger(SimpleDSORelationsConverterPlugin.class);
@Autowired(required = true)
protected BitstreamService bitstreamService;

View File

@@ -27,7 +27,8 @@ public class V6_0_2016_01_26__DS_2188_Remove_DBMS_Browse_Tables implements JdbcM
/**
* log4j category
*/
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(V6_0_2016_01_26__DS_2188_Remove_DBMS_Browse_Tables.class);
private static final Logger log =
org.apache.logging.log4j.LogManager.getLogger(V6_0_2016_01_26__DS_2188_Remove_DBMS_Browse_Tables.class);
/* The checksum to report for this migration (when successful) */
private int checksum = -1;

View File

@@ -22,6 +22,7 @@ import gr.ekt.bte.core.Record;
import gr.ekt.bte.core.RecordSet;
import gr.ekt.bte.core.Value;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dspace.app.util.DCInput;
import org.dspace.app.util.DCInputSet;
@@ -49,8 +50,7 @@ import org.springframework.beans.factory.annotation.Autowired;
*/
public class DSpaceWorkspaceItemOutputGenerator implements OutputGenerator {
private static Logger log = Logger
.getLogger(DSpaceWorkspaceItemOutputGenerator.class);
private static Logger log = LogManager.getLogger(DSpaceWorkspaceItemOutputGenerator.class);
protected Context context;

View File

@@ -21,6 +21,7 @@ import gr.ekt.bte.core.RecordSet;
import gr.ekt.bte.core.StringValue;
import gr.ekt.bte.dataloader.FileDataLoader;
import gr.ekt.bte.exceptions.MalformedSourceException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dspace.core.Context;
@@ -32,8 +33,7 @@ import org.dspace.core.Context;
*/
public class MultipleSubmissionLookupDataLoader implements DataLoader {
private static Logger log = Logger
.getLogger(MultipleSubmissionLookupDataLoader.class);
private static Logger log = LogManager.getLogger(MultipleSubmissionLookupDataLoader.class);
protected final String NOT_FOUND_DOI = "NOT-FOUND-DOI";

View File

@@ -15,6 +15,7 @@ import gr.ekt.bte.core.DataLoadingSpec;
import gr.ekt.bte.core.Record;
import gr.ekt.bte.core.RecordSet;
import gr.ekt.bte.exceptions.MalformedSourceException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dspace.submit.util.ItemSubmissionLookupDTO;
@@ -29,8 +30,7 @@ public class SubmissionItemDataLoader implements DataLoader {
List<DataLoader> providers;
private static Logger log = Logger
.getLogger(SubmissionItemDataLoader.class);
private static Logger log = LogManager.getLogger(SubmissionItemDataLoader.class);
public SubmissionItemDataLoader() {
dtoList = null;

View File

@@ -7,6 +7,7 @@
*/
package org.dspace.submit.step;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dspace.content.InProgressSubmission;
import org.dspace.core.Context;
@@ -16,8 +17,7 @@ public class StartSubmissionLookupStep extends AbstractProcessingStep {
/**
* log4j logger
*/
private static Logger log = Logger
.getLogger(StartSubmissionLookupStep.class);
private static Logger log = LogManager.getLogger(StartSubmissionLookupStep.class);
@Override
public void doPreProcessing(Context context, InProgressSubmission wsi) {

View File

@@ -23,8 +23,7 @@ public class LoggerUsageEventListener extends AbstractUsageEventListener {
/**
* log4j category
*/
private static Logger log = Logger
.getLogger(LoggerUsageEventListener.class);
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(LoggerUsageEventListener.class);
@Override
public void receiveEvent(Event event) {

View File

@@ -10,6 +10,7 @@ package org.dspace.sword;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dspace.content.Community;
import org.dspace.content.DSpaceObject;
@@ -19,8 +20,7 @@ import org.dspace.content.service.CommunityService;
import org.purl.sword.base.Collection;
public class CommunityCollectionGenerator extends ATOMCollectionGenerator {
private static Logger log = Logger
.getLogger(CommunityCollectionGenerator.class);
private static Logger log = LogManager.getLogger(CommunityCollectionGenerator.class);
protected CommunityService communityService = ContentServiceFactory
.getInstance().getCommunityService();

View File

@@ -7,7 +7,7 @@
*/
package org.purl.sword.client;
import org.apache.logging.log4j.PropertyConfigurator;
// Replace with log4j 2: import org.apache.logging.log4j.PropertyConfigurator;
/**
* Entry point for the SWORD Demonstration Client. This will parse the list of
@@ -24,8 +24,8 @@ public class ClientFactory {
// configure the logger from the property file. The GUI client will
// reload these properties if it is set to capture the output and
// display it in a panel.
PropertyConfigurator.configure(this.getClass().getClassLoader()
.getResource(ClientConstants.LOGGING_PROPERTY_FILE));
// Replace with log4j 2: PropertyConfigurator.configure(this.getClass()
// .getClassLoader().getResource(ClientConstants.LOGGING_PROPERTY_FILE));
}
/**