Merge pull request #5 from tcpcloud/logs

docker logs
diff --git a/README.rst b/README.rst
index 41b956b..5cea699 100644
--- a/README.rst
+++ b/README.rst
@@ -25,6 +25,9 @@
         enabled: true
         insecure_registries:
           - 127.0.0.1
+        log:
+          engine: json-file
+          size: 50m
 
 Swarm
 -----
diff --git a/docker/files/default b/docker/files/default
index e81fda0..7aa92ce 100644
--- a/docker/files/default
+++ b/docker/files/default
@@ -1,3 +1,4 @@
+{% from "docker/map.jinja" import host with context %}
 # Docker Upstart and SysVinit configuration file
 
 # Customize location of Docker binary (especially for development testing).
@@ -5,10 +6,11 @@
 
 # Use DOCKER_OPTS to modify the daemon startup options.
 #DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
+DOCKER_OPTS=" --log-driver={{ host.log.get('engine','json-file') }} --log-opt max-size={{ host.log.get('size', '50m') }}"
 
 # If you need Docker to use an HTTP proxy, it can also be specified here.
 #export http_proxy="http://127.0.0.1:3128/"
 
 # This is also a handy place to tweak where Docker's temporary files go.
 #export TMPDIR="/mnt/bigdrive/docker-tmp"
-export no_proxy=localhost,127.0.0.0/8,::1,/var/run/docker.sock
\ No newline at end of file
+export no_proxy=localhost,127.0.0.0/8,::1,/var/run/docker.sock
diff --git a/metadata/service/host/init.yml b/metadata/service/host/init.yml
index 5ce5e32..7e8ef5f 100644
--- a/metadata/service/host/init.yml
+++ b/metadata/service/host/init.yml
@@ -3,4 +3,7 @@
 parameters:
   docker:
     host:
-      enabled: true
\ No newline at end of file
+      enabled: true
+      log:
+        engine: json-file
+        size: 50m
diff --git a/tests/pillar/host_single.sls b/tests/pillar/host_single.sls
index d881df3..991dead 100644
--- a/tests/pillar/host_single.sls
+++ b/tests/pillar/host_single.sls
@@ -1,3 +1,6 @@
 docker:
   host:
     enabled: true
+    log:
+      engine: json-file
+      size: 50m