Skip to content
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

Can I change the default number of log lines that 'pm2 logs' prints? #2719

Closed
glyphCezilleSantillan opened this issue Feb 15, 2017 · 2 comments

Comments

@glyphCezilleSantillan
Copy link

I am able to do pm2 logs --err --nostream --lines 50 <id>, but having to specify it each time gets a bit cumbersome. Is there a way to change the default to something bigger? Javascript error stacks usually look like this with 10 lines:

$ pm2 logs --err --nostream 0
[TAILING] Tailing last 10 lines for [0] process (change the value with --lines option)
C:\Users\Me\.pm2\logs\restricted-error-0.log last 10 lines:
0|<myapp> |     at Receiver.expectHandler (C:\Users\Me\Projects\node\restricted\node_modules\ws\lib\Receiver.js:499:31)
0|<myapp> |     at Receiver.add (C:\Users\Me\Projects\node\restricted\node_modules\ws\lib\Receiver.js:103:24)
0|<myapp> |     at Socket.realHandler (C:\Users\Me\Projects\node\restricted\node_modules\ws\lib\WebSocket.js:825:20)
0|<myapp> |     at emitOne (events.js:77:13)
0|<myapp> |     at Socket.emit (events.js:169:7)
0|<myapp> |     at readableAddChunk (_stream_readable.js:153:18)
0|<myapp> |     at Socket.Readable.push (_stream_readable.js:111:10)
0|<myapp> |     at TCP.onread (net.js:537:20)
0|<myapp> | WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
0|<myapp> | WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode

I manually set things with --lines 20 and it then shows me the complete stack trace.

@glyphCezilleSantillan
Copy link
Author

Ooh, didn't see @vmarchaud's updates sooner. I was hoping for something like an environment variable or something inside the ecosystem.json file. But this is great, 15 lines are much better than 10. Thanks! (And now I know where to hack locally while waiting for release ;) )

@vmarchaud
Copy link
Contributor

Released in pm2 2.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants