Skip to content

pm2-docker PM2 logs should be optional or disabled #3058

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

Closed
t3h2mas opened this issue Jul 31, 2017 · 4 comments
Closed

pm2-docker PM2 logs should be optional or disabled #3058

t3h2mas opened this issue Jul 31, 2017 · 4 comments

Comments

@t3h2mas
Copy link

t3h2mas commented Jul 31, 2017

What's going wrong?

pm2-docker logs to the ~/.pm2/logs/ directory using the files app-error-0.log and app-out-0.log
Inside of a Docker container, it makes sense to leave log drivers, and more importantly log rotation to the Docker engine.

This means that even if someone uses log rotation at the docker level, PM2 log management would have to be configured within the container

Suggested fix:
Either default to
--output NULL
--error NULL

Or support the arguments in pm2-docker, and make a note somewhere in documentation

How could we reproduce this issue?

Run a docker container using pm2-docker. Be sure your app logs to stdout.
Exec into the running container: docker exec -it <CONTAINERNAME> bash
Change into the logs directory: cd ~/.pm2/logs
Check file size: du -h *

Seeing anything but 0's there means that PM2 will continue to use up disk space from within the container

@vmarchaud
Copy link
Contributor

Should be modified indeed

@Unitech
Copy link
Owner

Unitech commented Aug 2, 2017

that make sense, thanks for the feedback, I've just updated the command

@GaneshSinghPapola
Copy link

@t3h2mas are you using Linux ?
cause in my case no log file are creating by pm2-docker command..
but if i do pm2-start app.js then log files are creating in given path (im using windows 10)

@Unitech
Copy link
Owner

Unitech commented Sep 15, 2017

Fixed on recently published pm2 (2.7.0):

$ npm install pm2@latest -g
$ pm2 update

Now pm2-docker does not write logs by default

Let me know if there is any issue

@Unitech Unitech closed this as completed Sep 15, 2017
inerc pushed a commit to inerc/pm2 that referenced this issue Feb 11, 2020
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

4 participants