Put healthcheck errors in app logs
This commit is contained in:
12
src/apps.js
12
src/apps.js
@@ -61,6 +61,8 @@ exports = module.exports = {
|
||||
getLogPaths,
|
||||
getLogs,
|
||||
|
||||
appendLogLine,
|
||||
|
||||
getCertificate,
|
||||
|
||||
start,
|
||||
@@ -2013,6 +2015,16 @@ async function getLogs(app, options) {
|
||||
return transformStream;
|
||||
}
|
||||
|
||||
// never fails just prints error
|
||||
async function appendLogLine(app, line) {
|
||||
assert.strictEqual(typeof app, 'object');
|
||||
assert.strictEqual(typeof line, 'string');
|
||||
|
||||
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}`);
|
||||
}
|
||||
|
||||
async function getCertificate(subdomain, domain) {
|
||||
assert.strictEqual(typeof subdomain, 'string');
|
||||
assert.strictEqual(typeof domain, 'string');
|
||||
|
||||
Reference in New Issue
Block a user