How to get the docker container logs using docker-java client library

I tried the following code but the response contains an object instead of logs.

    DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder()
       .withDockerHost("tcp://IP:PORT").withDockerTlsVerify(true)
       .withDockerCertPath("...........CERTIFICATE PATH..........").build();

    DockerClient dockerClient = DockerClientBuilder.getInstance(config).build();
    dockerClient.logContainerCmd("Container ID")
                                 .withStdOut(true).withFollowStream(true)
                                 .exec();

  • how should microservices talk to each other in docker
  • How to do a custom hostname (URL) to site in docker container in Ubuntu 16.04?
  • Secure Logging drivers with Docker?
  • Docker postgres does not run init file in docker-entrypoint-initdb.d
  • Push selected files from service repository to Consul
  • Gitlab & Mattermost OAUTH Time out
  • Running GUI apps on docker container with a MacBookPro host
  • Use last container name as default in docker client
  • What should the actioncable URL be set to under docker?
  • Dockerise Nginx, PHP-FPM using Sentry local server
  • Docker app in Exited (0) status
  • Debugging linked docker containers when using docker-compose
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.