improved logs

This commit is contained in:
Francesco Mangiacrapa 2023-04-28 12:36:40 +02:00
parent 6203503026
commit 1b5eb2e5b0
1 changed files with 5 additions and 3 deletions

View File

@ -1243,6 +1243,8 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
JSONPathWrapper wrapper = new JSONPathWrapper(doc.getTheDocument().toJson());
List<String> matchingPaths = wrapper.getMatchingPaths(path);
log.info("matchingPaths is: "+matchingPaths);
String error = null;
if (matchingPaths.isEmpty()) {
error = "No Registered FileSet found at " + path;
@ -1481,7 +1483,7 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
private static final RegisteredFileSet prepareRegisteredFileSet(Access toSetAccess, String docID, String profileID,
Document attributes, List<TempFile> files, StorageUtils storage, WorkspaceManager ws)
throws StorageHubException, StorageException {
log.debug("Preparing Registered FileSet {}");
log.info("Preparing Registered FileSet {}");
RegisteredFileSet toReturn = new RegisteredFileSet();
if (attributes != null)
toReturn.putAll(attributes);
@ -1522,11 +1524,11 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
else
fileUrl = storage.getURL(f.getId());
log.debug("Got URL {} from ID {}", fileUrl, f.getId());
log.info("Got URL {} from ID {}", fileUrl, f.getId());
is = new URL(fileUrl).openStream();
RegisteredFile registered = ws.registerFile(new WorkspaceManager.FileOptions(f.getFilename(), is,
"Imported via gcube CMS service ", sectionFolder));
log.debug("Registered " + registered);
log.info("Registered " + registered);
registeredFiles.add(registered);
} catch (StorageHubException | IOException e) {
throw new StorageException("Unable to store " + f, e);