Download short format logs from web ui

Fixes #304
This commit is contained in:
Girish Ramakrishnan
2017-04-18 20:32:57 -07:00
parent 3cb4d4b1ab
commit 68a1efe3d3
6 changed files with 49 additions and 17 deletions

View File

@@ -360,7 +360,13 @@ function getLogs(req, res, next) {
debug('Getting logs of app id:%s', req.params.id);
apps.getLogs(req.params.id, lines, false /* follow */, function (error, logStream) {
var options = {
lines: lines,
follow: false,
format: req.query.format
};
apps.getLogs(req.params.id, options, function (error, logStream) {
if (error && error.reason === AppsError.NOT_FOUND) return next(new HttpError(404, 'No such app'));
if (error && error.reason === AppsError.BAD_STATE) return next(new HttpError(412, error.message));
if (error) return next(new HttpError(500, error));