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:
10
src/main.js
10
src/main.js
@@ -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
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user