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

docker-compose logs doesn't work for local log driver #7420

Closed
svarogg opened this issue May 3, 2020 · 0 comments · Fixed by #7425
Closed

docker-compose logs doesn't work for local log driver #7420

svarogg opened this issue May 3, 2020 · 0 comments · Fixed by #7425
Labels

Comments

@svarogg
Copy link

svarogg commented May 3, 2020

Description of the issue

Context information (for bug reports)

Output of docker-compose version

docker-compose version 1.25.5, build 8a1c60f6
docker-py version: 4.1.0
CPython version: 3.7.5
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

Output of docker version

Client:
 Version:           18.09.9-ce
 API version:       1.39
 Go version:        go1.10.3
 Git commit:        039a7df
 Built:             Fri Nov  1 19:26:49 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.09.9-ce
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       039a7df
  Built:            Fri Nov  1 19:28:24 2019
  OS/Arch:          linux/amd64
  Experimental:     false

Output of docker-compose config
(Make sure to add the relevant -f and other flags)

services:
  rabbit:
    image: rabbitmq
    logging:
      driver: local
version: '3.0'

Steps to reproduce the issue

  1. Create the above docker-compose.yaml file
  2. Call docker-compose up -d
  3. Call docker-compose logs

Observed result

$ docker-compose logs
Attaching to mike_rabbit_1
rabbit_1 | WARNING: no logs are available with the 'local' log driver

Expected result

Get logs from rabbitmq

Stacktrace / full error message

N/A

Additional information

If I do docker logs <container-id> this works.

This seems like it comes from compose/container.py:

    @property
    def has_api_logs(self):
        log_type = self.log_driver
        return not log_type or log_type in ('json-file', 'journald')

That doesn't include 'local'.

I'll try to fix it and if it's as easy as adding 'local' to the list - will send a PR tomorrow.

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

Successfully merging a pull request may close this issue.

1 participant