title: Using docker-compose with GELF log driver
body: <p>According <a href="https://docs.docker.com/reference/logging/overview/">to the official Docker docs</a>, it is possible to get the <code>stdout</code> and <code>stderr</code> output of a container as <a href="https://www.graylog.org/resources/gelf/">GELF messages</a> which is a format that is understood by e.g. <a href="https://www.graylog.org/">Graylog / Graylog2</a> and <a href="https://www.elastic.co/products/logstash">logstash</a>.</p>
  
  <p>This works fine when I run my containers manually from the command line. For instance,</p>
  
  <pre><code>docker run --log-driver=gelf --log-opt gelf-address=udp://localhost:12201 busybox echo This is my  message.
  </code></pre>
  
  <p>will send a log message to my Graylog2 server running on localhost which has a UDP input listener configured at port 12201.</p>
  
  <p>Now, I want to use the same log options with <a href="https://docs.docker.com/compose/">docker-compose</a> which, according to the docs, <a href="https://docs.docker.com/compose/yml/#log-driver">should be possible in principle</a>. However, the docs do not mention any log formats but <code>json-file</code>, <code>syslog</code> and <code>none</code> and when I include something like</p>
  
  <pre><code>my-container:
    container_name: ...
    build: ...
    ports: ...
    log_driver: "gelf"
    log_opt:
      gelf-address: "udp://localhost:12201"
  </code></pre>
  
  <p>in my <code>docker-compose.yml</code> file then <code>docker-compose up</code> fails with:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;string&gt;", line 3, in &lt;module&gt;
    File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 39, in main
    File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
    File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
    File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
    File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
    File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 495, in up
    File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 265, in up
    File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 369, in execute_convergence_plan
    File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 270, in create_container
    File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 643, in _get_container_create_options
    File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 656, in _get_container_host_config
    File "/code/build/docker-compose/out00-PYZ.pyz/docker.utils.types", line 27, in __init__
  ValueError: LogConfig.type must be one of (json-file, syslog, none)
  </code></pre>
  
  <p>For the record, this was on docker-compose 1.4.0 and docker 1.8.1, build d12ea79.</p>
  
  <p>Apparently, Docker and docker-compose are not at the same level of implementation here. I just found that this has already been solved and included in the <code>Master branch</code> on Github, see
  <a href="https://github.com/docker/compose/issues/1869">https://github.com/docker/compose/issues/1869</a>
  and
  <a href="https://github.com/docker/docker-py/pull/724">https://github.com/docker/docker-py/pull/724</a> .</p>
  
  <p>Is there any way to either re-install docker-compose from the current Master branch or to add this to an existing installation manually? I could not find the file where the commit goes to anywhere on my host...</p>