I'm using an application declaration file to start my app. and I'm trying to point the log files to a custom location. I've tried several different approaches:
//"error_file": node.env._LOGS+"/node_errors.log",
//"out_file": node.env._LOGS+"/node_output.log",
//"error_file": "/var/www/โโโโโโโโ.com/log/errors.log"
//"out_file": "/var/www/โโโโโโโโ.com/log/output.log",
"error_file" : "./child-err.log",
"out_file" : "./child-out.log",
But no matter what I try the logs are placed in the default pm2 location:
Describing process with id 0 - name โโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ status โ online โ
โ name โ โโโโโโโโ โ
โ restarts โ 4 โ
โ uptime โ 2s โ
โ script path โ /var/www/โโโโโโโโ.com/deployment/platform.js โ
โ script args โ N/A โ
โ error log path โ /root/.pm2/logs/โโโโโโโโ-error.log โ
โ out log path โ /root/.pm2/logs/โโโโโโโโ-out.log โ
โ pid path โ /root/.pm2/pids/โโโโโโโโ.pid โ
โ interpreter โ node โ
โ interpreter args โ N/A โ
โ script id โ 0 โ
โ exec cwd โ /var/www/โโโโโโโโ.com/deployment โ
โ exec mode โ fork_mode โ
โ node.js version โ 4.2.2 โ
โ watch & reload โ โ โ
โ unstable restarts โ 0 โ
โ created at โ 2016-06-23T09:38:27.597Z โ
โโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
OS : Debian 7.10
node.js : 4.2.2
PM2 : 1.1.3
I guess It's related to #576
Thanx in advance.
socket.io
Hello!
I have the same issue. I change out_path and nothing happens.
Could you describe why this issue is closed, please? How to fix it?
Thank you!
Yeah, I don't know what happened, but after trying many options it suddenly started to work. I can't put a finger on what was different, however here is my last config:
"error_file": "/var/www/โโโโโโโโ.com/log/node-err.log",
"out_file": "/var/www/โโโโโโโโ.com/log/node-out.log",
hope it helps.
I change out_path and nothing happens.
out_path or out_file?
I have json config:
{
"apps" : [{
"script": "app.js",
"name": "app",
"log_date_format": "YYYY-MM-DD HH:mm:ss",
"out_file": "/srv/logs/app/out.log",
}]
}
and I restart my app with a command: pm2 reload process.json
I also tried a command: pm2 restart process.json
And I see default log files in desc command like this:
| error log path โ /home/stroykova/.pm2/logs/app-error-0.log โ
โ out log path โ /home/stroykova/.pm2/logs/app-out-0.log โ
These are default paths. Hovewer log_date_format was changed.
Maybe there is an issue with directory owner, but I don't see any message about that. Maybe I need to do a restart in some other way.
I see the same problem in your issue. Asked if you know the solution =)
I reopen the issue, hope the devs'll help you
I am seeing the same thing. Also tried log_file, and that was ignored too.
I tried relative and absolute file paths and both were ignored also.
I then tried a garbage variable xxxxx and it was ignored but no error message. Looks like the JSON validation could do with be tightened up a bit
The following does work:
"out_file" : "app-out.log",
"error_file" : "app-err.log",
It seems you have to kill the PM2 God Daemon for this change to be picked up!
It also accepts absolute file names
Documentation got updated with exact value to use, we refactored it in november so it should work now.
Hi @vmarchaud -- I was wondering if you could give the link to the documentation that got updated? I've been all over the docs and all I could find were Git comments saying that you had to do a kill/start options. If there's a newer update, that'd be great. Thanks!
Right here and for update to get picked up, you should try with --update-env options
Thanks! But that doesn't note anything about pm2 restart/reload not picking up changes? Is that just a change within the latest version of pm2? Or is the proper way for those changes to get picked up still to do the pm2 kill followed by pm2 start app.json and just expect some downtime when the json file is updated and changes need to be picked up?
I throught we added in the changelog and the docs but no, so there it is
Awesome -- thank you so much!
Maybe this will be useful for someone - I got this issue using mac OS 10.12.5 node v6.9.4 and pm2 2.4.6; seems like it does not reload config if app was started before; delete and start again helped:
pm2 delete appnamehere
pm2 start confignamehere
Most helpful comment
Maybe this will be useful for someone - I got this issue using mac OS 10.12.5 node v6.9.4 and pm2 2.4.6; seems like it does not reload config if app was started before; delete and start again helped:
pm2 delete appnameherepm2 start confignamehere