From 6ebfc9587a901684212416d5e1d45b6d489503a3 Mon Sep 17 00:00:00 2001 From: Chris Durbin Date: Mon, 30 Sep 2024 16:04:57 -0400 Subject: [PATCH] HARMONY-1914: Reduce a significant amount of the logging noise at the debug level. Use the silly log level when needing these detailed messages. --- .../backends/workflow-orchestration/work-item-polling.ts | 9 ++++----- services/harmony/app/routers/router.ts | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/services/harmony/app/backends/workflow-orchestration/work-item-polling.ts b/services/harmony/app/backends/workflow-orchestration/work-item-polling.ts index bfc55f1e0..3b3f396bf 100644 --- a/services/harmony/app/backends/workflow-orchestration/work-item-polling.ts +++ b/services/harmony/app/backends/workflow-orchestration/work-item-polling.ts @@ -187,7 +187,7 @@ export async function makeWorkScheduleRequest(serviceID: string): Promise */ export async function getWorkFromQueue(serviceID: string, reqLogger: Logger): Promise { const queueUrl = getQueueUrlForService(serviceID); - reqLogger.debug(`Short polling for work from queue ${queueUrl} for service ${serviceID}`); + reqLogger.silly(`Short polling for work from queue ${queueUrl} for service ${serviceID}`); const queue = getQueueForUrl(queueUrl); if (!queue) { @@ -197,7 +197,7 @@ export async function getWorkFromQueue(serviceID: string, reqLogger: Logger): Pr // get a message from the service queue without using long-polling let queueItem = await queue.getMessage(0); if (!queueItem) { - reqLogger.debug(`No work found on queue ${queueUrl} for service ${serviceID} - requesting work from scheduler`); + reqLogger.silly(`No work found on queue ${queueUrl} for service ${serviceID} - requesting work from scheduler`); // put a message on the scheduler queue asking it to schedule some WorkItems for this service await makeWorkScheduleRequest(serviceID); @@ -205,12 +205,11 @@ export async function getWorkFromQueue(serviceID: string, reqLogger: Logger): Pr await processSchedulerQueue(reqLogger); // long poll for work before giving up - reqLogger.debug(`Long polling for work on queue ${queueUrl} for service ${serviceID}`); + reqLogger.silly(`Long polling for work on queue ${queueUrl} for service ${serviceID}`); queueItem = await queue.getMessage(); } if (queueItem) { - // reqLogger.debug(`Found work item ${JSON.stringify(queueItem, null, 2)} on queue ${queueUrl}`); reqLogger.debug(`Found work item on queue ${queueUrl}`); // normally we would process this before deleting the message, but we instead are relying on // our retry mechanism to requeue the message if the worker fails @@ -242,7 +241,7 @@ export async function getWorkFromQueue(serviceID: string, reqLogger: Logger): Pr reqLogger.error(`Error updating work item status to running: ${err.message}`); } } else { - reqLogger.debug(`No work found on queue ${queueUrl} for service ${serviceID}`); + reqLogger.silly(`No work found on queue ${queueUrl} for service ${serviceID}`); } return null; diff --git a/services/harmony/app/routers/router.ts b/services/harmony/app/routers/router.ts index e986ce8e1..1525a14de 100644 --- a/services/harmony/app/routers/router.ts +++ b/services/harmony/app/routers/router.ts @@ -70,11 +70,11 @@ function logged(fn: RequestHandler): RequestHandler { req.context.logger = child; const startTime = new Date().getTime(); try { - child.debug('Invoking middleware'); + child.silly('Invoking middleware'); return fn(req, res, next); } finally { const msTaken = new Date().getTime() - startTime; - child.debug('Completed middleware', { durationMs: msTaken }); + child.silly('Completed middleware', { durationMs: msTaken }); if (req.context.logger === child) { // Other middlewares may have changed the logger. This generally happens // when `next()` is an async call that the middleware doesn't await. Note