diff --git a/lib/commands/log.js b/lib/commands/log.js index ac74d3027..0f4d2241c 100644 --- a/lib/commands/log.js +++ b/lib/commands/log.js @@ -40,7 +40,7 @@ class LogCommand extends Command { })); } - const logFileName = path.join(instance.dir, 'content/logs', `${instance.config.get('url').replace(/[^\w]/gi, '_')}_${this.system.environment}.log`); + const logFileName = path.join(instance.dir, 'content/logs', `${instance.config.get('url').replace(/[^\w]/gi, '_')}_${this.system.environment}${argv.error ? '.error' : ''}.log`); const prettyStream = new PrettyStream(); if (!fs.existsSync(logFileName)) { @@ -85,6 +85,11 @@ LogCommand.options = { alias: 'f', description: 'Follow the log file (similar to `tail -f`)', type: 'boolean' + }, + error: { + alias: 'e', + description: 'If provided, only show the error log', + type: 'boolean' } }; LogCommand.global = true;