I am currently configuring/changing logging for my docker containers. As I already have several environments with a default logging driver json-file I wonder I it is possible to change the logging driver without container recreation? I do not see options relevant to logging in docker start, only in docker run. Is it possible? Maybe with api instead of cli?
@rradecki I don’t think the logging driver can be changed for a running container (although I could be wrong). Trying to modify it through the API directly, strikes me as especially “Here Be Dragons”. I’d be quite shocked if that worked…
Why not just re-run it? Containers are meant to be ephemeral and removed / new ones started constantly.
@stefanlasiewski Docker will rotate by default in json file if you set the proper --log-opts. If the containers are logging to disk, consider configuring the process to log to STDOUT/STDERR and/or you can just tail -f the logs for the ENTRYPOINT of the container after exec-ing the process you want to run (this is slightly more belabored than it looks however, see gosu as an example of issues which can come up with signal forwarding).