Author Topic: Move NodeJS logs inside /opt/nvm/.pm2/logs to user home dir  (Read 20 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Move NodeJS logs inside /opt/nvm/.pm2/logs to user home dir
« on: August 04, 2025, 12:34:22 PM »
Hi!

There is how to move NodeJS logs inside /opt/nvm/.pm2/logs to user home dir?
Some users upload their apps with a bunch of output log lines and this cause the log files to grow and fill the entire disk space.
I was thinking that moving this logs to user's home dir will solve 2 problems:

1. If logs becomes big, they will full the user space quota and affect only your user, not all server;
2. The user can read this logs to debug or get some important information.

There is a way to do it?

Thanks!

Offline
****
Re: Move NodeJS logs inside /opt/nvm/.pm2/logs to user home dir
« Reply #1 on: Today at 02:17:38 AM »
You're referring to pm2, not node.   Node doesn't log anything, but the pm2 wrapper does.  Check the link below, and consider installing logrotate

https://pm2.keymetrics.io/docs/usage/log-management/
Google Hangouts:  rcschaff82@gmail.com