From a568aeda17314f9df215f2ae3e2357290c741727 Mon Sep 17 00:00:00 2001 From: mohit-singh4 <158050587+mohit-singh4@users.noreply.github.com> Date: Wed, 28 Aug 2024 12:47:47 +0530 Subject: [PATCH] [MNT- 24124] Adding node references in DownloadStorage and ZipDownloadExporter files. (#2880) * [MNT-24124]: Adding nodeReferences in loggers * [MNT-24124]: Adding nodeReferences in loggers * [fix/MNT-24124] Adding-nodeReferences-inLogger --------- Co-authored-by: Mohit Singh Co-authored-by: mohit-singh4 --- .../org/alfresco/repo/download/DownloadStorage.java | 12 +++++++++++- .../alfresco/repo/download/ZipDownloadExporter.java | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/repository/src/main/java/org/alfresco/repo/download/DownloadStorage.java b/repository/src/main/java/org/alfresco/repo/download/DownloadStorage.java index fb1b819456..d8931a9d3d 100644 --- a/repository/src/main/java/org/alfresco/repo/download/DownloadStorage.java +++ b/repository/src/main/java/org/alfresco/repo/download/DownloadStorage.java @@ -157,9 +157,10 @@ public class DownloadStorage if (log.isDebugEnabled()) { + String downloadNodeRefString = "Download-NodeRef=" + downloadNodeRef; StringBuilder msg = new StringBuilder(); msg.append("Created Download. ") - .append("', Download-NodeRef="); + .append(downloadNodeRefString); log.debug(msg.toString()); } return downloadNodeRef; @@ -221,6 +222,11 @@ public class DownloadStorage Long total = (Long)properties.get(DownloadModel.PROP_TOTAL); Long filesAdded = (Long)properties.get(DownloadModel.PROP_FILES_ADDED); Long totalFiles = (Long)properties.get(DownloadModel.PROP_TOTAL_FILES); + + if (log.isDebugEnabled()) + { + log.debug("Status for Download-NodeRef: "+downloadNodeRef+": done: "+done+", total: "+total+", filesAdded: "+filesAdded+", totalFiles: "+totalFiles); + } return new DownloadStatus(DownloadStatus.Status.valueOf((String)properties.get(DownloadModel.PROP_STATUS)), done != null ? done.longValue() : 0l, @@ -239,6 +245,10 @@ public class DownloadStorage public void updateStatus(NodeRef nodeRef, DownloadStatus status) { + if (log.isDebugEnabled()) + { + log.debug("Updating status for Download-NodeRef: "+nodeRef+" to status: "+status.getStatus()); + } validateNode(nodeRef); nodeService.setProperty(nodeRef, DownloadModel.PROP_STATUS, status.getStatus().toString()); diff --git a/repository/src/main/java/org/alfresco/repo/download/ZipDownloadExporter.java b/repository/src/main/java/org/alfresco/repo/download/ZipDownloadExporter.java index f4572a2de4..ccf5c93f34 100644 --- a/repository/src/main/java/org/alfresco/repo/download/ZipDownloadExporter.java +++ b/repository/src/main/java/org/alfresco/repo/download/ZipDownloadExporter.java @@ -174,6 +174,10 @@ public class ZipDownloadExporter extends BaseExporter try { + if (log.isDebugEnabled()) + { + log.debug("Archiving content for nodeRef: "+nodeRef+" with contentURL: "+contentData.getContentUrl()); + } // ALF-2016 ZipArchiveEntry zipEntry=new ZipArchiveEntry(getPath()); zipEntry.setTime(zipTimestampCreated.getTime());