diff --git a/lib/handlers/hydrater.js b/lib/handlers/hydrater.js index 60b0180..9ff102d 100644 --- a/lib/handlers/hydrater.js +++ b/lib/handlers/hydrater.js @@ -47,7 +47,8 @@ module.exports = function(req, res, server, next) { log.warn(err, "Error while queuing " + (task.file_path) ? task.file_path : task.document.id); } else { - log.info(task, "Queuing task"); + var loggingTask = {file_path: task.file_path, callback: task.callback, document: {id: task.document.id, identifier: task.document.identifier}}; + log.info(loggingTask, "Queuing task"); } }); diff --git a/lib/helpers/child-process.js b/lib/helpers/child-process.js index b9edd90..a074cfd 100644 --- a/lib/helpers/child-process.js +++ b/lib/helpers/child-process.js @@ -20,6 +20,7 @@ var logError = require('../utils').logError; var filePath; var path; +var opbeatInitialized = false; process.on('message', function(task) { filePath = task.file_path; @@ -29,9 +30,10 @@ process.on('message', function(task) { logError.config = task.opbeatConfig; /* istanbul ignore next */ - if(task.opbeatConfig && task.opbeatConfig.secretToken) { + if(!opbeatInitialized && task.opbeatConfig && task.opbeatConfig.secretToken) { var opbeat = require('opbeat'); logError.opbeat = opbeat(task.opbeatConfig); + opbeatInitialized = true; } async.waterfall([