From 68db0a20ddb44f9d3bd3220af7a1556b39baac9c Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Mon, 5 Dec 2016 15:18:36 +0100 Subject: [PATCH] Handle logging in compose to swarm Logging configuration was completely ignore when deploy a compose file to swarm. This fixes it. Signed-off-by: Vincent Demeester --- command/stack/deploy.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/command/stack/deploy.go b/command/stack/deploy.go index e7764f3b8d..1f41cb7d89 100644 --- a/command/stack/deploy.go +++ b/command/stack/deploy.go @@ -567,6 +567,14 @@ func convertService( return swarm.ServiceSpec{}, err } + var logDriver *swarm.Driver + if service.Logging != nil { + logDriver = &swarm.Driver{ + Name: service.Logging.Driver, + Options: service.Logging.Options, + } + } + serviceSpec := swarm.ServiceSpec{ Annotations: swarm.Annotations{ Name: name, @@ -589,6 +597,7 @@ func convertService( TTY: service.Tty, OpenStdin: service.StdinOpen, }, + LogDriver: logDriver, Resources: resources, RestartPolicy: restartPolicy, Placement: &swarm.Placement{