mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +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) + ", "
|
||||
+ dso.getID().toString() + ".");
|
||||
} catch (IdentifierException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
log.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,6 +161,8 @@ public class IdentifierServiceImpl implements IdentifierService {
|
||||
@Override
|
||||
public List<String> lookup(Context context, DSpaceObject dso) {
|
||||
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) {
|
||||
try {
|
||||
String result = service.lookup(context, dso);
|
||||
@@ -176,12 +178,14 @@ public class IdentifierServiceImpl implements IdentifierService {
|
||||
identifiers.add(result);
|
||||
}
|
||||
} 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)
|
||||
.getTypeText(dso) + ", "
|
||||
+ dso.getID().toString() + ".");
|
||||
} catch (IdentifierException ex) {
|
||||
log.error(ex.getMessage(), ex);
|
||||
log.error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user