mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
--time to enable log date prefixing
This commit is contained in:
parent
0f1c2c6a24
commit
3e3077698c
1
bin/pm2
1
bin/pm2
@ -46,6 +46,7 @@ commander.version(pkg.version)
|
||||
.option('-l --log [path]', 'specify log file which gathers both stdout and stderr')
|
||||
.option('--log-type <type>', 'specify log output style (raw by default, json optional)')
|
||||
.option('--log-date-format <date format>', 'add custom prefix timestamp to logs')
|
||||
.option('--time', 'enable time logging')
|
||||
.option('--disable-logs', 'disable all logs storage')
|
||||
.option('--env <environment_name>', 'specify which set of environment variables from ecosystem file must be injected')
|
||||
.option('-a --update-env', 'force an update of the environment with restart/reload (-a <=> apply)')
|
||||
|
||||
@ -70,6 +70,9 @@
|
||||
"type": "string",
|
||||
"docDescription": "Format for log timestamps in moment.js format (eg YYYY-MM-DD HH:mm Z)"
|
||||
},
|
||||
"time": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"env": {
|
||||
"type": [
|
||||
"object",
|
||||
|
||||
@ -626,10 +626,14 @@ Common.verifyConfs = function(appConfs) {
|
||||
/**
|
||||
* Add log_date_format by default
|
||||
*/
|
||||
if (!app.log_date_format) {
|
||||
if (app.time) {
|
||||
app.log_date_format = 'YYYY-MM-DDTHH:mm:ss'
|
||||
}
|
||||
|
||||
if (app.no_time) {
|
||||
app.log_date_format = null
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks + Resolve UID/GID
|
||||
* comes from pm2 --uid <> --gid <> or --user
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user