Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for log-driver as a docker-compose.yml option #1388

Merged
merged 1 commit into from May 7, 2015

Conversation

vdemeester
Copy link

Discussed in #1303, as docker-py version 1.2.1 support this, we can add it as an option for docker-compose.yml files.

It's kept simple for now, the config files would look like :

web1:
    image: busybox
    log_driver: syslog
web2:
    image: busybox
    log_driver: json-file
web3:
    image: busybox
    log_driver: none

The choice of log_driver is to keep it coherent with the --log-driver option of docker run (even though it's LogConfig in the API).

Signed-off-by: Vincent Demeester vincent@sbr.pm

@@ -271,6 +271,16 @@ labels:
- "com.example.label-with-empty-value"
```

### log drivers

Set the log driver to use for the container, same as the ``--log-driver=""`` option of ``docker run``. The possible value are currently : ``json-file``, ``syslog`` and ``none``. This list will elvolve with the addition of the driver support in the driver engine. The default value is the same as for docker, it is ``json-file``.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads a bit confusingly. How about:

Specify a logging driver for the service's containers, as with the --log-driver option for docker run (documented here).

Allowed values are currently json-file, syslog and none. The list will change over time as more drivers are added to the Docker engine.

The default value is json-file.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header for this section should read "log_driver" too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sounds way better :) I'll update it according to it.

@aanand
Copy link

aanand commented May 6, 2015

Thanks! Minor documentation comments; otherwise, looks great.

Closes docker#1303

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
@vdemeester
Copy link
Author

@aanand took care of your comments ;)

@aanand
Copy link

aanand commented May 7, 2015

Thanks!

LGTM

@dnephin dnephin added this to the 1.3.0 milestone May 7, 2015
@dnephin
Copy link

dnephin commented May 7, 2015

LGTM

dnephin added a commit that referenced this pull request May 7, 2015
Add support for log-driver as a docker-compose.yml option
@dnephin dnephin merged commit 0f2f9db into docker:master May 7, 2015
@nick-allen
Copy link

Is extends going to acknowledge the log_driver setting?

@vdemeester vdemeester deleted the 1303-log-driver-support branch June 5, 2015 14:21
@aanand
Copy link

aanand commented Jun 5, 2015

@nick-allen log_driver should get passed through when you extend a service, yes.

@brancz
Copy link

brancz commented Jul 20, 2015

From what I can tell, this does not cover setting --log-opt correct? Are there plans to allow doing so?
//edit just found #1648 which adds it and it will be available in 1.4.0

@vdemeester
Copy link
Author

@flower-pot it's probably already there #1665 (for the next release 1.4.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants