Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd a command line flag to specify the log destination #997
Comments
This comment has been minimized.
This comment has been minimized.
|
Not supporting this was a conscious decision. There are just to many ways to approach this problem so the builtin solutions will inevitably blow up in complexity. Maybe the other Docker users can chime in give advice how they are solving the problem. |
This comment has been minimized.
This comment has been minimized.
|
@guoshimin Why do you need to redirect it to a file? Docker keeps the logs for you right now and you can access them via If you need to, you can also run the docker container with: |
This comment has been minimized.
This comment has been minimized.
|
I want to be able to rotate logs, so I don't want docker to keep the logs
Yes there are other ways to approach this problem. Having the ability to On Mon, Aug 17, 2015 at 11:00 AM, discordianfish notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
|
If you're using a recent version of Docker, you can use logging drivers to manage the logs: https://docs.docker.com/reference/logging/overview/ |
This comment has been minimized.
This comment has been minimized.
|
We use cronolog for this, and it works pretty well. |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the suggestions. @swsnider Do you guys run cronolog inside the same container as the main app? I'm trying to run one process per container wherever I can, what with shell not propagating signal to subprocesses. |
This comment has been minimized.
This comment has been minimized.
|
sorry, just realized I was mixed up -- we run our docker containers via upstart, and we use cronolog as part of the upstart script, in combination with docker run. |
This comment has been minimized.
This comment has been minimized.
|
Gotcha. Thank you all for your help. I'll close the issue. |
guoshimin
closed this
Aug 18, 2015
This comment has been minimized.
This comment has been minimized.
SpoorthyB
commented
Sep 28, 2018
|
@guoshimin: I’m interested to know how you are handling this as of today as I have the same scenario as yours. Are you still using shell redirection or do you have an alternative ? |
This comment has been minimized.
This comment has been minimized.
|
@SpoorthyB I no longer need to do this. I simply let docker capture the stdout/stderr and from there I also set up logstash to ship the logs to elasticsearch. If I needed to do it today I would run prometheus under supervisord: http://supervisord.org/configuration.html#program-x-section-example |
guoshimin commentedAug 17, 2015
Currently prometheus logs to stderr. I could use shell redirection to make it log to a file, but that doesn't play well with the official prometheus docker image: I will have to change the entry point from prometheus to shell. It's better to make it a command line flag.