-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I combine the output and error logs? #337
Comments
I don't think it's a good idea but perhaps that setting the same output file into a JSON declaration would work ;). |
I tried passing the same output file to |
You can now merge all logs of the same process name to the same output and error file via the option |
Let's say I only have one process. Can |
Could we maybe reopen this issue? As I see, Here's a workaround I found, until pm2 enables support for this. It's a bit more complicated because of the numbers added to the end of the log filenames. MYLOG_BASENAME="myapp.log"
pm2 start myapp.js -o $MYLOG_BASENAME.out -e $MYLOG_BASENAME.err
ACTUAL_LOG=$(pm2 -m l | grep -o /.\*$MYLOG_BASENAME.\*out)
ACTUAL_ERR=$(pm2 -m l | grep -o /.\*$MYLOG_BASENAME.\*err)
tail -f $ACTUAL_LOG $ACTUAL_ERR | tee -a $MYLOG_BASENAME.both Please let me know if there's a simpler way to achieve this. |
Any updates? The workaround above require running |
Seems no good options here. My best bet is to use Heka or Logstash listening on TCP to manage logs yourself. |
forever
has a-l
option that directs both STDOUT and STDERR of the app into the same file. This is useful as I can see after which operations (output viaconsole.log
) some error has occurred (output viaconsole.error
).How can I do this with pm2?
The text was updated successfully, but these errors were encountered: