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 * @author kevinvandevelde at atmire.com
*/ */
public class MostRecentChecksumServiceImpl implements MostRecentChecksumService { 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) @Autowired(required = true)
protected MostRecentChecksumDAO mostRecentChecksumDAO; protected MostRecentChecksumDAO mostRecentChecksumDAO;

View File

@@ -32,7 +32,8 @@ import org.dspace.content.Collection;
*/ */
public class InputFormSelfRegisterWrapperAuthority implements ChoiceAuthority { 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>(); private Map<String, ChoiceAuthority> delegates = new HashMap<String, ChoiceAuthority>();

View File

@@ -35,7 +35,8 @@ public class CreativeCommonsRDFStreamDisseminationCrosswalk
/** /**
* log4j logger * 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 BitstreamService bitstreamService = ContentServiceFactory.getInstance().getBitstreamService();
protected CreativeCommonsService creativeCommonsService = LicenseServiceFactory.getInstance() protected CreativeCommonsService creativeCommonsService = LicenseServiceFactory.getInstance()
.getCreativeCommonsService(); .getCreativeCommonsService();

View File

@@ -38,7 +38,8 @@ public class CreativeCommonsRDFStreamIngestionCrosswalk
/** /**
* log4j logger * 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() protected CreativeCommonsService creativeCommonsService = LicenseServiceFactory.getInstance()
.getCreativeCommonsService(); .getCreativeCommonsService();

View File

@@ -42,7 +42,8 @@ public class CreativeCommonsTextStreamDisseminationCrosswalk
/** /**
* log4j logger * 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 @Override
public boolean canDisseminate(Context context, DSpaceObject dso) { public boolean canDisseminate(Context context, DSpaceObject dso) {

View File

@@ -34,7 +34,8 @@ public class LicenseStreamDisseminationCrosswalk
/** /**
* log4j logger * 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(); protected BitstreamService bitstreamService = ContentServiceFactory.getInstance().getBitstreamService();
@Override @Override

View File

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

View File

@@ -39,7 +39,8 @@ import org.springframework.beans.factory.annotation.Autowired;
*/ */
public class SolrServiceResourceRestrictionPlugin implements SolrServiceIndexPlugin, SolrServiceSearchPlugin { 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) @Autowired(required = true)
protected AuthorizeService authorizeService; 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.Options;
import org.apache.commons.cli.PosixParser; import org.apache.commons.cli.PosixParser;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Logger; 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.Collection;
import org.dspace.content.DCDate; import org.dspace.content.DCDate;
import org.dspace.content.Item; import org.dspace.content.Item;
@@ -316,7 +316,7 @@ public class SubscribeCLITool {
boolean test = line.hasOption("t"); boolean test = line.hasOption("t");
if (test) { if (test) {
log.setLevel(Level.DEBUG); //TODO Replace with log4j2: org.apache.logging.log4j.core.config.Configurator.setLevel();
} }
Context context = null; Context context = null;

View File

@@ -43,7 +43,8 @@ public class VersionedHandleIdentifierProviderWithCanonicalHandles extends Ident
/** /**
* log4j category * 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 * 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"; 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) @Autowired(required = true)
protected BitstreamService bitstreamService; 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 * 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) */ /* The checksum to report for this migration (when successful) */
private int checksum = -1; 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.RecordSet;
import gr.ekt.bte.core.Value; import gr.ekt.bte.core.Value;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.dspace.app.util.DCInput; import org.dspace.app.util.DCInput;
import org.dspace.app.util.DCInputSet; import org.dspace.app.util.DCInputSet;
@@ -49,8 +50,7 @@ import org.springframework.beans.factory.annotation.Autowired;
*/ */
public class DSpaceWorkspaceItemOutputGenerator implements OutputGenerator { public class DSpaceWorkspaceItemOutputGenerator implements OutputGenerator {
private static Logger log = Logger private static Logger log = LogManager.getLogger(DSpaceWorkspaceItemOutputGenerator.class);
.getLogger(DSpaceWorkspaceItemOutputGenerator.class);
protected Context context; 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.core.StringValue;
import gr.ekt.bte.dataloader.FileDataLoader; import gr.ekt.bte.dataloader.FileDataLoader;
import gr.ekt.bte.exceptions.MalformedSourceException; import gr.ekt.bte.exceptions.MalformedSourceException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.dspace.core.Context; import org.dspace.core.Context;
@@ -32,8 +33,7 @@ import org.dspace.core.Context;
*/ */
public class MultipleSubmissionLookupDataLoader implements DataLoader { public class MultipleSubmissionLookupDataLoader implements DataLoader {
private static Logger log = Logger private static Logger log = LogManager.getLogger(MultipleSubmissionLookupDataLoader.class);
.getLogger(MultipleSubmissionLookupDataLoader.class);
protected final String NOT_FOUND_DOI = "NOT-FOUND-DOI"; 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.Record;
import gr.ekt.bte.core.RecordSet; import gr.ekt.bte.core.RecordSet;
import gr.ekt.bte.exceptions.MalformedSourceException; import gr.ekt.bte.exceptions.MalformedSourceException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.dspace.submit.util.ItemSubmissionLookupDTO; import org.dspace.submit.util.ItemSubmissionLookupDTO;
@@ -29,8 +30,7 @@ public class SubmissionItemDataLoader implements DataLoader {
List<DataLoader> providers; List<DataLoader> providers;
private static Logger log = Logger private static Logger log = LogManager.getLogger(SubmissionItemDataLoader.class);
.getLogger(SubmissionItemDataLoader.class);
public SubmissionItemDataLoader() { public SubmissionItemDataLoader() {
dtoList = null; dtoList = null;

View File

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

View File

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

View File

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

View File

@@ -7,7 +7,7 @@
*/ */
package org.purl.sword.client; 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 * 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 // configure the logger from the property file. The GUI client will
// reload these properties if it is set to capture the output and // reload these properties if it is set to capture the output and
// display it in a panel. // display it in a panel.
PropertyConfigurator.configure(this.getClass().getClassLoader() // Replace with log4j 2: PropertyConfigurator.configure(this.getClass()
.getResource(ClientConstants.LOGGING_PROPERTY_FILE)); // .getClassLoader().getResource(ClientConstants.LOGGING_PROPERTY_FILE));
} }
/** /**