From 42a4912cc7ead46a9bf06e01fa0fbcf4e0e3eea5 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 4 Apr 2023 12:25:39 +0200 Subject: [PATCH] logs: prepend date and append newline --- src/apps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps.js b/src/apps.js index 90031c1b5..b14f072c7 100644 --- a/src/apps.js +++ b/src/apps.js @@ -2042,7 +2042,7 @@ async function appendLogLine(app, line) { const logFilePath = path.join(paths.LOG_DIR, app.id, 'app.log'); - if (!safe.fs.appendFileSync(logFilePath, line)) console.error(`Could not append log line for app ${app.id} at ${logFilePath}: ${safe.error.message}`); + if (!safe.fs.appendFileSync(logFilePath, `${new Date(new Date().toUTCString())} ${line}\n`)) console.error(`Could not append log line for app ${app.id} at ${logFilePath}: ${safe.error.message}`); } // does a re-configure when called from most states. for install/clone errors, it re-installs with an optional manifest