log: date is iso string

This commit is contained in:
Girish Ramakrishnan
2023-04-04 19:12:30 +02:00
parent 42a4912cc7
commit 61b7dfa58c

View File

@@ -2041,8 +2041,9 @@ async function appendLogLine(app, line) {
assert.strictEqual(typeof line, 'string');
const logFilePath = path.join(paths.LOG_DIR, app.id, 'app.log');
const isoDate = new Date(new Date().toUTCString()).toISOString();
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}`);
if (!safe.fs.appendFileSync(logFilePath, `${isoDate} ${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