-
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
pm2.log and pm2.pid files location #438
Comments
Yes, I've tried this, but these settings affect only child processes, their logs and pids. But the pm2.log and pm2.pid which belongs to main PM2 process are still present in ~/.pm2/ folder. PM2_LOG_FILE_PATH : p.join(p.resolve(process.env.HOME, '.pm2'), 'pm2.log'), Is my understanding right? |
Thanks for reopening an issue and for advice about $HOME env variable. I've found in constants.js that web interface port, for example, is done this way:
WEB_INTERFACE : parseInt(process.env.PM2_API_PORT) || 9615,
That means that if I want to set the web interface port I should simply define $PM2_API_PORT variable, otherwise the system takes the default 9615 value. If it's possible to make the same with pm2.log and pm2.pid files:
PM2_LOG_FILE_PATH : p.join(process.env.PM2_LOG_DIR || p.resolve(process.env.HOME, '.pm2'), 'pm2.log')
PM2_PID_FILE_PATH : p.join(process.env.PM2_PID_DIR || p.resolve(process.env.HOME, '.pm2'), 'pm2.pid')
In this case it's possible to set a separate paths for pm2.log and pm2.pid files using $PM2_LOG_DIR and $PM2_PID_DIR variables. Does it make sense from your point of view? |
+1 it does make sense to me |
Thank you for the quick fix! |
|
It seems that when transfering parts of the constants from |
Will this functionality ever be restored again? Thank you. O. |
Feel free to send a PR on dev branch (https://github.com/Unitech/pm2/blob/development/paths.js) for this feature to land on PM2 2.0 Otherwise we will do it on PM2 > 2.0 |
Thanks for this fix! when will it be released? |
Hello! Thank you for the PM2 project, it's great!
I've got a question about pm2.log and pm2.pid files. As far as I know these files are always located in ~/.pm2/ directory and there is now way to change it via configuration.
Is it possible to add customization for the location of these files?
It would be great to have separate path settings for pm2.log and pm2.pid respectively.
For example:
/var/log/my_project/pm2.log
/var/run/my_project/pm2.pid
Thank you!
The text was updated successfully, but these errors were encountered: