@@ -196,6 +196,8 @@ $ pm2 start app.js -i max -- -a 23 # Pass arguments after -- to app.js
196196$ pm2 start app.js -x # Start app.js in fork mode instead of cluster
197197$ pm2 start app.js -x -- -a 23 # Start app.js in fork mode and pass arguments (-a 23)
198198
199+ $ pm2 start app.js --log-date-format " " YYYY-MM-DD HH:mm Z" # Log will be prefixed with custom time format
200+
199201$ pm2 start app.js --name serverone # Start a process an name it as server one
200202 # you can now stop the process by doing
201203 # pm2 stop serverone
@@ -362,7 +364,9 @@ $ pm2 reloadLogs
362364
363365` ` ` bash
364366--merge-logs : merge logs from different instances but keep error and out separated
367+ --log-date-format <format>: prefix logs with formated timestamp (http://momentjs.com/docs/#/parsing/string-format/)
365368` ` `
369+
366370< a name=" a5" />
367371# # Clustering
368372
@@ -527,6 +531,7 @@ You can define parameters for your apps in `processes.json`:
527531 " name" : " echo" ,
528532 " script" : " examples/args.js" ,
529533 " args" : " ['--toto=heya coco', '-d', '1']" ,
534+ " log-date-format" : " YYYY-MM-DD HH:mm Z" ,
530535 " ignoreWatch" : [" [\\ /\\\\ ]\\ ./" , " node_modules" ],
531536 " watch" : " true" ,
532537 " cwd" : " /this/is/a/path/to/start/script" ,
@@ -538,6 +543,7 @@ You can define parameters for your apps in `processes.json`:
538543 " name" : " api" ,
539544 " script" : " ./examples/child.js" ,
540545 " instances" : " 4" ,
546+ " log-date-format" : " YYYY-MM-DD" ,
541547 " error_file" : " ./examples/child-err.log" ,
542548 " out_file" : " ./examples/child-out.log" ,
543549 " pid_file" : " ./examples/child.pid" ,
@@ -596,6 +602,7 @@ Note that if you execute `pm2 start node-app-2` again, it will spawn an addition
596602 " cwd" : " /srv/node-app/current" ,
597603 " args" : " ['--toto=heya coco', '-d', '1']" ,
598604 " script" : " bin/app.js" ,
605+ " log-date-format" : " YYYY-MM-DD HH:mm Z" ,
599606 " error_file" : " /var/log/node-app/node-app.stderr.log" ,
600607 " out_file" : " log/node-app.stdout.log" ,
601608 " pid_file" : " pids/node-geo-api.pid" ,
0 commit comments