Skip to content

Commit

Permalink
Add rotation feature to docker logs (#563)
Browse files Browse the repository at this point in the history
* Add rotation feature to docker logs

* Fix: only apply log rotation for json-file log driver
  • Loading branch information
qiluo-msft committed May 6, 2017
1 parent 2810f25 commit 6cab3bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ start() {
else

docker run -d {{docker_image_run_opt}} \
{%- if '--log-driver=json-file' in docker_image_run_opt or '--log-driver' not in docker_image_run_opt %}
--log-opt max-size=2M --log-opt max-file=5 \
{%- endif %}
-v /var/run/redis:/var/run/redis:rw \
-v /usr/share/sonic/device/$PLATFORM:/usr/share/sonic/platform:ro \
-v /usr/share/sonic/device/$PLATFORM/$HWSKU:/usr/share/sonic/hwsku:ro \
Expand Down

0 comments on commit 6cab3bc

Please sign in to comment.