PM2 log output limits
Asked Answered
L

2

38

I'm happy with how PM2 formats and outputs the log with

pm2 logs app

But currently it truncates the log to 20 last entries:

[PM2] Tailing last 20 lines for [app] process ...

Is there a way to change the limits and output it in a similar manner, but with 1000 lines, for example?

Latency answered 19/2, 2017 at 13:52 Comment(0)
N
79

Try this

pm2 logs 'YOUR_PROCESS' --lines 1000
Neri answered 19/2, 2017 at 14:58 Comment(7)
Great. Is there a way to force this behaviour by default with pm2 config file?Latency
I think no. But you can check their documentation.Neri
Didn't find anything on that, adding lines to config couldn't help as well. But thanks anyway.Latency
@CharithJayasanka logs are stored in some files, you just can read the file contentNeri
is there a way to continually listen or read logs, instead of me executing this command again and again?Globetrotter
When you run this command it is streaming the logs.Neri
but how can you show cursor view in terminal, if your logs is too many, then you can't see them all?Metry
S
4
pm2 logs 'process_name' --lines 500
Stroup answered 12/5, 2021 at 4:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.