在永远的 JS 配置文件中指定日志记录选项
Specifying logging options in forever JS config file
github readme of forever.js 状态
In addition to passing forever the path to a script (along with
accompanying options, described above), you may also pass forever the
path to a JSON file containing these options. For example, consider an
application with the following file structure:
在下面的示例中,设置了选项uid
、append
、watch
、script
和sourceDir
。所有这些都是 forever
命令参数的长版本(短版本为 -a
、-w
、-s
)。
我的问题是:forever
的某些选项没有长版本,例如 -m
、-l
、-e
、-o
. 如何在我的 json 配置文件中提供这些选项?
我试过给 "l"
和 "log"
等键添加值,但这没有达到预期的效果。
尝试使用这些,它们对我有用:
日志文件、输出文件、错误文件
logFile、outFile、errFile 也适用于我。 :)
就我而言,我使用了:myapp_config.json
{
"uid": "myapp",
"append": true,
"watch": true,
"script": "myscript.js",
"sourceDir": "/home/myaccount/myproj/myapp",
"logFile": "/home/myaccount/.forever/forever.log",
"outFile": "/home/myaccount/.forever/out.log",
"errFile": "/home/myaccount/.forever/err.log"
}
用法:
永远开始myapp_config.json
永远停止我的应用程序
似乎列出了所有 shorthand 选项的 JSON 属性 here。例如,-p
的 JSON 属性 将是 "path"
.
var argvOptions = cli.argvOptions = {
'command': {alias: 'c'},
'errFile': {alias: 'e'},
'logFile': {alias: 'l'},
'killTree': {alias: 't', boolean: true},
'append': {alias: 'a', boolean: true},
'fifo': {alias: 'f', boolean: true},
'number': {alias: 'n'},
'max': {alias: 'm'},
'outFile': {alias: 'o'},
'path': {alias: 'p'},
'help': {alias: 'h'},
'silent': {alias: 's', boolean: true},
'verbose': {alias: 'v', boolean: true},
'watch': {alias: 'w', boolean: true},
'debug': {alias: 'd', boolean: true},
'plain': {boolean: true},
'uid': {alias: 'u'}
};
github readme of forever.js 状态
In addition to passing forever the path to a script (along with accompanying options, described above), you may also pass forever the path to a JSON file containing these options. For example, consider an application with the following file structure:
在下面的示例中,设置了选项uid
、append
、watch
、script
和sourceDir
。所有这些都是 forever
命令参数的长版本(短版本为 -a
、-w
、-s
)。
我的问题是:forever
的某些选项没有长版本,例如 -m
、-l
、-e
、-o
. 如何在我的 json 配置文件中提供这些选项?
我试过给 "l"
和 "log"
等键添加值,但这没有达到预期的效果。
尝试使用这些,它们对我有用: 日志文件、输出文件、错误文件
logFile、outFile、errFile 也适用于我。 :)
就我而言,我使用了:myapp_config.json
{
"uid": "myapp",
"append": true,
"watch": true,
"script": "myscript.js",
"sourceDir": "/home/myaccount/myproj/myapp",
"logFile": "/home/myaccount/.forever/forever.log",
"outFile": "/home/myaccount/.forever/out.log",
"errFile": "/home/myaccount/.forever/err.log"
}
用法:
永远开始myapp_config.json
永远停止我的应用程序
似乎列出了所有 shorthand 选项的 JSON 属性 here。例如,-p
的 JSON 属性 将是 "path"
.
var argvOptions = cli.argvOptions = {
'command': {alias: 'c'},
'errFile': {alias: 'e'},
'logFile': {alias: 'l'},
'killTree': {alias: 't', boolean: true},
'append': {alias: 'a', boolean: true},
'fifo': {alias: 'f', boolean: true},
'number': {alias: 'n'},
'max': {alias: 'm'},
'outFile': {alias: 'o'},
'path': {alias: 'p'},
'help': {alias: 'h'},
'silent': {alias: 's', boolean: true},
'verbose': {alias: 'v', boolean: true},
'watch': {alias: 'w', boolean: true},
'debug': {alias: 'd', boolean: true},
'plain': {boolean: true},
'uid': {alias: 'u'}
};