logs: prepend date and append newline

This commit is contained in:
Girish Ramakrishnan
2023-04-04 12:25:39 +02:00
parent 8f4c86c1b4
commit 42a4912cc7

View File

@@ -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