Fix log recursion
shell.sudo logs output to stdout/stderr intentionally. It is not meant for scripts that generate much output (basically scripts/* files). core of the issue is that none of the log commands require to use sudo. they can just use normal tail. only app logs requires sudo because of the logPaths directive in the manifest.
This commit is contained in:
@@ -2108,7 +2108,7 @@ async function getLogs(app, options) {
|
||||
const appId = app.id;
|
||||
|
||||
const logPaths = await getLogPaths(app);
|
||||
const cp = logs.tail(logPaths, { lines: options.lines, follow: options.follow });
|
||||
const cp = logs.tail(logPaths, { lines: options.lines, follow: options.follow, sudo: true }); // need sudo access for paths inside app container (manifest.logPaths)
|
||||
|
||||
const logStream = new logs.LogStream({ format: options.format || 'json', source: appId });
|
||||
logStream.on('close', () => cp.terminate()); // the caller has to call destroy() on logStream. destroy() of Transform emits 'close'
|
||||
|
||||
Reference in New Issue
Block a user