mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-12 04:23:13 +00:00
Fix overactive logging when lookup(context, dso) method is called
This commit is contained in:
@@ -151,7 +151,7 @@ public class IdentifierServiceImpl implements IdentifierService {
|
|||||||
.getTypeText(dso) + ", "
|
.getTypeText(dso) + ", "
|
||||||
+ dso.getID().toString() + ".");
|
+ dso.getID().toString() + ".");
|
||||||
} catch (IdentifierException e) {
|
} catch (IdentifierException e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,6 +161,8 @@ public class IdentifierServiceImpl implements IdentifierService {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> lookup(Context context, DSpaceObject dso) {
|
public List<String> lookup(Context context, DSpaceObject dso) {
|
||||||
List<String> identifiers = new ArrayList<>();
|
List<String> identifiers = new ArrayList<>();
|
||||||
|
// Attempt to lookup DSO's identifiers using every available provider
|
||||||
|
// TODO: We may want to eventually limit providers based on DSO type, as not every provider supports every DSO
|
||||||
for (IdentifierProvider service : providers) {
|
for (IdentifierProvider service : providers) {
|
||||||
try {
|
try {
|
||||||
String result = service.lookup(context, dso);
|
String result = service.lookup(context, dso);
|
||||||
@@ -176,12 +178,14 @@ public class IdentifierServiceImpl implements IdentifierService {
|
|||||||
identifiers.add(result);
|
identifiers.add(result);
|
||||||
}
|
}
|
||||||
} catch (IdentifierNotFoundException ex) {
|
} catch (IdentifierNotFoundException ex) {
|
||||||
log.info(service.getClass().getName() + " doesn't find an "
|
// This IdentifierNotFoundException is NOT logged by default, as some providers do not apply to
|
||||||
|
// every DSO (e.g. DOIs usually don't apply to EPerson objects). So it is expected some may fail lookup.
|
||||||
|
log.debug(service.getClass().getName() + " doesn't find an "
|
||||||
+ "Identifier for " + contentServiceFactory.getDSpaceObjectService(dso)
|
+ "Identifier for " + contentServiceFactory.getDSpaceObjectService(dso)
|
||||||
.getTypeText(dso) + ", "
|
.getTypeText(dso) + ", "
|
||||||
+ dso.getID().toString() + ".");
|
+ dso.getID().toString() + ".");
|
||||||
} catch (IdentifierException ex) {
|
} catch (IdentifierException ex) {
|
||||||
log.error(ex.getMessage(), ex);
|
log.error(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user