From c4c30e0c0d5b3acb7d57fae2a4b0d596413d8495 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 9 Jan 2018 18:43:04 -0700 Subject: [PATCH] Add some logging --- core/file_area_web.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/file_area_web.js b/core/file_area_web.js index a8d095d6..6440eb58 100644 --- a/core/file_area_web.js +++ b/core/file_area_web.js @@ -284,6 +284,8 @@ class FileAreaWebAccess { routeWebRequest(req, resp) { const hashId = paths.basename(req.url); + Log.debug( { hashId : hashId, url : req.url }, 'File area web request'); + this.loadServedHashId(hashId, (err, servedItem) => { if(err) { @@ -305,6 +307,8 @@ class FileAreaWebAccess { } routeWebRequestForSingleFile(servedItem, req, resp) { + Log.debug( { servedItem : servedItem }, 'Single file web request'); + const fileEntry = new FileEntry(); servedItem.fileId = servedItem.fileIds[0]; @@ -348,6 +352,8 @@ class FileAreaWebAccess { } routeWebRequestForBatchArchive(servedItem, req, resp) { + Log.debug( { servedItem : servedItem }, 'Batch file web request'); + // // We are going to build an on-the-fly zip file stream of 1:n // files in the batch. @@ -392,8 +398,14 @@ class FileAreaWebAccess { }); }, function createAndServeStream(filePaths, callback) { + Log.trace( { filePaths : filePaths }, 'Creating zip archive for batch web request'); + const zipFile = new yazl.ZipFile(); + zipFile.on('error', err => { + Log.warn( { error : err.message }, 'Error adding file to batch web request archive'); + }); + filePaths.forEach(fp => { zipFile.addFile( fp, // path to physical file