let the user define a log file or a log format

log file defaults to standard out.

log format defaults to current behavior ('tiny' for production, 'dev' for dev, and not enabled in test)
This commit is contained in:
adrian
2019-04-13 11:55:37 -04:00
parent 63483a3155
commit 9dda95ee8e
2 changed files with 15 additions and 6 deletions

View File

@@ -54,6 +54,14 @@ var opts = require('commander')
'-s, --silent',
'Less verbose output'
)
.option(
'-l|--log_file <file>',
'output log file (defaults to standard out)'
)
.option(
'-f|--log_format <format>',
'define the log format: https://github.com/expressjs/morgan#morganformat-options'
)
.version(
packageJson.version,
'-v, --version'
@@ -74,6 +82,8 @@ var startServer = function(configPath, config) {
port: opts.port,
cors: opts.cors,
silent: opts.silent,
logFile: opts.log_file,
logFormat: opts.log_format,
publicUrl: publicUrl
});
};