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

Container Logs example not working #315

Open
FlowOverFail opened this issue Oct 24, 2021 · 0 comments
Open

Container Logs example not working #315

FlowOverFail opened this issue Oct 24, 2021 · 0 comments

Comments

@FlowOverFail
Copy link

FlowOverFail commented Oct 24, 2021

  • Crate version: 0.7
  • OS: Ubuntu 20.04.3 LTS
  • Output of running docker version on the command line:

Client: Docker Engine - Community
Version: 20.10.9
API version: 1.41
Go version: go1.16.8
Git commit: c2ea9bc
Built: Mon Oct 4 16:08:29 2021
OS/Arch: linux/amd64
Context: default
Experimental: true

Server: Docker Engine - Community
Engine:
Version: 20.10.9
API version: 1.41 (minimum version 1.12)
Go version: go1.16.8
Git commit: 79ea9d3
Built: Mon Oct 4 16:06:37 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.11
GitCommit: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0

Hey guys, I cannot grab the container logs using the code from the example. It doesn't seem to print my debug message. Running docker container logs <ID> works fine as expected. Does anyone else have this issue?

let mut logs_stream = docker
        .containers()
        .get(&container.id)
        .logs(&LogsOptions::builder().stdout(true).stderr(true).build());
    
while let Some(log_result) = logs_stream.next().await {
        println!("This isn't logged");
        match log_result {
            Ok(chunk) => print_chunk(chunk),
            Err(e) => eprintln!("Error: {}", e),
        }
    }
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

No branches or pull requests

1 participant